Exemple #1
0
        private void InitDesktop()
        {
            if (desktop != null && sprites != null)
            {
                return;
            }
            this.desktop = new Desktop(this, GetWidth(), GetHeight());
            this.sprites = new Sprites(GetWidth(), GetHeight());
            if (dialog == null)
            {
                LPixmap g = new LPixmap(GetWidth() - 20,
                                        GetHeight() / 2 - 20, true);
                g.SetAlphaValue(0, 0, 0, 125);
                g.FillRect(0, 0, g.GetWidth(), g.GetHeight());
                g.Dispose();
                dialog = g.Texture;
                g      = null;
            }
            this.message = new LMessage(dialog, 0, 0);
            this.message.SetFontColor(LColor.white);
            int size = message.GetWidth() / (message.GetMessageFont().GetSize());

            if (LSystem.scaleWidth != 1 || LSystem.scaleHeight != 1)
            {
                if (size % 2 != 0)
                {
                    size = size + 2;
                }
                else
                {
                    size = size + 3;
                }
            }
            else
            {
                if (size % 2 != 0)
                {
                    size = size - 3;
                }
                else
                {
                    size = size - 4;
                }
            }
            this.message.SetMessageLength(size);
            this.message.SetLocation((GetWidth() - message.GetWidth()) / 2,
                                     GetHeight() - message.GetHeight() - 10);
            this.message.SetVisible(false);
            this.select = new LSelect(dialog, 0, 0);
            this.select.SetLocation(message.X(), message.Y());
            this.scrCG = new AVGCG();
            this.desktop.Add(message);
            this.desktop.Add(select);
            this.select.SetVisible(false);
        }
Exemple #2
0
 public abstract void InitSelectConfig(LSelect select);
Exemple #3
0
 public override void InitSelectConfig(LSelect select)
 {
 }
Exemple #4
0
        private void InitDesktop()
        {
            if (desktop != null && sprites != null)
            {
                return;
            }
            this.desktop = new Desktop(this, GetWidth(), GetHeight());
            this.sprites = new Sprites(GetWidth(), GetHeight());
            if (dialog == null)
            {
                LImage tmp = LImage.CreateImage(GetWidth() - 20,
                                                GetHeight() / 2 - 20, true);
                LGraphics g = tmp.GetLGraphics();
                g.SetColor(0, 0, 0, 125);
                g.FillRect(0, 0, tmp.GetWidth(), tmp.GetHeight());
                g.Dispose();
                g      = null;
                dialog = new LTexture(GLLoader.GetTextureData(tmp));
                if (tmp != null)
                {
                    tmp.Dispose();
                    tmp = null;
                }
            }
            this.message = new LMessage(dialog, 0, 0);
            this.message.SetFontColor(LColor.white);
            int size = message.GetWidth() / (message.GetMessageFont().GetSize());

            if (LSystem.scaleWidth != 1 || LSystem.scaleHeight != 1)
            {
                if (size % 2 != 0)
                {
                    size = size + 2;
                }
                else
                {
                    size = size + 3;
                }
            }
            else
            {
                if (size % 2 != 0)
                {
                    size = size - 3;
                }
                else
                {
                    size = size - 4;
                }
            }
            this.message.SetMessageLength(size);
            this.message.SetLocation((GetWidth() - message.GetWidth()) / 2,
                                     GetHeight() - message.GetHeight() - 10);
            this.message.SetVisible(false);
            this.select = new LSelect(dialog, 0, 0);
            this.select.SetLocation(message.X(), message.Y());
            this.scrCG = new AVGCG();
            this.desktop.Add(message);
            this.desktop.Add(select);
            this.select.SetVisible(false);
        }
Exemple #5
0
            public void DoClick(LComponent comp)
            {
                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;
                    }
                }
            }