Ejemplo n.º 1
0
            public void DownClick(LComponent comp, float x, float y)
            {
                if (comp.Tag is LLKScreen)
                {
                    LMessage  message = (LMessage)comp;
                    LLKScreen screen  = (LLKScreen)comp.Tag;
                    if (!screen.init)
                    {
                        if (screen.count == 0)
                        {
                            screen.role.SetImage(screen.GetImage(12));
                            message.SetMessage(START_MES);
                        }
                        else if (message.IsComplete())
                        {
                            screen.CallEvent(new _Runnable(screen, message));
                        }
                        screen.count++;
                    }

                    if (HELP_MES.Equals(message.GetMessage(), StringComparison.InvariantCultureIgnoreCase) && message.IsComplete())
                    {
                        message.SetVisible(false);
                        screen.select = new LSelect(screen.GetImage(14), (screen
                                                                          .GetWidth() - 460) / 2,
                                                    screen.GetHeight() - 126 - 10);
                        screen.select.Tag = screen;
                        screen.select.SetFontColor(LColor.black);
                        screen.select.SetAlpha(0.8f);
                        screen.select.SetTopOffset(-5);
                        screen.select.SetMessage(new String[] { "1.刷新", "2.提示", "3.炸弹",
                                                                "4.取消" });
                        screen.select.Click = new SelectClick();
                        screen.Add(screen.select);
                        return;
                    }
                    else if ((EASY_MES.Equals(message.GetMessage(), StringComparison.InvariantCultureIgnoreCase) || message.GetMessage()
                              .StartsWith(SORRY)) &&
                             message.IsComplete())
                    {
                        screen.mes.SetVisible(false);
                        screen.role.SetVisible(false);
                        screen.helpRole.SetVisible(true);
                        if (screen.stage != null)
                        {
                            screen.stage.SetVisible(true);
                        }
                    }
                }
            }
Ejemplo n.º 2
0
            public override void Run()
            {
                LLKScreen screen = (LLKScreen)StaticCurrentSceen;
                Grid      prev   = null;

                for (int j = 0; j < v.Count; j++)
                {
                    prev = (Grid)v.Poll();
                    prev.SetVisible(true);
                    v.Add(prev);
                    try
                    {
                        Sleep(20L);
                    }
                    catch (Exception)
                    {
                    }
                }
                Grid current = prev;

                prev = (Grid)v.Poll();
                while (!v.IsEmpty())
                {
                    Grid o = (Grid)v.Poll();
                    o.SetVisible(false);
                    try
                    {
                        Sleep(20L);
                    }
                    catch (Exception)
                    {
                    }
                }
                prev.SetVisible(false);
                current.SetVisible(false);
                current.SetImage(screen.GetImage(9));
                prev.SetImage(screen.GetImage(9));
                current.SetBorder(1);
                prev.SetBorder(1);
                if (!screen.FindPair())
                {
                    screen.Refreshs();
                }
            }
Ejemplo n.º 3
0
            public void Run()
            {
                LLKScreen s = (LLKScreen)StaticCurrentSceen;

                Grid current = null;

                try {
                    if (s.prev != null)
                    {
                        s.prev.SetBorder(3);
                    }

                    if (s.prev == null)
                    {
                        s.prev = s.GetGrid(s.GetTouchX(), s.GetTouchY());
                        if (s.prev != null)
                        {
                            s.prev.SetBorder(0);
                        }
                    }
                    else
                    {
                        if (s.progress.GetValue() == 0)
                        {
                            return;
                        }

                        current = s.GetGrid(s.GetTouchX(), s.GetTouchY());
                        if (current == s.prev)
                        {
                            return;
                        }
                        if (current == null)
                        {
                            s.prev = null;
                        }
                        if (s.prev == null)
                        {
                            return;
                        }
                        if (current.Equals(s.prev))
                        {
                            if (!s.FindPair())
                            {
                                s.Refreshs();
                            }
                            s.pcount = s.FindPath(s.prev, current);
                            if (s.pcount != 0)
                            {
                                s.DeletePair(s.prev, current);
                                s.prev = null;
                                return;
                            }
                        }
                        s.prev.SetBorder(1);
                        s.prev = current;
                        s.prev.SetBorder(0);
                        if (!s.FindPair())
                        {
                            s.Refreshs();
                        }
                    }
                } catch (Exception) {
                    if (s.prev != null)
                    {
                        s.prev.SetBorder(3);
                    }
                    if (current != null)
                    {
                        current.SetBorder(3);
                    }
                }
            }
Ejemplo n.º 4
0
            public void DownClick(LComponent comp, float x, float y)
            {
                if (comp.Tag is Screen)
                {
                    LLKScreen screen = (LLKScreen)comp.Tag;
                    LSelect   select = (LSelect)comp;

                    switch (select.GetResultIndex())
                    {
                    case 0:
                        screen.mes.SetVisible(true);
                        if (screen.refreshcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.Refreshs();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY1_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 1:
                        screen.mes.SetVisible(true);
                        if (screen.tipcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.ShowNext();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY2_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 2:
                        screen.mes.SetVisible(true);
                        if (screen.bombcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.UseBomb();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY3_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 3:
                        screen.mes.SetVisible(true);
                        screen.Remove(select);
                        screen.mes.SetVisible(false);
                        screen.role.SetVisible(false);
                        screen.helpRole.SetVisible(true);
                        if (screen.stage != null)
                        {
                            screen.stage.SetVisible(true);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
Ejemplo n.º 5
0
 public _Runnable(LLKScreen s, LMessage m)
 {
     this.screen  = s;
     this.message = m;
 }
Ejemplo n.º 6
0
 public _Runnable(LLKScreen s, LMessage m)
 {
     this.screen = s;
     this.message = m;
 }