Esempio n. 1
0
        private static void CleanUp()
        {
            for (int i = TextureList.Count - 1; i >= 0; i--)
            {
                MImage m = TextureList[i];

                if (m == null)
                {
                    continue;
                }

                if (m.Image != null && !m.Image.Disposed)
                {
                    m.Image.Dispose();
                }
            }
            TextureList.Clear();


            for (int i = ControlList.Count - 1; i >= 0; i--)
            {
                MirControl c = ControlList[i];

                if (c == null)
                {
                    continue;
                }

                c.DisposeTexture();
            }
            ControlList.Clear();
        }
Esempio n. 2
0
        public static void CreateKillChainLabel()
        {
            if (KillChainBaseLabel == null || KillChainBaseLabel.IsDisposed)
            {
                KillChainBaseLabel = new MirControl
                {
                    BackColour         = Color.FromArgb(50, 50, 50),
                    Border             = true,
                    BorderColour       = Color.Black,
                    DrawControlTexture = true,
                    Location           = new Point(5, 500),
                    NotControl         = true,
                    Opacity            = 0.5F
                };
            }

            if (KillChainLabel == null || KillChainLabel.IsDisposed)
            {
                KillChainLabel = new MirLabel
                {
                    AutoSize   = true,
                    BackColour = Color.Transparent,
                    ForeColour = Color.OrangeRed,
                    Parent     = KillChainBaseLabel,
                    Font       = new Font(Settings.FontName, 10F, FontStyle.Bold)
                };

                KillChainLabel.SizeChanged += (o, e) => KillChainBaseLabel.Size = KillChainLabel.Size;
            }

            KillChainLabel.Text = KillChainMessage;
        }
Esempio n. 3
0
        private static void CreateDebugLabel()
        {
            if (!Settings.DebugMode)
            {
                return;
            }

            if (DebugBaseLabel == null || DebugBaseLabel.IsDisposed)
            {
                DebugBaseLabel = new MirControl
                {
                    BackColour         = Color.FromArgb(50, 50, 50),
                    Border             = true,
                    BorderColour       = Color.Black,
                    DrawControlTexture = true,
                    Location           = new Point(5, 5),
                    NotControl         = true,
                    Opacity            = 0.5F
                };
            }

            if (DebugTextLabel == null || DebugTextLabel.IsDisposed)
            {
                DebugTextLabel = new MirLabel
                {
                    AutoSize   = true,
                    BackColour = Color.Transparent,
                    ForeColour = Color.White,
                    Parent     = DebugBaseLabel,
                };

                DebugTextLabel.SizeChanged += (o, e) => DebugBaseLabel.Size = DebugTextLabel.Size;
            }


            string text;

            if (MirControl.MouseControl != null)
            {
                text = string.Format("FPS: {0}", FPS);

                if (MirControl.MouseControl is MapControl)
                {
                    text += string.Format(", Co Ords: {0}", MapControl.MapLocation);
                }

                if (MirScene.ActiveScene is GameScene)
                {
                    text += string.Format(", Objects: {0}", MapControl.Objects.Count);
                }
            }
            else
            {
                text = string.Format("FPS: {0}", FPS);
            }


            DebugTextLabel.Text = text;
        }
Esempio n. 4
0
        internal static void DisposeItemLabel()
        {
            if (ItemLabel != null && !ItemLabel.IsDisposed)
            {
                ItemLabel.Dispose();
            }

            ItemLabel = null;
        }
Esempio n. 5
0
        public static void Clean()
        {
            for (int i = TextureList.Count - 1; i >= 0; i--)
            {
                MImage m = TextureList[i];

                if (m == null)
                {
                    TextureList.RemoveAt(i);
                    continue;
                }

                if (CMain.Time <= m.CleanTime)
                {
                    continue;
                }


                TextureList.RemoveAt(i);
                if (m.Image != null && !m.Image.Disposed)
                {
                    m.Image.Dispose();
                }
            }

            for (int i = ControlList.Count - 1; i >= 0; i--)
            {
                MirControl c = ControlList[i];

                if (c == null)
                {
                    ControlList.RemoveAt(i);
                    continue;
                }

                if (CMain.Time <= c.CleanTime)
                {
                    continue;
                }

                c.DisposeTexture();
            }
        }
Esempio n. 6
0
        public HelpPage(string title, int imageID, MirControl page)
        {
            Title   = title;
            ImageID = imageID;
            Page    = page;

            NotControl = true;
            Size       = new System.Drawing.Size(508, 396 + 40);

            BeforeDraw += HelpPage_BeforeDraw;

            PageTitleLabel = new MirLabel
            {
                Text       = Title,
                Font       = new Font(Settings.FontName, 10F, FontStyle.Bold),
                DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                Parent     = this,
                Size       = new System.Drawing.Size(242, 30),
                Location   = new Point(135, 4)
            };
        }
Esempio n. 7
0
        public static void Create()
        {
            Window = new MirImageControl
            {
                Index       = 1,
                Library     = Libraries.Prguse,
                Parent      = GameScene.Scene,
                Location    = new Point(0, 450),
                PixelDetect = true,
                Visible     = true
            };
            Window.BeforeDraw += new EventHandler(Window_BeforeDraw);

            HealthOrb = new MirControl
            {
                Parent     = Window,
                Location   = new Point(0, 30),
                NotControl = true
            };
            HealthOrb.BeforeDraw += new EventHandler(HealthOrb_BeforeDraw);

            HealthLabel = new MirLabel
            {
                AutoSize = true,
                Parent   = HealthOrb,
                Location = new Point(0, 32),
                Text     = string.Format("HP {0}/{1}", 0, 0),
            };
            HealthLabel.SizeChanged += new EventHandler(Label_SizeChanged);
            ManaLabel = new MirLabel
            {
                AutoSize = true,
                Parent   = HealthOrb,
                Location = new Point(0, 50),
                Text     = string.Format("HP {0}/{1}", 0, 0),
            };
            ManaLabel.SizeChanged += new EventHandler(Label_SizeChanged);

            LevelLabel = new MirLabel
            {
                AutoSize = true,
                Font     = new Font("Microsoft Sans Serif", 8F),
                Parent   = Window,
                Location = new Point(5, 108),
            };
            CharacterName = new MirLabel
            {
                DrawFormat = DrawTextFormat.Center | DrawTextFormat.VerticalCenter,
                Parent     = Window,
                Location   = new Point(6, 122),
                Size       = new Size(90, 16)
            };


            ExperienceBar = new MirImageControl
            {
                Index      = 7,
                Library    = Libraries.Prguse,
                Location   = new Point(9, 143),
                Parent     = Window,
                DrawImage  = false,
                NotControl = true,
            };
            ExperienceBar.BeforeDraw += new EventHandler(ExperienceBar_BeforeDraw);

            ExperienceLabel = new MirLabel
            {
                AutoSize   = true,
                Font       = new Font("Microsoft Sans Serif", 8F),
                Parent     = ExperienceBar,
                NotControl = true,
            };

            GoldLabel = new MirLabel
            {
                DrawFormat = DrawTextFormat.VerticalCenter,
                Parent     = Window,
                Font       = new Font("Microsoft Sans Serif", 8F),
                Location   = new Point(695, 120),
                Size       = new Size(99, 11),
                Sound      = SoundList.Gold,
            };
            GoldLabel.Click += (o, e) =>
            {
                if (MirItemCell.SelectedCell == null)
                {
                    MirItemCell.PickedUpGold = !MirItemCell.PickedUpGold && MapObject.User.Gold > 0;
                }
            };



            WeightBar = new MirImageControl
            {
                Index      = 76,
                Library    = Libraries.Prguse,
                Location   = new Point(695, 103),
                Parent     = Window,
                DrawImage  = false,
                NotControl = true,
            };
            WeightBar.BeforeDraw += new EventHandler(WeightBar_BeforeDraw);

            SpaceLabel = new MirLabel
            {
                Parent   = Window,
                Font     = new Font("Microsoft Sans Serif", 8F),
                Location = new Point(770, 101),
                Size     = new Size(26, 14)
            };


            InventoryButton = new MirButton
            {
                HoverIndex   = 1904,
                Index        = 1903,
                Library      = Libraries.Prguse,
                Location     = new Point(704, 76),
                Parent       = Window,
                PressedIndex = 1905,
                Sound        = SoundList.ClickA,
            };
            InventoryButton.Click += new EventHandler(InventoryButton_Click);

            CharacterButton = new MirButton
            {
                HoverIndex   = 1901,
                Index        = 1900,
                Library      = Libraries.Prguse,
                Location     = new Point(681, 76),
                Parent       = Window,
                PressedIndex = 1902,
            };
            CharacterButton.Click += new EventHandler(CharacterButton_Click);

            SkillButton = new MirButton
            {
                HoverIndex   = 1907,
                Index        = 1906,
                Library      = Libraries.Prguse,
                Location     = new Point(727, 76),
                Parent       = Window,
                PressedIndex = 1908,
                Sound        = SoundList.ClickA,
            };
            SkillButton.Click += new EventHandler(SkillButton_Click);

            QuestButton = new MirButton
            {
                HoverIndex   = 1910,
                Index        = 1909,
                Library      = Libraries.Prguse,
                Location     = new Point(750, 76),
                Parent       = Window,
                PressedIndex = 1911,
                Sound        = SoundList.ClickA,
            };
            QuestButton.Click += new EventHandler(QuestButton_Click);

            OptionButton = new MirButton
            {
                HoverIndex   = 1913,
                Index        = 1912,
                Library      = Libraries.Prguse,
                Location     = new Point(773, 76),
                Parent       = Window,
                PressedIndex = 1914,
            };
            OptionButton.Click += new EventHandler(OptionButton_Click);

            MenuButton = new MirButton
            {
                HoverIndex   = 1961,
                Index        = 1960,
                Library      = Libraries.Prguse,
                Location     = new Point(745, 35),
                Parent       = Window,
                PressedIndex = 1962,
                Sound        = SoundList.ClickC,
            };
            MenuButton.Click += new EventHandler(MenuButton_Click);
        }
Esempio n. 8
0
        public FishingDialog()
        {
            Index       = 1340;
            Library     = Libraries.Prguse;
            Movable     = true;
            Sort        = true;
            Location    = Center;
            BeforeDraw += FishingDialog_BeforeDraw;

            TitleLabel = new MirLabel
            {
                Location   = new Point(10, 4),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
                Parent     = this,
                NotControl = true,
                Size       = new Size(180, 20),
            };

            FishingRod = new MirControl
            {
                Parent     = this,
                Location   = new Point(0, 30),
                NotControl = true,
            };
            FishingRod.BeforeDraw += FishingRod_BeforeDraw;

            CloseButton = new MirButton
            {
                HoverIndex   = 361,
                Index        = 360,
                Location     = new Point(175, 3),
                Library      = Libraries.Prguse2,
                Parent       = this,
                PressedIndex = 362,
                Sound        = SoundList.ButtonA,
            };

            CloseButton.Click += (o, e) => Hide();

            Grid = new MirItemCell[Enum.GetNames(typeof(FishingSlot)).Length];

            Grid[(int)FishingSlot.Hook] = new MirItemCell
            {
                ItemSlot = (int)FishingSlot.Hook,
                GridType = MirGridType.Fishing,
                Parent   = this,
                Size     = new Size(34, 30),
                Location = new Point(17, 203),
            };
            Grid[(int)FishingSlot.Float] = new MirItemCell
            {
                ItemSlot = (int)FishingSlot.Float,
                GridType = MirGridType.Fishing,
                Parent   = this,
                Size     = new Size(34, 30),
                Location = new Point(17, 241),
            };

            Grid[(int)FishingSlot.Bait] = new MirItemCell
            {
                ItemSlot = (int)FishingSlot.Bait,
                GridType = MirGridType.Fishing,
                Parent   = this,
                Size     = new Size(34, 30),
                Location = new Point(57, 241),
            };

            Grid[(int)FishingSlot.Finder] = new MirItemCell
            {
                ItemSlot = (int)FishingSlot.Finder,
                GridType = MirGridType.Fishing,
                Parent   = this,
                Size     = new Size(34, 30),
                Location = new Point(97, 241),
            };

            Grid[(int)FishingSlot.Reel] = new MirItemCell
            {
                ItemSlot = (int)FishingSlot.Reel,
                GridType = MirGridType.Fishing,
                Parent   = this,
                Size     = new Size(34, 30),
                Location = new Point(137, 241),
            };
        }
Esempio n. 9
0
        private static void CleanUp()
        {
            if (Sprite != null)
            {
                if (!Sprite.Disposed)
                {
                    Sprite.Dispose();
                }

                Sprite = null;
            }

            if (Line != null)
            {
                if (!Line.Disposed)
                {
                    Line.Dispose();
                }

                Line = null;
            }

            if (CurrentSurface != null)
            {
                if (!CurrentSurface.Disposed)
                {
                    CurrentSurface.Dispose();
                }

                CurrentSurface = null;
            }

            if (PoisonDotBackground != null)
            {
                if (!PoisonDotBackground.Disposed)
                {
                    PoisonDotBackground.Dispose();
                }

                PoisonDotBackground = null;
            }

            if (RadarTexture != null)
            {
                if (!RadarTexture.Disposed)
                {
                    RadarTexture.Dispose();
                }

                RadarTexture = null;
            }

            if (FloorTexture != null)
            {
                if (!FloorTexture.Disposed)
                {
                    FloorTexture.Dispose();
                }

                DXManager.FloorTexture = null;
                GameScene.Scene.MapControl.FloorValid = false;

                if (DXManager.FloorSurface != null && !DXManager.FloorSurface.Disposed)
                {
                    DXManager.FloorSurface.Dispose();
                }

                DXManager.FloorSurface = null;
            }

            if (LightTexture != null)
            {
                if (!LightTexture.Disposed)
                {
                    LightTexture.Dispose();
                }

                DXManager.LightTexture = null;

                if (DXManager.LightSurface != null && !DXManager.LightSurface.Disposed)
                {
                    DXManager.LightSurface.Dispose();
                }

                DXManager.LightSurface = null;
            }

            if (Lights != null)
            {
                for (int i = 0; i < Lights.Count; i++)
                {
                    if (!Lights[i].Disposed)
                    {
                        Lights[i].Dispose();
                    }
                }
                Lights.Clear();
            }

            for (int i = TextureList.Count - 1; i >= 0; i--)
            {
                MImage m = TextureList[i];

                if (m == null)
                {
                    continue;
                }

                m.DisposeTexture();
            }
            TextureList.Clear();


            for (int i = ControlList.Count - 1; i >= 0; i--)
            {
                MirControl c = ControlList[i];

                if (c == null)
                {
                    continue;
                }

                c.DisposeTexture();
            }
            ControlList.Clear();
        }
Esempio n. 10
0
        public HeroMenuPanel(MirControl parent)
        {
            Index   = 2179;
            Library = Libraries.Prguse;
            Size    = new Size(24, 61);
            Parent  = parent;

            Location = new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)) + 362, Settings.ScreenHeight - Size.Height - 77);

            HeroMagicsButton = new MirButton
            {
                Index        = 2173,
                HoverIndex   = 2174,
                PressedIndex = 2175,
                Library      = Libraries.Prguse,
                Parent       = this,
                Size         = new Size(16, 16),
                Location     = new Point(3, 3),
                Hint         = string.Format(GameLanguage.HeroSkills, CMain.InputKeys.GetKey(KeybindOptions.HeroSkills))
            };
            HeroMagicsButton.Click += (o, e) =>
            {
                if (GameScene.Scene.HeroDialog.Visible && GameScene.Scene.HeroDialog.SkillPage.Visible)
                {
                    GameScene.Scene.HeroDialog.Hide();
                }
                else
                {
                    GameScene.Scene.HeroDialog.Show();
                    GameScene.Scene.HeroDialog.ShowSkillPage();
                }
            };

            HeroInventoryButton = new MirButton
            {
                Index        = 2170,
                HoverIndex   = 2171,
                PressedIndex = 2172,
                Library      = Libraries.Prguse,
                Parent       = this,
                Size         = new Size(16, 16),
                Location     = new Point(3, 20),
                Hint         = string.Format(GameLanguage.HeroInventory, CMain.InputKeys.GetKey(KeybindOptions.HeroInventory))
            };
            HeroInventoryButton.Click += (o, e) =>
            {
                GameScene.Scene.HeroInventoryDialog.Visible = !GameScene.Scene.HeroInventoryDialog.Visible;
            };

            HeroEquipmentButton = new MirButton
            {
                Index        = 2176,
                HoverIndex   = 2177,
                PressedIndex = 2178,
                Library      = Libraries.Prguse,
                Parent       = this,
                Size         = new Size(16, 16),
                Location     = new Point(3, 37),
                Hint         = string.Format(GameLanguage.HeroCharacter, CMain.InputKeys.GetKey(KeybindOptions.HeroEquipment))
            };
            HeroEquipmentButton.Click += (o, e) =>
            {
                if (GameScene.Scene.HeroDialog.Visible && GameScene.Scene.HeroDialog.CharacterPage.Visible)
                {
                    GameScene.Scene.HeroDialog.Hide();
                }
                else
                {
                    GameScene.Scene.HeroDialog.Show();
                    GameScene.Scene.HeroDialog.ShowCharacterPage();
                }
            };
        }
Esempio n. 11
0
        public GuildBoardDialog()
        {
            Index    = 688;
            Library  = Libraries.Prguse;
            Movable  = true;
            Location = new Point(0, 0);
            Sort     = true;
            //BeforeDraw += new EventHandlerDraw_BeforeDraw);

            TitleLabel = new MirImageControl
            {
                Index    = 46,
                Library  = Libraries.Title,
                Location = new Point(20, 4),
                Parent   = this
            };

            GuildNameLabel = new MirLabel
            {
                Text       = "Guild Name",
                Location   = new Point(200, 41),
                Parent     = this,
                AutoSize   = true,
                DrawFormat = TextFormatFlags.Default,
                Font       = new Font(Settings.FontName, 14f),
                ForeColour = Color.White,
                NotControl = true
            };
            WriterLabel = new MirLabel
            {
                Text       = "Writer",
                Location   = new Point(64, 72),
                Parent     = this,
                AutoSize   = true,
                DrawFormat = TextFormatFlags.Default,
                Font       = new Font(Settings.FontName, 10f),
                ForeColour = Color.Yellow,
                NotControl = true
            };
            MessageTextLabel = new MirLabel
            {
                Text       = "Message Text",
                Location   = new Point(264, 72),
                Parent     = this,
                AutoSize   = true,
                DrawFormat = TextFormatFlags.Default,
                Font       = new Font(Settings.FontName, 10f),
                ForeColour = Color.Yellow,
                NotControl = true
            };
            PageLabel = new MirLabel
            {
                Text       = "1/1",
                Location   = new Point(234, 273),
                Parent     = this,
                AutoSize   = true,
                DrawFormat = TextFormatFlags.Default,
                Font       = new Font(Settings.FontName, 9f),
                ForeColour = Color.White,
                NotControl = true
            };
            CloseButton = new MirButton
            {
                Index        = 360,
                HoverIndex   = 361,
                PressedIndex = 362,
                Location     = new Point(464, 5),
                Library      = Libraries.Prguse2,
                Parent       = this,
                Sound        = SoundList.ButtonA
            };
            CloseButton.Click += (o, e) =>
            {
                Hide();
            };
            RefreshButton = new MirButton
            {
                Index        = 663,
                HoverIndex   = 664,
                PressedIndex = 665,
                Location     = new Point(335, 293),
                Library      = Libraries.Prguse,
                Parent       = this,
                Sound        = SoundList.ButtonA,
                Hint         = "Refresh"
            };
            RefreshButton.Click += (o, e) =>
            {
                bool flag = LastMsgTime > CMain.Time;
                if (!flag)
                {
                    LastMsgTime = CMain.Time + 500L;
                    Network.Enqueue(new RequestGuildHouseBoards());
                }
            };

            ReadButton = new MirButton
            {
                Index        = 560,
                HoverIndex   = 561,
                PressedIndex = 562,
                Location     = new Point(370, 293),
                Library      = Libraries.Prguse,
                Parent       = this,
                Sound        = SoundList.ButtonA,
                Hint         = "Read"
            };
            ReadButton.Click += (o, e) =>
            {
                bool flag = GuildBoardDialog.SelectBoard == null;
                if (!flag)
                {
                    bool flag2 = LastMsgTime > CMain.Time;
                    if (!flag2)
                    {
                        LastMsgTime = CMain.Time + 500L;
                        GameScene.Scene.GuildReadLetterDialog.ReadBoard(GuildBoardDialog.SelectBoard.Info);
                        GuildBoardDialog.SelectBoard = null;
                    }
                }
            };

            WriteButton = new MirButton
            {
                Index        = 554,
                HoverIndex   = 555,
                PressedIndex = 556,
                Location     = new Point(405, 293),
                Library      = Libraries.Prguse,
                Parent       = this,
                Sound        = SoundList.ButtonA,
                Hint         = "Write"
            };
            MirControl arg_375_0 = WriteButton;

            //EventHandler arg_375_1;
            //if ((arg_375_1 = GuildBoardDialog.<> c.<> 9__16_3) == null)
            //{
            //    arg_375_1 = (GuildBoardDialog.<> c.<> 9__16_3 = new EventHandler(GuildBoardDialog.<> c.<> 9.<.ctor > b__16_3));
            //}
            //arg_375_0.Click += arg_375_1;

            NoticeButton = new MirButton
            {
                Index        = 575,
                HoverIndex   = 576,
                PressedIndex = 577,
                Location     = new Point(440, 293),
                Library      = Libraries.Prguse,
                Parent       = this,
                Sound        = SoundList.ButtonA,
                Hint         = "Notice"
            };
            NoticeButton.Click += (o, e) =>
            {
                bool flag = GuildBoardDialog.SelectBoard == null;
                if (!flag)
                {
                    bool flag2 = LastMsgTime > CMain.Time;
                    if (!flag2)
                    {
                        LastMsgTime = CMain.Time + 500L;
                        GuildBoardDialog.SelectBoard.Info.Notice = !GuildBoardDialog.SelectBoard.Info.Notice;
                        Network.Enqueue(new SendGuildHouseBoard
                        {
                            Info = GuildBoardDialog.SelectBoard.Info,
                            Mode = 1
                        });
                        GuildBoardDialog.SelectBoard = null;
                    }
                }
            };

            LeftButton = new MirButton
            {
                Index        = 240,
                HoverIndex   = 241,
                PressedIndex = 242,
                Location     = new Point(185, 272),
                Library      = Libraries.Prguse2,
                Parent       = this,
                Sound        = SoundList.ButtonA
            };

            LeftButton.Click += (o, e) =>
            {
                bool flag = FindIndex <= 0;
                if (flag)
                {
                    FindIndex = GuildBoards.Count / ViewCount;
                }
                else
                {
                    FindIndex--;
                }
                RefreshBoardList();
            };

            RightButton = new MirButton
            {
                Index        = 243,
                HoverIndex   = 244,
                PressedIndex = 245,
                Location     = new Point(285, 272),
                Library      = Libraries.Prguse2,
                Parent       = this,
                Sound        = SoundList.ButtonA
            };
            RightButton.Click += (o, e) =>
            {
                bool flag = FindIndex >= GuildBoards.Count / ViewCount;
                if (flag)
                {
                    FindIndex = 0;
                }
                else
                {
                    FindIndex++;
                }
                RefreshBoardList();
            };
        }
Esempio n. 12
0
        public KeyboardLayoutDialog()
        {
            Index    = 119;
            Library  = Libraries.CustomTitle;
            Movable  = false;
            Sort     = true;
            Location = Center;

            TitleLabel = new MirImageControl
            {
                Index    = 3,
                Library  = Libraries.CustomTitle,
                Location = new Point(207, 11),
                Parent   = this
            };
            CharacterName = new MirLabel
            {
                Text       = "Hotkey settings for",
                Location   = new Point(130, 39),
                Parent     = this,
                AutoSize   = true,
                DrawFormat = (TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter),
                Font       = new Font(Settings.FontName, 13f),
                ForeColour = Color.White,
                NotControl = true
            };
            PressKeyText = new MirLabel
            {
                Text       = "Please enter the key to be assigned",
                Location   = new Point(25, 378),
                Parent     = this,
                AutoSize   = true,
                DrawFormat = TextFormatFlags.Default,
                Font       = new Font(Settings.FontName, 9f),
                ForeColour = Color.White,
                NotControl = true,
                Visible    = false
            };
            CloseButton = new MirButton
            {
                Parent       = this,
                Index        = 361,
                PressedIndex = 363,
                HoverIndex   = 362,
                Library      = Libraries.CustomPrguse,
                Location     = new Point(485, 6),
                Hint         = "Exit"
            };
            CloseButton.Click += (o, e) =>
            {
                Hide();
            };

            NoticeButton = new MirButton
            {
                HoverIndex   = 147,
                Index        = 146,
                Location     = new Point(35, 398),
                Library      = Libraries.CustomTitle,
                Parent       = this,
                PressedIndex = 148,
                Sound        = SoundList.ButtonA,
                Hint         = "Key Info"
            };
            NoticeButton.Click += (o, e) =>
            {
                bool flag = ActiveKey != null;
                if (!flag)
                {
                    MirMessageBox mirMessageBox = new MirMessageBox("The following keys can not be set with shortcut keys.\n[ Enter ] [ Tab ] [ Pause(break) ] [ Esc ]\nThe following keys can only be used in combination.\n[ Ctrl ] [ Alt ] [ Shift ]", MirMessageBoxButtons.OK);
                    mirMessageBox.Show();
                }
            };

            ResetButton = new MirButton
            {
                HoverIndex   = 628,
                Index        = 627,
                Location     = new Point(120, 398),
                Library      = Libraries.CustomTitle,
                Parent       = this,
                PressedIndex = 629,
                Sound        = SoundList.ButtonA,
                Hint         = "Reset Keys."
            };
            ResetButton.Click += (o, e) =>
            {
                bool flag = ActiveKey != null;
                if (!flag)
                {
                    CMain.InputKeys.ResetKey();
                    KeyBindObject[] keyBinds = KeyBinds;
                    for (int j = 0; j < keyBinds.Length; j++)
                    {
                        KeyBindObject keyBindObject = keyBinds[j];
                        keyBindObject.RefreshKey();
                    }
                }
            };

            SaveButton = new MirButton
            {
                HoverIndex   = 587,
                Index        = 586,
                Location     = new Point(430, 398),
                Library      = Libraries.CustomTitle,
                Parent       = this,
                PressedIndex = 588,
                Sound        = SoundList.ButtonA,
                Hint         = "Save Changes."
            };
            SaveButton.Click += (o, e) =>
            {
                SaveKey();
            };

            CancelButton = new MirButton
            {
                HoverIndex   = 204,
                Index        = 203,
                Location     = new Point(360, 398),
                Library      = Libraries.CustomTitle,
                Parent       = this,
                PressedIndex = 205,
                Sound        = SoundList.ButtonA,
                Hint         = "Cancel Changes."
            };
            CancelButton.Click += (o, e) =>
            {
                CancelKey();
            };

            CharacterCheckBox = new MirCheckBox
            {
                Index       = 1346,
                TickedIndex = 1347,
                LabelText   = "By character\nkey settings",
                Library     = Libraries.Prguse,
                Parent      = this,
                Location    = new Point(410, 40)
            };
            MirControl arg_448_0 = CharacterCheckBox;

            //EventHandler arg_448_1;
            //if ((arg_448_1 = KeyboardLayoutDialog.<> c.<> 9__20_5) == null)
            //{
            //   arg_448_1 = (KeyboardLayoutDialog.<> c.<> 9__20_5 = new EventHandler(KeyboardLayoutDialog.<> c.<> 9.<.ctor > b__20_5));
            //}
            //arg_448_0.Click += arg_448_1;

            KeyPanel = new MirImageControl
            {
                Parent   = this,
                Size     = new Size(500, 280),
                Location = new Point(13, 95),
                Visible  = true
            };
            KeyPanel.MouseWheel += new MouseEventHandler(KeyPanel_MouseWheel);

            UpButton = new MirButton
            {
                HoverIndex   = 198,
                Index        = 197,
                Visible      = true,
                Library      = Libraries.Prguse2,
                Location     = new Point(488, 92),
                Size         = new Size(16, 14),
                Parent       = this,
                PressedIndex = 199,
                Sound        = SoundList.ButtonA
            };
            UpButton.Click += (o, e) =>
            {
                bool flag = ScrollIndex == 0;
                if (!flag)
                {
                    ScrollIndex--;
                    UpdateKeyBinds();
                    UpdateScrollPosition();
                }
            };

            DownButton = new MirButton
            {
                HoverIndex   = 208,
                Index        = 207,
                Visible      = true,
                Library      = Libraries.Prguse2,
                Location     = new Point(488, 363),
                Size         = new Size(16, 14),
                Parent       = this,
                PressedIndex = 209,
                Sound        = SoundList.ButtonA
            };
            DownButton.Click += (o, e) =>
            {
                bool flag = ScrollIndex == ShowCount - PageRows;
                if (!flag)
                {
                    ScrollIndex++;
                    UpdateKeyBinds();
                    UpdateScrollPosition();
                }
            };

            PositionBar = new MirButton
            {
                Index    = 206,
                Library  = Libraries.Prguse2,
                Location = new Point(488, 108),
                Parent   = this,
                Movable  = true,
                Sound    = SoundList.None
            };
            PositionBar.OnMoving += new MouseEventHandler(PositionBar_OnMoving);

            InputKey = new MirTextBox
            {
                BackColour = Color.DarkGray,
                ForeColour = Color.Black,
                Parent     = this,
                Size       = new Size(1, 1),
                Location   = new Point(0, 0),
                MaxLength  = 80,
                Visible    = false,
                Font       = new Font(Settings.FontName, 10f)
            };
            InputKey.TextBox.KeyDown += new KeyEventHandler(InputKey_KeyDown);
            KeyBinds  = new KeyBindObject[CMain.InputKeys.Keylist.Count];
            ShowCount = KeyBinds.Length;
            for (int i = 0; i < CMain.InputKeys.Keylist.Count; i++)
            {
                KeyBinds[i] = new KeyBindObject
                {
                    Parent   = KeyPanel,
                    Location = new Point(0, i * 22),
                    Size     = new Size(500, 20),
                    Key      = CMain.InputKeys.Keylist[i]
                };
                KeyBinds[i].MouseWheel += new MouseEventHandler(KeyPanel_MouseWheel);
            }
        }
Esempio n. 13
0
        private static void CreateDebugLabel()
        {
            if (!Settings.DebugMode)
            {
                return;
            }

            if (DebugBaseLabel == null || DebugBaseLabel.IsDisposed)
            {
                DebugBaseLabel = new MirControl
                {
                    BackColour         = Color.FromArgb(50, 50, 50),
                    Border             = true,
                    BorderColour       = Color.Black,
                    DrawControlTexture = true,
                    Location           = new Point(5, 5),
                    NotControl         = true,
                    Opacity            = 0.5F
                };
            }

            if (DebugTextLabel == null || DebugTextLabel.IsDisposed)
            {
                DebugTextLabel = new MirLabel
                {
                    AutoSize   = true,
                    BackColour = Color.Transparent,
                    ForeColour = Color.White,
                    Parent     = DebugBaseLabel,
                };

                DebugTextLabel.SizeChanged += (o, e) => DebugBaseLabel.Size = DebugTextLabel.Size;
            }

            if (DebugOverride)
            {
                return;
            }

            string text;

            if (MirControl.MouseControl != null)
            {
                text = string.Format("FPS: {0}", FPS);

                if (MirControl.MouseControl is MapControl)
                {
                    text += string.Format(", Co Ords: {0}", MapControl.MapLocation);

                    //text += "\r\n";

                    //var cell = GameScene.Scene.MapControl.M2CellInfo[MapControl.MapLocation.X, MapControl.MapLocation.Y];

                    //if (cell != null)
                    //{
                    //    text += string.Format("BackImage : {0}. BackIndex : {1}. MiddleImage : {2}. MiddleIndex {3}. FrontImage : {4}. FrontIndex : {5}", cell.BackImage, cell.BackIndex, cell.MiddleImage, cell.MiddleIndex, cell.FrontImage, cell.FrontIndex);
                    //}
                }

                if (MirScene.ActiveScene is GameScene)
                {
                    //text += "\r\n";
                    text += string.Format(", Objects: {0}", MapControl.Objects.Count);
                }
                if (MirObjects.MapObject.MouseObject != null)
                {
                    text += string.Format(", Target: {0}", MirObjects.MapObject.MouseObject.Name);
                }
                else
                {
                    text += string.Format(", Target: none");
                }
            }
            else
            {
                text = string.Format("FPS: {0}", FPS);
            }


            DebugTextLabel.Text = text;
        }
Esempio n. 14
0
        internal static void CreateItemLabel(UserItem I, Point Location)
        {
            DisposeItemLabel();
            if (ItemLabel != null || I == null)
            {
                return;
            }

            ItemLabel = new MirControl
            {
                BackColor          = Color.FromArgb(255, 0, 24, 48),
                Border             = true,
                BorderColor        = Color.FromArgb(144, 148, 48),
                DrawControlTexture = true,
                NotControl         = true,
                Opacity            = 0.7F,
            };

            MirLabel NameLabel = new MirLabel
            {
                AutoSize  = true,
                ForeColor = Color.Yellow,
                Location  = new Point(5, ItemLabel.Size.Height + 3),
                OutLine   = false,
                Parent    = ItemLabel,
                Text      = I.Info.ItemName
            };

            ItemLabel.Size = NameLabel.Size;

            GeneralItemInfo(I);

            switch (I.Info.ItemType)
            {
            case MirItemType.Potion:
                PotionItemInfo(I);
                break;

            default:
                EquipmentItemInfo(I);
                break;
            }

            if (I.Info.RequiredClass != MirRequiredClass.None)
            {
                Color LabelColour = Color.White;
                switch (MapObject.User.Class)
                {
                case MirClass.Warrior:
                    if (!I.Info.RequiredClass.HasFlag(MirRequiredClass.Warrior))
                    {
                        LabelColour = Color.Red;
                    }
                    break;

                case MirClass.Wizard:
                    if (!I.Info.RequiredClass.HasFlag(MirRequiredClass.Wizard))
                    {
                        LabelColour = Color.Red;
                    }
                    break;

                case MirClass.Taoist:
                    if (!I.Info.RequiredClass.HasFlag(MirRequiredClass.Taoist))
                    {
                        LabelColour = Color.Red;
                    }
                    break;

                case MirClass.Assassin:
                    if (!I.Info.RequiredClass.HasFlag(MirRequiredClass.Assassin))
                    {
                        LabelColour = Color.Red;
                    }
                    break;
                }

                MirLabel ClassLabel = new MirLabel
                {
                    AutoSize  = true,
                    ForeColor = LabelColour,
                    Location  = new Point(5, ItemLabel.Size.Height + 3),
                    OutLine   = false,
                    Parent    = ItemLabel,
                    Text      = string.Format("Class Required: {0}", I.Info.RequiredClass),
                };
                if (I.Info.RequiredClass == MirRequiredClass.WarWizTao)
                {
                    ClassLabel.Text = string.Format("Class Required: {0}, {1}, {2}", MirRequiredClass.Warrior, MirRequiredClass.Wizard, MirRequiredClass.Taoist);
                }

                ItemLabel.Size = new Size(ClassLabel.Size.Width > ItemLabel.Size.Width ? ClassLabel.Size.Width : ItemLabel.Size.Width, ItemLabel.Size.Height + ClassLabel.Size.Height);
            }

            if (I.Info.RequiredAmount > 0)
            {
                string Text;
                Color  Colour = Color.White;
                switch (I.Info.RequiredType)
                {
                case MirRequiredType.Level:
                    Text = string.Format("Level Required: {0}", I.Info.RequiredAmount);
                    if (MapObject.User.Level < I.Info.RequiredAmount)
                    {
                        Colour = Color.Red;
                    }
                    break;

                case MirRequiredType.AC:
                    Text = string.Format("Level AC: {0}", I.Info.RequiredAmount);
                    if (MapObject.User.MaxAC < I.Info.RequiredAmount)
                    {
                        Colour = Color.Red;
                    }
                    break;

                case MirRequiredType.MAC:
                    Text = string.Format("Level MAC: {0}", I.Info.RequiredAmount);
                    if (MapObject.User.MaxMAC < I.Info.RequiredAmount)
                    {
                        Colour = Color.Red;
                    }
                    break;

                case MirRequiredType.DC:
                    Text = string.Format("Level DC: {0}", I.Info.RequiredAmount);
                    if (MapObject.User.MaxDC < I.Info.RequiredAmount)
                    {
                        Colour = Color.Red;
                    }
                    break;

                case MirRequiredType.MC:
                    Text = string.Format("Level MC: {0}", I.Info.RequiredAmount);
                    if (MapObject.User.MaxMC < I.Info.RequiredAmount)
                    {
                        Colour = Color.Red;
                    }
                    break;

                case MirRequiredType.SC:
                    Text = string.Format("Level SC: {0}", I.Info.RequiredAmount);
                    if (MapObject.User.MaxSC < I.Info.RequiredAmount)
                    {
                        Colour = Color.Red;
                    }
                    break;

                default:
                    Text = "Unknown Type Required";
                    break;
                }
                MirLabel LevelLabel = new MirLabel
                {
                    AutoSize  = true,
                    ForeColor = Colour,
                    Location  = new Point(5, ItemLabel.Size.Height + 3),
                    OutLine   = false,
                    Parent    = ItemLabel,
                    Text      = Text,
                };


                ItemLabel.Size = new Size(LevelLabel.Size.Width > ItemLabel.Size.Width ? LevelLabel.Size.Width : ItemLabel.Size.Width, ItemLabel.Size.Height + LevelLabel.Size.Height);
            }
            ItemLabel.Size = new Size(ItemLabel.Size.Width + 10, ItemLabel.Size.Height + 3);

            int X = Location.X, Y = Location.Y;

            if (Location.X + ItemLabel.Size.Width > Settings.ScreenSize.Width)
            {
                X = Settings.ScreenSize.Width - ItemLabel.Size.Width;
            }

            if (Location.Y + ItemLabel.Size.Height > Settings.ScreenSize.Height)
            {
                Y = Settings.ScreenSize.Height - ItemLabel.Size.Height;
            }
            ItemLabel.Location = new Point(X, Y);
        }
Esempio n. 15
0
        private static void CreateDebugLabel()
        {
            string text;

            if (MirControl.MouseControl != null)
            {
                text = string.Format("FPS: {0}", FPS);

                if (MirControl.MouseControl is MapControl)
                {
                    text += string.Format(", Co Ords: {0}", MapControl.MapLocation);
                }

                if (MirScene.ActiveScene is GameScene)
                {
                    text += string.Format(", Objects: {0}", MapControl.Objects.Count);
                }

                if (MirScene.ActiveScene is GameScene && !string.IsNullOrEmpty(DebugText))
                {
                    text += string.Format(", Debug: {0}", DebugText);
                }

                if (MirObjects.MapObject.MouseObject != null)
                {
                    text += string.Format(", Target: {0}", MirObjects.MapObject.MouseObject.Name);
                }
                else
                {
                    text += string.Format(", Target: none");
                }
            }
            else
            {
                text = string.Format("FPS: {0}", FPS);
            }

            text += string.Format(", Ping: {0}", PingTime);

            text += string.Format(", Sent: {0}, Received: {1}", Functions.ConvertByteSize(BytesSent), Functions.ConvertByteSize(BytesReceived));

            if (Settings.FullScreen)
            {
                if (DebugBaseLabel == null || DebugBaseLabel.IsDisposed)
                {
                    DebugBaseLabel = new MirControl
                    {
                        BackColour         = Color.FromArgb(50, 50, 50),
                        Border             = true,
                        BorderColour       = Color.Black,
                        DrawControlTexture = true,
                        Location           = new Point(5, 5),
                        NotControl         = true,
                        Opacity            = 0.5F
                    };
                }

                if (DebugTextLabel == null || DebugTextLabel.IsDisposed)
                {
                    DebugTextLabel = new MirLabel
                    {
                        AutoSize   = true,
                        BackColour = Color.Transparent,
                        ForeColour = Color.White,
                        Parent     = DebugBaseLabel,
                    };

                    DebugTextLabel.SizeChanged += (o, e) => DebugBaseLabel.Size = DebugTextLabel.Size;
                }

                DebugTextLabel.Text = text;
            }
            else
            {
                if (DebugBaseLabel != null && DebugBaseLabel.IsDisposed == false)
                {
                    DebugBaseLabel.Dispose();
                    DebugBaseLabel = null;
                }
                if (DebugTextLabel != null && DebugTextLabel.IsDisposed == false)
                {
                    DebugTextLabel.Dispose();
                    DebugTextLabel = null;
                }

                Program.Form.Text = $"{GameLanguage.GameName} - {text}";
            }
        }
Esempio n. 16
0
        public FishingStatusDialog()
        {
            Index       = 1341;
            Library     = Libraries.Prguse;
            Movable     = true;
            Sort        = true;
            Size        = new Size(244, 128);
            Location    = new Point((Settings.ScreenWidth - Size.Width) / 2, 300);
            BeforeDraw += FishingStatusDialog_BeforeDraw;

            ChanceBar = new MirControl
            {
                Parent     = this,
                Location   = new Point(14, 64),
                NotControl = true,
            };
            ChanceBar.BeforeDraw += ChanceBar_BeforeDraw;

            ChanceLabel = new MirLabel
            {
                Location   = new Point(14, 62),
                Size       = new Size(216, 12),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
                Parent     = this,
                NotControl = true,
            };

            ProgressBar = new MirControl
            {
                Parent     = this,
                Location   = new Point(14, 79),
                NotControl = true,
            };
            ProgressBar.BeforeDraw += ProgressBar_BeforeDraw;

            CloseButton = new MirButton
            {
                HoverIndex   = 361,
                Index        = 360,
                Location     = new Point(216, 4),
                Library      = Libraries.Prguse2,
                Parent       = this,
                PressedIndex = 362,
                Sound        = SoundList.ButtonA,
            };
            CloseButton.Click += (o, e) =>
            {
                Cancel();
            };

            FishDisableButton = new MirImageControl
            {
                Index      = 149,
                Location   = new Point(47, 95),
                Library    = Libraries.Title,
                Parent     = this,
                NotControl = true
            };

            FishButton = new MirAnimatedButton()
            {
                Animated       = true,
                AnimationCount = 10,
                Loop           = true,
                AnimationDelay = 130,
                Index          = 170,
                PressedIndex   = 142,
                Library        = Libraries.Title,
                Parent         = this,
                Location       = new Point(47, 95),
                Sound          = SoundList.ButtonA,
                Visible        = false
            };
            FishButton.Click += (o, e) =>
            {
                Network.Enqueue(new C.FishingCast {
                    CastOut = false
                });
            };

            AutoCastButton = new MirButton
            {
                Index        = 180,
                HoverIndex   = 181,
                PressedIndex = 182,
                Location     = new Point(110, 95),
                Library      = Libraries.Title,
                Parent       = this,
                Sound        = SoundList.ButtonA,
            };
            AutoCastButton.Click += (o, e) =>
            {
                if (_canAutoCast)
                {
                    _autoCast = !_autoCast;

                    //AutoCastTick.Visible = _autoCast;
                    AutoCastBox.Index = _autoCast ? 1344 : 1343;

                    Network.Enqueue(new C.FishingChangeAutocast {
                        AutoCast = _autoCast
                    });
                }
            };

            AutoCastBox = new MirImageControl
            {
                Index    = 1343,
                Location = new Point(172, 95),
                Library  = Libraries.Prguse,
                Parent   = this
            };

            ESCExitButton = new MirButton
            {
                Index        = 1346,
                HoverIndex   = 1346,
                PressedIndex = 1346,
                Location     = new Point(135, 41),
                Library      = Libraries.Prguse,
                Parent       = this,
                Sound        = SoundList.ButtonA,
            };
            ESCExitButton.Click += (o, e) =>
            {
                bEscExit        = !bEscExit;
                ESCTick.Visible = bEscExit;
            };

            ESCTick = new MirImageControl
            {
                Index      = 1347,
                Location   = new Point(135, 41),
                Library    = Libraries.Prguse,
                Parent     = this,
                Visible    = false,
                NotControl = true,
            };

            ESCExit = new MirImageControl
            {
                Index      = 45,
                Location   = new Point(150, 40),
                Library    = Libraries.Title,
                Parent     = this,
                NotControl = true,
            };
        }
Esempio n. 17
0
        public MainDialog()
        {
            Index       = Settings.Resolution == 800 ? 0 : Settings.Resolution == 1024 ? 1 : 2;
            Library     = Libraries.Prguse;
            Location    = new Point(((Settings.ScreenWidth / 2) - (Size.Width / 2)), Settings.ScreenHeight - Size.Height);
            PixelDetect = true;

            PingLabel = new MirLabel
            {
                AutoSize      = true,
                ForeColour    = Color.Yellow,
                OutLineColour = Color.Black,
                Parent        = this,
                Location      = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -443 : -265),
                Visible       = false
            };

            LeftCap = new MirImageControl
            {
                Index    = 12,
                Library  = Libraries.Prguse,
                Location = new Point(-67, this.Size.Height - 96),
                Parent   = this,
                Visible  = false
            };
            RightCap = new MirImageControl
            {
                Index    = 13,
                Library  = Libraries.Prguse,
                Location = new Point(1024, this.Size.Height - 104),
                Parent   = this,
                Visible  = false
            };

            if (Settings.Resolution > 1024)
            {
                LeftCap.Visible  = true;
                RightCap.Visible = true;
            }

            InventoryButton = new MirButton
            {
                HoverIndex   = 1904,
                Index        = 1903,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 96, 76),
                Parent       = this,
                PressedIndex = 1905,
                Sound        = SoundList.ButtonA,
                Hint         = "Inventory (" + CMain.InputKeys.GetKey(KeybindOptions.Inventory) + ")"
            };
            InventoryButton.Click += (o, e) =>
            {
                if (GameScene.Scene.InventoryDialog.Visible)
                {
                    GameScene.Scene.InventoryDialog.Hide();
                }
                else
                {
                    GameScene.Scene.InventoryDialog.Show();
                }
            };

            CharacterButton = new MirButton
            {
                HoverIndex   = 1901,
                Index        = 1900,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 119, 76),
                Parent       = this,
                PressedIndex = 1902,
                Sound        = SoundList.ButtonA,
                Hint         = "Character (" + CMain.InputKeys.GetKey(KeybindOptions.Equipment) + ")"
            };
            CharacterButton.Click += (o, e) =>
            {
                if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.CharacterPage.Visible)
                {
                    GameScene.Scene.CharacterDialog.Hide();
                }
                else
                {
                    GameScene.Scene.CharacterDialog.Show();
                    GameScene.Scene.CharacterDialog.ShowCharacterPage();
                }
            };

            SkillButton = new MirButton
            {
                HoverIndex   = 1907,
                Index        = 1906,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 73, 76),
                Parent       = this,
                PressedIndex = 1908,
                Sound        = SoundList.ButtonA,
                Hint         = "Skills (" + CMain.InputKeys.GetKey(KeybindOptions.Skills) + ")"
            };
            SkillButton.Click += (o, e) =>
            {
                if (GameScene.Scene.CharacterDialog.Visible && GameScene.Scene.CharacterDialog.SkillPage.Visible)
                {
                    GameScene.Scene.CharacterDialog.Hide();
                }
                else
                {
                    GameScene.Scene.CharacterDialog.Show();
                    GameScene.Scene.CharacterDialog.ShowSkillPage();
                }
            };

            QuestButton = new MirButton
            {
                HoverIndex   = 1910,
                Index        = 1909,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 50, 76),
                Parent       = this,
                PressedIndex = 1911,
                Sound        = SoundList.ButtonA,
                Hint         = "Quests (" + CMain.InputKeys.GetKey(KeybindOptions.Quests) + ")"
            };
            QuestButton.Click += (o, e) =>
            {
                if (!GameScene.Scene.QuestLogDialog.Visible)
                {
                    GameScene.Scene.QuestLogDialog.Show();
                }
                else
                {
                    GameScene.Scene.QuestLogDialog.Hide();
                }
            };

            OptionButton = new MirButton
            {
                HoverIndex   = 1913,
                Index        = 1912,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 27, 76),
                Parent       = this,
                PressedIndex = 1914,
                Sound        = SoundList.ButtonA,
                Hint         = "Options (" + CMain.InputKeys.GetKey(KeybindOptions.Options) + ")"
            };
            OptionButton.Click += (o, e) =>
            {
                if (!GameScene.Scene.OptionDialog.Visible)
                {
                    GameScene.Scene.OptionDialog.Show();
                }
                else
                {
                    GameScene.Scene.OptionDialog.Hide();
                }
            };

            MenuButton = new MirButton
            {
                HoverIndex   = 1961,
                Index        = 1960,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 55, 35),
                Parent       = this,
                PressedIndex = 1962,
                Sound        = SoundList.ButtonC,
                Hint         = "Menu"
            };
            MenuButton.Click += (o, e) =>
            {
                if (!GameScene.Scene.MenuDialog.Visible)
                {
                    GameScene.Scene.MenuDialog.Show();
                }
                else
                {
                    GameScene.Scene.MenuDialog.Hide();
                }
            };

            GameShopButton = new MirButton
            {
                HoverIndex   = 827,
                Index        = 826,
                Library      = Libraries.Prguse,
                Location     = new Point(this.Size.Width - 105, 35),
                Parent       = this,
                PressedIndex = 828,
                Sound        = SoundList.ButtonC,
                Hint         = "Game Shop (" + CMain.InputKeys.GetKey(KeybindOptions.GameShop) + ")"
            };
            GameShopButton.Click += (o, e) =>
            {
                if (!GameScene.Scene.GameShopDialog.Visible)
                {
                    GameScene.Scene.GameShopDialog.Show();
                }
                else
                {
                    GameScene.Scene.GameShopDialog.Hide();
                }
            };

            HealthOrb = new MirControl
            {
                Parent     = this,
                Location   = new Point(0, 30),
                NotControl = true,
            };

            HealthOrb.BeforeDraw += HealthOrb_BeforeDraw;

            HealthLabel = new MirLabel
            {
                AutoSize = true,
                Location = new Point(0, 27),
                Parent   = HealthOrb
            };
            HealthLabel.SizeChanged += Label_SizeChanged;

            ManaLabel = new MirLabel
            {
                AutoSize = true,
                Location = new Point(0, 42),
                Parent   = HealthOrb
            };
            ManaLabel.SizeChanged += Label_SizeChanged;

            TopLabel = new MirLabel
            {
                Size       = new Size(85, 30),
                DrawFormat = TextFormatFlags.HorizontalCenter,
                Location   = new Point(9, 20),
                Parent     = HealthOrb,
            };

            BottomLabel = new MirLabel
            {
                Size       = new Size(85, 30),
                DrawFormat = TextFormatFlags.HorizontalCenter,
                Location   = new Point(9, 50),
                Parent     = HealthOrb,
            };

            LevelLabel = new MirLabel
            {
                AutoSize = true,
                Parent   = this,
                Location = new Point(5, 108)
            };

            CharacterName = new MirLabel
            {
                DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
                Parent     = this,
                Location   = new Point(6, 120),
                Size       = new Size(90, 16)
            };


            ExperienceBar = new MirImageControl
            {
                Index      = Settings.Resolution != 800 ? 8 : 7,
                Library    = Libraries.Prguse,
                Location   = new Point(9, 143),
                Parent     = this,
                DrawImage  = false,
                NotControl = true,
            };
            ExperienceBar.BeforeDraw += ExperienceBar_BeforeDraw;

            ExperienceLabel = new MirLabel
            {
                AutoSize   = true,
                Parent     = ExperienceBar,
                NotControl = true,
            };

            GoldLabel = new MirLabel
            {
                DrawFormat = TextFormatFlags.VerticalCenter,
                Font       = new Font(Settings.FontName, 8F),
                Location   = new Point(this.Size.Width - 105, 119),
                Parent     = this,
                Size       = new Size(99, 13),
                Sound      = SoundList.Gold,
            };
            GoldLabel.Click += (o, e) =>
            {
                if (GameScene.SelectedCell == null)
                {
                    GameScene.PickedUpGold = !GameScene.PickedUpGold && GameScene.Gold > 0;
                }
            };



            WeightBar = new MirImageControl
            {
                Index      = 76,
                Library    = Libraries.Prguse,
                Location   = new Point(this.Size.Width - 105, 103),
                Parent     = this,
                DrawImage  = false,
                NotControl = true,
            };
            WeightBar.BeforeDraw += WeightBar_BeforeDraw;

            WeightLabel = new MirLabel
            {
                Parent   = this,
                Location = new Point(this.Size.Width - 105, 101),
                Size     = new Size(40, 14),
            };

            SpaceLabel = new MirLabel
            {
                Parent   = this,
                Location = new Point(this.Size.Width - 30, 101),
                Size     = new Size(26, 14),
            };


            AModeLabel = new MirLabel
            {
                AutoSize      = true,
                ForeColour    = Color.Yellow,
                OutLineColour = Color.Black,
                Parent        = this,
                Location      = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -448 : -280),
            };

            PModeLabel = new MirLabel
            {
                AutoSize      = true,
                ForeColour    = Color.Orange,
                OutLineColour = Color.Black,
                Parent        = this,
                Location      = new Point(230, 125),
                Visible       = false
            };

            SModeLabel = new MirLabel
            {
                AutoSize      = true,
                ForeColour    = Color.LimeGreen,
                OutLineColour = Color.Black,
                Parent        = this,
                Location      = new Point(Settings.Resolution != 800 ? 899 : 675, Settings.Resolution != 800 ? -463 : -295),
            };
        }
Esempio n. 18
0
        private static void CreateHintLabel()
        {
            if (HintBaseLabel == null || HintBaseLabel.IsDisposed)
            {
                HintBaseLabel = new MirControl
                {
                    BackColour         = Color.FromArgb(128, 128, 50),
                    Border             = true,
                    DrawControlTexture = true,
                    BorderColour       = Color.Yellow,
                    ForeColour         = Color.Yellow,
                    Parent             = MirScene.ActiveScene,
                    NotControl         = true,
                    Opacity            = 0.5F
                };
            }


            if (HintTextLabel == null || HintTextLabel.IsDisposed)
            {
                HintTextLabel = new MirLabel
                {
                    AutoSize   = true,
                    BackColour = Color.Transparent,
                    ForeColour = Color.White,
                    Parent     = HintBaseLabel,
                };

                HintTextLabel.SizeChanged += (o, e) => HintBaseLabel.Size = HintTextLabel.Size;
            }

            if (MirControl.MouseControl == null || string.IsNullOrEmpty(MirControl.MouseControl.Hint))
            {
                HintBaseLabel.Visible = false;
                return;
            }

            HintBaseLabel.Visible = true;

            HintTextLabel.Text = MirControl.MouseControl.Hint;

            Point point = MPoint.Add(-HintTextLabel.Size.Width, 20);

            if (point.X + HintBaseLabel.Size.Width >= Settings.ScreenWidth)
            {
                point.X = Settings.ScreenWidth - HintBaseLabel.Size.Width - 1;
            }
            if (point.Y + HintBaseLabel.Size.Height >= Settings.ScreenHeight)
            {
                point.Y = Settings.ScreenHeight - HintBaseLabel.Size.Height - 1;
            }

            if (point.X < 0)
            {
                point.X = 0;
            }
            if (point.Y < 0)
            {
                point.Y = 0;
            }

            HintBaseLabel.Location = point;
        }
Esempio n. 19
0
        public GroupInfoDialog()
        {
            Size     = new Size(160, 600);
            Location = new Point(GameScene.Scene.Size.Width - Size.Width,
                                 GameScene.Scene.MiniMapDialog.Location.Y + GameScene.Scene.MiniMapDialog.Size.Height);

            Avatar      = new MirImageControl[15];
            Back_ground = new MirImageControl[15];
            Gender      = new MirImageControl[15];
            ImageClass  = new MirImageControl[15];
            Poisons     = new MirImageControl[15];
            Name        = new MirLabel[15];
            Health      = new MirControl[15];
            ImageLeader = new MirButton[15];

            for (int i = 0; i < 15; i++)
            {
                Back_ground[i] = new MirImageControl
                {
                    Library    = Libraries.EdensEliteInter,
                    Parent     = this,
                    Visible    = false,
                    Location   = new Point(0, 0),
                    Index      = 12,
                    NotControl = true
                };
                Avatar[i] = new MirImageControl
                {
                    Library    = Libraries.EdensEliteInter,
                    Parent     = Back_ground[i],
                    Visible    = false,
                    Index      = 1,
                    NotControl = true
                };
                Gender[i] = new MirImageControl
                {
                    Library    = Libraries.EdensEliteInter,
                    Parent     = Back_ground[i],
                    Visible    = false,
                    Index      = 1,
                    NotControl = true
                };
                Health[i] = new MirControl
                {
                    BackColour         = Color.FromArgb(160, 0, 0),
                    DrawControlTexture = true,
                    Visible            = false,
                    Parent             = Back_ground[i],
                    NotControl         = true
                };
                ImageClass[i] = new MirImageControl
                {
                    Library    = Libraries.EdensEliteInter,
                    Parent     = Back_ground[i],
                    Visible    = false,
                    Index      = 1,
                    NotControl = true
                };
                ImageLeader[i] = new MirButton
                {
                    HoverIndex   = 141,
                    PressedIndex = 141,
                    Library      = Libraries.EdensEliteInter,
                    Parent       = Back_ground[i],
                    Visible      = false,
                    Index        = 147,
                    NotControl   = true
                };
                Name[i] = new MirLabel
                {
                    DrawFormat = (TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter),
                    AutoSize   = true,
                    Parent     = Back_ground[i],
                    Visible    = false,
                    NotControl = true
                };
            }
        }