Ejemplo n.º 1
0
        public QuestTrackerDialog()
        {
            HasTitle            = false;
            HasFooter           = false;
            HasTopBorder        = false;
            TitleLabel.Visible  = false;
            CloseButton.Visible = false;
            Opacity             = 0.0F;
            AllowResize         = true;

            ScrollBar = new DXVScrollBar
            {
                Parent = this,
                Change = 15,
            };
            ScrollBar.ValueChanged += (o, e) => UpdateScrollBar();

            TextPanel = new DXControl
            {
                Parent      = this,
                PassThrough = true,
                Location    = new Point(ResizeBuffer, ResizeBuffer),
                Size        = new Size(Size.Width - ScrollBar.Size.Width - 1 - ResizeBuffer * 2, Size.Height - ResizeBuffer * 2),
            };

            Size        = new Size(250, 100);
            MouseWheel += ScrollBar.DoMouseWheel;
        }
Ejemplo n.º 2
0
        public ChatTab()
        {
            Opacity         = 0.5F;
            DrawOtherBorder = true;

            ScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Size        = new Size(14, Size.Height),
                VisibleSize = Size.Height
            };
            ScrollBar.Location      = new Point(Size.Width - ScrollBar.Size.Width - ResizeBuffer, 0);
            ScrollBar.ValueChanged += (o, e) => UpdateItems();

            TextPanel = new DXControl
            {
                Parent      = this,
                PassThrough = true,
                Location    = new Point(ResizeBuffer, ResizeBuffer),
                Size        = new Size(Size.Width - ScrollBar.Size.Width - 1 - ResizeBuffer * 2, Size.Height - ResizeBuffer * 2),
            };

            AlertIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 240,
                Parent      = TabButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };

            MouseWheel += ScrollBar.DoMouseWheel;
            Tabs.Add(this);
        }
Ejemplo n.º 3
0
        public MiniMapDialog()
        {
            BackColour = Color.Black;
            HasFooter  = false;

            AllowResize         = true;
            CloseButton.Visible = false;

            Size = new Size(200, 200);

            Panel = new DXControl
            {
                Parent   = this,
                Location = Area.Location,
                Size     = Area.Size
            };

            Image = new DXImageControl
            {
                Parent           = Panel,
                LibraryFile      = LibraryFile.MiniMap,
                Movable          = true,
                IgnoreMoveBounds = true,
            };
            GameScene.Game.MapControl.MapInfoChanged += MapControl_MapInfoChanged;
            Image.Moving += Image_Moving;
        }
Ejemplo n.º 4
0
        public override void OnParentChanged(DXControl oValue, DXControl nValue)
        {
            base.OnParentChanged(oValue, nValue);

            KeyBindWindow.Parent    = nValue;
            DropFilterWindow.Parent = nValue;
        }
Ejemplo n.º 5
0
        public override void OnParentChanged(DXControl oValue, DXControl nValue)
        {
            base.OnParentChanged(oValue, nValue);

            if (Parent == null)
            {
                return;
            }

            Location = new Point((Parent.DisplayArea.Width - DisplayArea.Width) / 2, (Parent.DisplayArea.Height - DisplayArea.Height) / 2);
        }
Ejemplo n.º 6
0
        public override void OnParentChanged(DXControl oValue, DXControl nValue)
        {
            base.OnParentChanged(oValue, nValue);

            if (GameScene.Game.MainPanel == null)
            {
                return;
            }

            Location = new Point(GameScene.Game.MainPanel.Location.X, (GameScene.Game.MainPanel.DisplayArea.Top - Size.Height));
        }
Ejemplo n.º 7
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                _SelectedInfo       = null;
                SelectedInfoChanged = null;

                Area   = Rectangle.Empty;
                ScaleX = 0;
                ScaleY = 0;

                foreach (KeyValuePair <object, DXControl> pair in MapInfoObjects)
                {
                    if (pair.Value == null)
                    {
                        continue;
                    }
                    if (pair.Value.IsDisposed)
                    {
                        continue;
                    }

                    pair.Value.Dispose();
                }

                MapInfoObjects.Clear();
                MapInfoObjects = null;


                if (Image != null)
                {
                    if (!Image.IsDisposed)
                    {
                        Image.Dispose();
                    }

                    Image = null;
                }

                if (Panel != null)
                {
                    if (!Panel.IsDisposed)
                    {
                        Panel.Dispose();
                    }

                    Panel = null;
                }
            }
        }
Ejemplo n.º 8
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (Lines != null)
                {
                    for (int i = 0; i < Lines.Count; i++)
                    {
                        if (Lines[i] != null)
                        {
                            if (!Lines[i].IsDisposed)
                            {
                                Lines[i].Dispose();
                            }

                            Lines[i] = null;
                        }
                    }
                    Lines.Clear();
                    Lines = null;
                }

                if (ScrollBar != null)
                {
                    if (!ScrollBar.IsDisposed)
                    {
                        ScrollBar.Dispose();
                    }

                    ScrollBar = null;
                }

                if (TextPanel != null)
                {
                    if (!TextPanel.IsDisposed)
                    {
                        TextPanel.Dispose();
                    }

                    TextPanel = null;
                }
            }
        }
Ejemplo n.º 9
0
        public AutoPotionDialog()
        {
            TitleLabel.Text = "Auto Potion";
            HasFooter       = true;

            SetClientSize(new Size(280, 398));

            Links = new ClientAutoPotionLink[Globals.MaxAutoPotionCount];
            Rows  = new AutoPotionRow[Globals.MaxAutoPotionCount];


            ScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Size        = new Size(14, ClientArea.Height - 2),
                Location    = new Point(ClientArea.Right - 14, ClientArea.Top + 1),
                VisibleSize = ClientArea.Height,
                MaxValue    = Rows.Length * 50 - 2
            };
            DXControl panel = new DXControl
            {
                Parent   = this,
                Size     = new Size(ClientArea.Size.Width - 16, ClientArea.Size.Height),
                Location = ClientArea.Location,
            };

            panel.MouseWheel += ScrollBar.DoMouseWheel;

            for (int i = 0; i < Links.Length; i++)
            {
                AutoPotionRow row;
                Rows[i] = row = new AutoPotionRow
                {
                    Parent   = panel,
                    Location = new Point(1, 1 + 50 * i),
                    Index    = i,
                };
                row.MouseWheel += ScrollBar.DoMouseWheel;
            }
            ScrollBar.ValueChanged += (o, e) => UpdateLocations();
        }
Ejemplo n.º 10
0
        public BigMapDialog()
        {
            BackColour = Color.Black;
            HasFooter  = false;

            AllowResize = true;

            Panel = new DXControl
            {
                Parent   = this,
                Location = Area.Location,
                Size     = Area.Size
            };

            Image = new DXImageControl
            {
                Parent      = Panel,
                LibraryFile = LibraryFile.MiniMap,
            };
            Image.MouseClick += Image_MouseClick;
        }
Ejemplo n.º 11
0
        public CompanionDialog()
        {
            TitleLabel.Text = "宠物";
            SetClientSize(new Size(355, 590));

            // feature 拾取过滤 物品显示过滤
            HasTitle            = true;
            CompanionTabControl = new DXTabControl
            {
                Parent   = this,
                Location = ClientArea.Location,
                Size     = ClientArea.Size,
            };

            CompanionBagTab = new DXTab
            {
                Parent    = CompanionTabControl,
                Border    = true,
                TabButton = { Label = { Text = "宠物背包" } },
            };
            PickUpFilterTab = new DXTab
            {
                Parent    = CompanionTabControl,
                Border    = true,
                TabButton = { Label = { Text = "拾取过滤" } },
            };
            ItemNameFilterTab = new DXTab
            {
                Parent    = CompanionTabControl,
                Border    = true,
                TabButton = { Label = { Text = "显示过滤" } },
            };

            CompanionTabControl.SelectedTab = CompanionBagTab;

            DXControl filterPanel = new DXControl
            {
                Parent       = PickUpFilterTab,
                Size         = new Size(PickUpFilterTab.Size.Width, 26),
                Location     = new Point(0, 0),
                Border       = true,
                BorderColour = Color.FromArgb(198, 166, 99)
            };

            DXLabel PickUpFilterItemNameLabel = new DXLabel
            {
                Parent   = filterPanel,
                Location = new Point(5, 5),
                Text     = "名字:",
            };

            PickUpFilterItemNameBox = new DXTextBox
            {
                Parent   = filterPanel,
                Size     = new Size(90, 20),
                Location = new Point(PickUpFilterItemNameLabel.Location.X + PickUpFilterItemNameLabel.Size.Width + 5, PickUpFilterItemNameLabel.Location.Y),
            };
            PickUpFilterItemNameBox.TextBox.KeyPress += TextBox_KeyPress;



            PickUpFilterItemTypelabel = new DXLabel
            {
                Parent   = filterPanel,
                Location = new Point(PickUpFilterItemNameBox.Location.X + PickUpFilterItemNameBox.Size.Width + 10, 5),
                Text     = "物品:",
            };



            PickUpFilterItemTypeBox = new DXComboBox
            {
                Parent         = filterPanel,
                Location       = new Point(PickUpFilterItemTypelabel.Location.X + PickUpFilterItemTypelabel.Size.Width + 5, PickUpFilterItemTypelabel.Location.Y),
                Size           = new Size(72, DXComboBox.DefaultNormalHeight),
                DropDownHeight = 198
            };


            new DXListBoxItem
            {
                Parent = PickUpFilterItemTypeBox.ListBox,
                Label  = { Text = "所有" },
                Item   = null
            };

            Type itemType = typeof(ItemType);

            for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++)
            {
                MemberInfo[] infos = itemType.GetMember(i.ToString());

                DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>();

                new DXListBoxItem
                {
                    Parent = PickUpFilterItemTypeBox.ListBox,
                    Label  = { Text = description?.Description ?? i.ToString() },
                    Item   = i
                };
            }

            PickUpFilterItemTypeBox.ListBox.SelectItem(null);

            PickUpFilterSearchButton = new DXButton
            {
                Size       = new Size(80, SmallButtonHeight),
                Location   = new Point(PickUpFilterItemTypeBox.Location.X + PickUpFilterItemTypeBox.Size.Width + 15, PickUpFilterItemTypelabel.Location.Y - 1),
                Parent     = filterPanel,
                ButtonType = ButtonType.SmallButton,
                Label      = { Text = "搜索" }
            };
            PickUpFilterSearchButton.MouseClick += (o, e) => Search();

            PickUpFilterRow = new PickUpFilterRow[9];

            PickupFilterSearchScrollBar = new DXVScrollBar
            {
                Parent      = PickUpFilterTab,
                Location    = new Point(PickUpFilterTab.Size.Width - 14, filterPanel.Size.Height + 5),
                Size        = new Size(14, PickUpFilterTab.Size.Height - 5 - filterPanel.Size.Height),
                VisibleSize = PickUpFilterRow.Length,
                Change      = 3,
            };
            PickupFilterSearchScrollBar.ValueChanged += SearchScrollBar_ValueChanged;


            for (int i = 0; i < PickUpFilterRow.Length; i++)
            {
                int index = i;
                PickUpFilterRow[index] = new PickUpFilterRow
                {
                    Parent   = PickUpFilterTab,
                    Location = new Point(0, filterPanel.Size.Height + 5 + i * 58),
                };
                //   SearchRows[index].MouseClick += (o, e) => { SelectedRow = SearchRows[index]; };
                PickUpFilterRow[index].MouseWheel += PickupFilterSearchScrollBar.DoMouseWheel;
            }

            // feature end

            //CompanionDisplayPoint = new Point(ClientArea.X + 60, ClientArea.Y + 50);
            CompanionDisplayPoint = new Point(60, 120);

            InventoryGrid = new DXItemGrid
            {
                GridSize = new Size(10, 10),
                Parent   = CompanionBagTab,
                GridType = GridType.CompanionInventory,
                Location = new Point(0, 200),
            };

            EquipmentGrid = new DXItemCell[Globals.CompanionEquipmentSize];
            DXItemCell cell;

            EquipmentGrid[(int)CompanionSlot.Bag] = cell = new DXItemCell
            {
                Location    = new Point(196, 5),
                Parent      = CompanionBagTab,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Bag,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 99);

            EquipmentGrid[(int)CompanionSlot.Head] = cell = new DXItemCell
            {
                Location    = new Point(236, 5),
                Parent      = CompanionBagTab,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Head,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 100);

            EquipmentGrid[(int)CompanionSlot.Back] = cell = new DXItemCell
            {
                Location    = new Point(276, 5),
                Parent      = CompanionBagTab,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Back,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 101);

            EquipmentGrid[(int)CompanionSlot.Food] = cell = new DXItemCell
            {
                Location    = new Point(316, 5),
                Parent      = CompanionBagTab,
                FixedBorder = true,
                Border      = true,
                Slot        = (int)CompanionSlot.Food,
                GridType    = GridType.CompanionEquipment,
            };
            cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 102);

            DXCheckBox PickUpCheckBox = new DXCheckBox
            {
                Parent  = CompanionBagTab,
                Label   = { Text = "拾取物品:" },
                Visible = false
            };

            //PickUpCheckBox.Location = new Point(ClientArea.Right - PickUpCheckBox.Size.Width +3, ClientArea.Y + 45);
            PickUpCheckBox.Location = new Point(60, 90);

            /*
             * new DXLabel
             * {
             *  AutoSize = false,
             *  Parent = this,
             *  Outline = true,
             *  Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
             *  ForeColour = Color.FromArgb(198, 166, 99),
             *  OutlineColour = Color.Black,
             *  IsControl = false,
             *  Text = "Abilities",
             *  Location = new Point(ClientArea.X + 196, CompanionDisplayPoint.Y - 20),
             *  Size = new Size(156, 20),
             *  DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter,
             * };
             */

            DXLabel label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 3",
            };

            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 70);

            Level3Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y - 67),
                Text          = "不可用"
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 5",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 50);

            Level5Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y - 47),
                Text          = "不可用"
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 7",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 30);

            Level7Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y - 27),
                Text          = "不可用"
            };


            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 10",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 10);

            Level10Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y - 7),
                Text          = "不可用"
            };


            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 11",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 10);

            Level11Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 13),
                Text          = "不可用"
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 13",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 30);

            Level13Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 33),
                Text          = "不可用"
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "Level 15",
            };
            label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 50);

            Level15Label = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(235, CompanionDisplayPoint.Y + 53),
                Text          = "不可用"
            };

            NameLabel = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y - 27)
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "名字",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y - 30);

            LevelLabel = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y - 7)
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "等级",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y - 10);

            ExperienceLabel = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 13)
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "经验",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 10);

            HungerLabel = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 33)
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "饥饿度",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 30);

            WeightLabel = new DXLabel
            {
                Parent        = CompanionBagTab,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
                Location      = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 53)
            };

            label = new DXLabel
            {
                Parent        = CompanionBagTab,
                Outline       = true,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                OutlineColour = Color.Black,
                IsControl     = false,
                Text          = "重量",
            };
            label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 50);
        }
Ejemplo n.º 12
0
        public AutoPotionDialog()
        {
            TitleLabel.Text = "辅助功能";
            HasFooter       = true;

            SetClientSize(new Size(280, 418));


            // feature: 设置tag,用作自动喝药,辅助功能,挂机的分页
            HasTitle          = true;
            SupportTabControl = new DXTabControl
            {
                Parent   = this,
                Location = ClientArea.Location,
                Size     = ClientArea.Size,
            };

            AutoPotionTab = new DXTab
            {
                Parent    = SupportTabControl,
                Border    = true,
                TabButton = { Label = { Text = "自动喝药设置" } },
            };
            AutoSkillTab = new DXTab
            {
                Parent    = SupportTabControl,
                Border    = true,
                TabButton = { Label = { Text = "技能设置" } },
            };
            AutoBattleTab = new DXTab
            {
                Parent    = SupportTabControl,
                Border    = true,
                TabButton = { Label = { Text = "挂机设置" } },
            };

            SupportTabControl.SelectedTab = AutoPotionTab;

            WarriorSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 10),
            };

            WarriorSkillPanelTitle = new DXLabel
            {
                Parent     = WarriorSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "战士技能"
            };

            AutoBladeStormSkillCheckBox = new DXCheckBox
            {
                Parent   = WarriorSkillPanel,
                Label    = { Text = "自动莲月" },
                Checked  = false,
                Location = new Point(5, WarriorSkillPanelTitle.Size.Height + 5)
            };

            AutoFlamingSwordSkillCheckBox = new DXCheckBox
            {
                Parent   = WarriorSkillPanel,
                Label    = { Text = "自动烈火" },
                Checked  = false,
                Location = new Point(WarriorSkillPanel.Size.Width / 2 + 5, WarriorSkillPanelTitle.Size.Height + 5)
            };

            AutoMightSkillCheckBox = new DXCheckBox
            {
                Parent   = WarriorSkillPanel,
                Label    = { Text = "自动破血狂杀" },
                Checked  = false,
                Location = new Point(5, WarriorSkillPanelTitle.Size.Height + 23)
            };

            WizardSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 90),
            };

            WizardSkillPanelTitle = new DXLabel
            {
                Parent     = WizardSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "法师技能"
            };

            AutoMagicShieldSkillCheckBox = new DXCheckBox
            {
                Parent   = WizardSkillPanel,
                Label    = { Text = "自动魔法盾" },
                Checked  = false,
                Location = new Point(5, WizardSkillPanelTitle.Size.Height + 5)
            };

            AutoRenounceSkillCheckBox = new DXCheckBox
            {
                Parent   = WizardSkillPanel,
                Label    = { Text = "自动凝血离魄" },
                Checked  = false,
                Location = new Point(WizardSkillPanel.Size.Width / 2 + 5, WizardSkillPanelTitle.Size.Height + 5)
            };

            TaoistSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 170),
            };

            TaoistSkillPanelTitle = new DXLabel
            {
                Parent     = TaoistSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "道士技能"
            };


            AutoCelestialLightSkillCheckBox = new DXCheckBox
            {
                Parent   = TaoistSkillPanel,
                Label    = { Text = "自动阴阳法环" },
                Checked  = false,
                Location = new Point(5, TaoistSkillPanelTitle.Size.Height + 5)
            };


            AssassinSkillPanel = new DXControl
            {
                Parent       = AutoSkillTab,
                Border       = true,
                BorderSize   = 3,
                BorderColour = Color.FromArgb(198, 166, 99),
                Size         = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度
                Location     = new Point(3, 250),
            };

            AssassinSkillPanelTitle = new DXLabel
            {
                Parent     = AssassinSkillPanel,
                ForeColour = Color.FromArgb(198, 166, 99),
                Location   = new Point(5, 5),
                Text       = "刺客技能"
            };

            AutoFourFlowerSkillCheckBox = new DXCheckBox
            {
                Parent   = AssassinSkillPanel,
                Label    = { Text = "自动四花" },
                Checked  = false,
                Location = new Point(5, AssassinSkillPanelTitle.Size.Height + 5)
            };

            AutoRagingWindSkillCheckBox = new DXCheckBox
            {
                Parent   = AssassinSkillPanel,
                Label    = { Text = "自动风之守护" },
                Checked  = false,
                Location = new Point(AssassinSkillPanel.Size.Width / 2 + 5, AssassinSkillPanelTitle.Size.Height + 5)
            };

            AutoEvasionSkillCheckBox = new DXCheckBox
            {
                Parent   = AssassinSkillPanel,
                Label    = { Text = "自动风之闪避" },
                Checked  = false,
                Location = new Point(5, AssassinSkillPanelTitle.Size.Height + 23)
            };
            // feature end

            Links = new ClientAutoPotionLink[Globals.MaxAutoPotionCount];
            Rows  = new AutoPotionRow[Globals.MaxAutoPotionCount];


            ScrollBar = new DXVScrollBar
            {
                Parent      = AutoPotionTab,
                Size        = new Size(14, AutoPotionTab.Size.Height - 2),
                Location    = new Point(AutoPotionTab.Size.Width - 14, ClientArea.Top + 1),
                VisibleSize = AutoPotionTab.Size.Height,
                MaxValue    = Rows.Length * 50 - 2
            };
            DXControl panel = new DXControl
            {
                Parent   = AutoPotionTab,
                Size     = new Size(AutoPotionTab.Size.Width - 16, AutoPotionTab.Size.Height),
                Location = AutoPotionTab.Location,
            };

            panel.MouseWheel += ScrollBar.DoMouseWheel;

            for (int i = 0; i < Links.Length; i++)
            {
                AutoPotionRow row;
                Rows[i] = row = new AutoPotionRow
                {
                    Parent   = panel,
                    Location = new Point(1, 1 + 50 * i),
                    Index    = i,
                };
                row.MouseWheel += ScrollBar.DoMouseWheel;
            }
            ScrollBar.ValueChanged += (o, e) => UpdateLocations();
        }
Ejemplo n.º 13
0
        public StorageDialog()
        {
            TitleLabel.Text = "Storage";

            SetClientSize(new Size(473, 380));

            DXControl filterPanel = new DXControl
            {
                Parent       = this,
                Size         = new Size(ClientArea.Width, 26),
                Location     = new Point(ClientArea.Location.X, ClientArea.Location.Y),
                Border       = true,
                BorderColour = Color.FromArgb(198, 166, 99)
            };

            DXLabel label = new DXLabel
            {
                Parent   = filterPanel,
                Location = new Point(5, 5),
                Text     = "Name:",
            };

            ItemNameTextBox = new DXTextBox
            {
                Parent   = filterPanel,
                Size     = new Size(180, 20),
                Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y),
            };
            ItemNameTextBox.TextBox.TextChanged += (o, e) => ApplyStorageFilter();

            label = new DXLabel
            {
                Parent   = filterPanel,
                Location = new Point(ItemNameTextBox.Location.X + ItemNameTextBox.Size.Width + 10, 5),
                Text     = "Item:",
            };



            ItemTypeComboBox = new DXComboBox
            {
                Parent         = filterPanel,
                Location       = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y),
                Size           = new Size(95, DXComboBox.DefaultNormalHeight),
                DropDownHeight = 198
            };
            ItemTypeComboBox.SelectedItemChanged += (o, e) => ApplyStorageFilter();

            new DXListBoxItem
            {
                Parent = ItemTypeComboBox.ListBox,
                Label  = { Text = $"All" },
                Item   = null
            };

            Type itemType = typeof(ItemType);

            for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++)
            {
                MemberInfo[] infos = itemType.GetMember(i.ToString());

                DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>();

                new DXListBoxItem
                {
                    Parent = ItemTypeComboBox.ListBox,
                    Label  = { Text = description?.Description ?? i.ToString() },
                    Item   = i
                };
            }

            ItemTypeComboBox.ListBox.SelectItem(null);


            ClearButton = new DXButton
            {
                Size       = new Size(80, SmallButtonHeight),
                Location   = new Point(ItemTypeComboBox.Location.X + ItemTypeComboBox.Size.Width + 17, label.Location.Y - 1),
                Parent     = filterPanel,
                ButtonType = ButtonType.SmallButton,
                Label      = { Text = "Clear" }
            };
            ClearButton.MouseClick += (o, e) =>
            {
                ItemTypeComboBox.ListBox.SelectItem(null);
                ItemNameTextBox.TextBox.Text = string.Empty;
            };

            Grid = new DXItemGrid
            {
                Parent        = this,
                GridSize      = new Size(1, 1),
                Location      = new Point(ClientArea.Location.X, ClientArea.Location.Y + 30),
                GridType      = GridType.Storage,
                ItemGrid      = CEnvir.Storage,
                VisibleHeight = 10,
            };

            Grid.GridSizeChanged += StorageGrid_GridSizeChanged;



            StorageScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Location    = new Point(ClientArea.Right - 14, ClientArea.Location.Y + 31),
                Size        = new Size(14, 349),
                VisibleSize = 10,
                Change      = 1,
            };
            StorageScrollBar.ValueChanged += StorageScrollBar_ValueChanged;


            foreach (DXItemCell cell in Grid.Grid)
            {
                cell.MouseWheel += StorageScrollBar.DoMouseWheel;
            }
        }
Ejemplo n.º 14
0
        public InventoryDialog()
        {
            LibraryFile = LibraryFile.Interface;
            Index       = 130;
            Movable     = true;

            CloseButton = new DXButton
            {
                Parent      = this,
                Index       = 15,
                LibraryFile = LibraryFile.Interface,
            };
            CloseButton.Location    = new Point(DisplayArea.Width - CloseButton.Size.Width - 5, 5);
            CloseButton.MouseClick += (o, e) => Visible = false;

            TitleLabel = new DXLabel
            {
                Text          = "Inventory",
                Parent        = this,
                Font          = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold),
                ForeColour    = Color.FromArgb(198, 166, 99),
                Outline       = true,
                OutlineColour = Color.Black,
                IsControl     = false,
            };
            TitleLabel.Location = new Point((DisplayArea.Width - TitleLabel.Size.Width) / 2, 8);

            Grid = new DXItemGrid
            {
                GridSize    = new Size(6, 8),
                Parent      = this,
                ItemGrid    = GameScene.Game.Inventory,
                GridType    = GridType.Inventory,
                Location    = new Point(20, 39),
                GridPadding = 1,
                BackColour  = Color.Empty,
                Border      = false
            };

            CEnvir.LibraryList.TryGetValue(LibraryFile.GameInter, out MirLibrary library);

            DXControl WeightBar = new DXControl
            {
                Parent   = this,
                Location = new Point(53, 355),
                Size     = library.GetSize(360),
            };

            WeightBar.BeforeDraw += (o, e) =>
            {
                if (library == null)
                {
                    return;
                }

                if (MapObject.User.Stats[Stat.BagWeight] == 0)
                {
                    return;
                }

                float percent = Math.Min(1, Math.Max(0, MapObject.User.BagWeight / (float)MapObject.User.Stats[Stat.BagWeight]));

                if (percent == 0)
                {
                    return;
                }

                MirImage image = library.CreateImage(360, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                PresentTexture(image.Image, this, new Rectangle(WeightBar.DisplayArea.X, WeightBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, WeightBar);
            };

            WeightLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            WeightLabel.SizeChanged += (o, e) =>
            {
                WeightLabel.Location = new Point(WeightBar.Location.X + (WeightBar.Size.Width - WeightLabel.Size.Width) / 2, WeightBar.Location.Y - 1 + (WeightBar.Size.Height - WeightLabel.Size.Height) / 2);
            };

            GoldTitle = new DXLabel
            {
                AutoSize   = false,
                ForeColour = Color.Goldenrod,
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Left,
                Parent     = this,
                Location   = new Point(55, 381),
                Font       = new Font(Config.FontName, CEnvir.FontSize(8F), FontStyle.Bold),
                Text       = "Gold",
                Size       = new Size(97, 20)
            };

            GoldLabel = new DXLabel
            {
                AutoSize   = false,
                ForeColour = Color.White,
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Right,
                Parent     = this,
                Location   = new Point(80, 381),
                Text       = "0",
                Size       = new Size(97, 20),
                Sound      = SoundIndex.GoldPickUp
            };
            GoldLabel.MouseClick += GoldLabel_MouseClick;

            GameGoldTitle = new DXLabel
            {
                AutoSize   = false,
                ForeColour = Color.DarkOrange,
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Left,
                Parent     = this,
                Location   = new Point(55, 400),
                Font       = new Font(Config.FontName, CEnvir.FontSize(8F), FontStyle.Bold),
                Text       = "GG",
                Size       = new Size(97, 20)
            };

            GameGoldLabel = new DXLabel
            {
                AutoSize   = false,
                ForeColour = Color.White,
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.Right,
                Parent     = this,
                Location   = new Point(80, 400),
                Text       = "0",
                Size       = new Size(97, 20)
            };

            SortButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 364,
                Parent      = this,
                Location    = new Point(180, 384),
                Hint        = "Sort",
                Enabled     = false
            };

            TrashButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 358,
                Parent      = this,
                Location    = new Point(218, 384),
                Hint        = "Trash",
                Enabled     = false
            };

            CurrencyLabel = new DXLabel
            {
                Parent   = this,
                Location = new Point(8, 380),
                Hint     = "Wallet [Ctrl + C]",
                Size     = new Size(45, 40),
                Sound    = SoundIndex.GoldPickUp
            };
            CurrencyLabel.MouseClick += CurrencyLabel_MouseClick;
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DXTaskbar"/> class.
 /// </summary>
 /// <param name="controlHost"></param>
 /// <param name="parent"></param>
 public DXTaskbar(IDirectXControlHost controlHost, DXControl parent) : base(controlHost)
 {
     this.Parent = parent;
     InitializeComponent();
 }
Ejemplo n.º 16
0
        public MonsterDropListDialog()
        {
            base.TitleLabel.Text = "怪物爆率查询";
            base.HasFooter       = false;
            base.SetClientSize(new Size(350, 350));
            DXControl dxcontrol = new DXControl
            {
                Parent       = this,
                Size         = new Size(base.ClientArea.Width, 26),
                Location     = new Point(base.ClientArea.Left, base.ClientArea.Top),
                Border       = true,
                BorderColour = Color.FromArgb(198, 166, 99)
            };
            DXLabel dxlabel = new DXLabel
            {
                Parent   = dxcontrol,
                Location = new Point(5, 5),
                Text     = "名称:"
            };

            this.ItemNameBox = new DXTextBox
            {
                Parent   = dxcontrol,
                Size     = new Size(180, 20),
                Location = new Point(dxlabel.Location.X + dxlabel.Size.Width + 5, dxlabel.Location.Y)
            };
            this.ItemNameBox.TextBox.KeyPress += delegate(object s, KeyPressEventArgs e)
            {
                bool flag = e.KeyChar != '\r';
                if (!flag)
                {
                    e.Handled = true;
                    bool enabled = this.SearchButton.Enabled;
                    if (enabled)
                    {
                        this.Search();
                    }
                }
            };
            this.SearchButton = new DXButton
            {
                Size       = new Size(80, DXControl.SmallButtonHeight),
                Location   = new Point(this.ItemNameBox.Location.X + this.ItemNameBox.Size.Width + 15, dxlabel.Location.Y - 1),
                Parent     = dxcontrol,
                ButtonType = ButtonType.SmallButton,
                Label      =
                {
                    Text = "查找"
                }
            };
            this.SearchButton.MouseClick += delegate(object o, MouseEventArgs e)
            {
                this.Search();
            };
            this.MonsterList.AddRange(Globals.MonsterInfoList.Binding);
            this.Header = new MonsterDropRow
            {
                Parent   = this,
                Location = new Point(base.ClientArea.Left, base.ClientArea.Y + dxcontrol.Size.Height + 5),
                IsHeader = true
            };
            this.Rows      = new MonsterDropRow[15];
            this.ScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Size        = new Size(14, base.ClientArea.Height - 2 - 22),
                Location    = new Point(base.ClientArea.Right - 14, base.ClientArea.Top + 1 + 27),
                VisibleSize = 15,
                Change      = 3
            };
            this.ScrollBar.ValueChanged += this.ScrollBar_ValueChanged;
            base.MouseWheel             += this.ScrollBar.DoMouseWheel;
            DXControl parent = new DXControl
            {
                Parent   = this,
                Location = new Point(base.ClientArea.Location.X, base.ClientArea.Location.Y + dxcontrol.Size.Height + 5 + this.Header.Size.Height + 2),
                Size     = new Size(base.ClientArea.Width - 16, base.ClientArea.Size.Height - 22 - dxcontrol.Size.Height - 5)
            };

            for (int i = 0; i < 15; i++)
            {
                int index = i;
                this.Rows[index] = new MonsterDropRow
                {
                    Parent   = parent,
                    Location = new Point(0, 22 * i),
                    Visible  = false
                };
                this.Rows[index].MouseClick += delegate(object o, MouseEventArgs e)
                {
                    GameScene.Game.MonsterDropItemsBox.Bind(this.Rows[index].Monster);
                };
                this.Rows[index].MouseWheel += this.ScrollBar.DoMouseWheel;
            }
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Intializes a new instance of the <see cref="TerrainWindow"/> class.
 /// </summary>
 /// <param name="controlHost"></param>
 /// <param name="parent"></param>
 /// <param name="cell"></param>
 public TerrainWindow(IDirectXControlHost controlHost, DXControl parent, GridCell cell) : base(controlHost)
 {
     _cell       = cell;
     this.Parent = parent;
     InitializeComponent();
 }
Ejemplo n.º 18
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (SupportTabControl != null)
                {
                    if (!SupportTabControl.IsDisposed)
                    {
                        SupportTabControl.Dispose();
                    }

                    SupportTabControl = null;
                }

                if (AutoPotionTab != null)
                {
                    if (!AutoPotionTab.IsDisposed)
                    {
                        AutoPotionTab.Dispose();
                    }

                    AutoPotionTab = null;
                }

                if (AutoSkillTab != null)
                {
                    if (!AutoSkillTab.IsDisposed)
                    {
                        AutoSkillTab.Dispose();
                    }

                    AutoSkillTab = null;
                }

                if (AutoBattleTab != null)
                {
                    if (!AutoBattleTab.IsDisposed)
                    {
                        AutoBattleTab.Dispose();
                    }

                    AutoBattleTab = null;
                }

                if (WarriorSkillPanel != null)
                {
                    if (!WarriorSkillPanel.IsDisposed)
                    {
                        WarriorSkillPanel.Dispose();
                    }

                    WarriorSkillPanel = null;
                }

                if (WarriorSkillPanelTitle != null)
                {
                    if (!WarriorSkillPanelTitle.IsDisposed)
                    {
                        WarriorSkillPanelTitle.Dispose();
                    }

                    WarriorSkillPanelTitle = null;
                }

                if (Links != null)
                {
                    for (int i = 0; i < Links.Length; i++)
                    {
                        Links[i] = null;
                    }

                    Links = null;
                }

                for (int i = 0; i < Rows.Length; i++)
                {
                    if (Rows[i] == null)
                    {
                        continue;
                    }

                    if (!Rows[i].IsDisposed)
                    {
                        Rows[i].Dispose();
                    }

                    Rows[i] = null;
                }

                Rows = null;

                if (ScrollBar != null)
                {
                    if (!ScrollBar.IsDisposed)
                    {
                        ScrollBar.Dispose();
                    }

                    ScrollBar = null;
                }
            }
        }
Ejemplo n.º 19
0
        public MailDialog()
        {
            TitleLabel.Text = "邮件";
            HasFooter       = true;

            SetClientSize(new Size(350, 350));

            //Rows
            Header = new MailRow
            {
                Parent   = this,
                Location = ClientArea.Location,
                IsHeader = true,
            };

            Rows      = new MailRow[15];
            ScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Size        = new Size(14, ClientArea.Height - 2 - 22),
                Location    = new Point(ClientArea.Right - 14, ClientArea.Top + 1 + 22),
                VisibleSize = 15,
                Change      = 3,
            };
            ScrollBar.ValueChanged += ScrollBar_ValueChanged;
            MouseWheel             += ScrollBar.DoMouseWheel;

            DXControl panel = new DXControl
            {
                Parent   = this,
                Location = new Point(ClientArea.Location.X, ClientArea.Location.Y + Header.Size.Height + 2),
                Size     = new Size(ClientArea.Width - 16, ClientArea.Size.Height - 22)
            };

            for (int i = 0; i < 15; i++)
            {
                int index = i;
                Rows[index] = new MailRow
                {
                    Parent   = panel,
                    Location = new Point(0, 22 * i),
                    Visible  = false,
                };
                Rows[index].MouseClick += (o, e) =>
                {
                    GameScene.Game.ReadMailBox.Mail = Rows[index].Mail;

                    if (Rows[index].Mail.Opened)
                    {
                        return;
                    }

                    Rows[index].Mail.Opened = true;
                    Rows[index].RefreshIcon();
                    GameScene.Game.MailBox.UpdateIcon();

                    CEnvir.Enqueue(new C.MailOpened {
                        Index = Rows[index].Mail.Index
                    });
                };
                Rows[index].MouseWheel += ScrollBar.DoMouseWheel;
            }

            CollectAllButton = new DXButton
            {
                Location = new Point(ClientArea.Right - 100, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "签收" }
            };
            CollectAllButton.MouseClick += (o, e) =>
            {
                int count = 15;
                foreach (ClientMailInfo mail in MailList)
                {
                    if (count <= 0)
                    {
                        break;
                    }

                    if (mail.Items.Count == 0)
                    {
                        continue;
                    }

                    if (!mail.Opened)
                    {
                        mail.Opened = true;
                        CEnvir.Enqueue(new C.MailOpened {
                            Index = mail.Index
                        });
                        count--;
                        foreach (MailRow row in Rows)
                        {
                            if (row.Mail != mail)
                            {
                                continue;
                            }
                            row.RefreshIcon();
                            break;
                        }
                    }

                    foreach (ClientUserItem item in mail.Items)
                    {
                        CEnvir.Enqueue(new C.MailGetItem {
                            Index = mail.Index, Slot = item.Slot
                        });
                    }
                    count--;
                }

                GameScene.Game.MailBox.UpdateIcon();
            };


            DeleteAll = new DXButton
            {
                Location = new Point(ClientArea.Right - 200, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "删除" }
            };
            DeleteAll.MouseClick += (o, e) =>
            {
                int count = 15;
                foreach (ClientMailInfo mail in MailList)
                {
                    if (count <= 0)
                    {
                        break;
                    }
                    if (mail.Items.Count > 0)
                    {
                        continue;
                    }

                    CEnvir.Enqueue(new C.MailDelete {
                        Index = mail.Index
                    });
                    count--;
                }
            };

            NewButton = new DXButton
            {
                Location = new Point(ClientArea.Right - 300, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "写邮件" }
            };
            NewButton.MouseClick += (o, e) =>
            {
                GameScene.Game.SendMailBox.Visible = true;
                GameScene.Game.SendMailBox.BringToFront();
            };
        }
Ejemplo n.º 20
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                Tabs.Remove(this);

                if (Panel != null)
                {
                    if (!Panel.IsDisposed)
                    {
                        Panel.Dispose();
                    }

                    Panel = null;
                }

                if (TextPanel != null)
                {
                    if (!TextPanel.IsDisposed)
                    {
                        TextPanel.Dispose();
                    }

                    TextPanel = null;
                }

                if (ScrollBar != null)
                {
                    if (!ScrollBar.IsDisposed)
                    {
                        ScrollBar.Dispose();
                    }

                    ScrollBar = null;
                }

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

                            History[i] = null;
                        }
                    }

                    History.Clear();
                    History = null;
                }

                if (AlertIcon != null)
                {
                    if (!AlertIcon.IsDisposed)
                    {
                        AlertIcon.Dispose();
                    }

                    AlertIcon = null;
                }
            }
        }
Ejemplo n.º 21
0
        public void Update(ClientObjectData ob)
        {
            if (GameScene.Game.MapControl.MapInfo == null)
            {
                return;
            }
            DXControl control;

            if (!MapInfoObjects.TryGetValue(ob, out control))
            {
                if (ob.MapIndex != GameScene.Game.MapControl.MapInfo.Index)
                {
                    return;
                }
                if (ob.ItemInfo != null && ob.ItemInfo.Rarity == Rarity.Common)
                {
                    return;
                }
                if (ob.MonsterInfo != null && ob.Dead)
                {
                    return;
                }


                MapInfoObjects[ob] = control = new DXControl
                {
                    DrawTexture = true,
                    Parent      = Image,
                    Opacity     = Opacity,
                    //MonsterInfo.AI < 0 ? Color.FromArgb(150, 200, 255) : Color.Red,
                };
            }
            else if (ob.MapIndex != GameScene.Game.MapControl.MapInfo.Index || (ob.MonsterInfo != null && ob.Dead) || (ob.ItemInfo != null && ob.ItemInfo.Rarity == Rarity.Common))
            {
                control.Dispose();
                MapInfoObjects.Remove(ob);
                return;
            }


            Size   size   = new Size(3, 3);
            Color  colour = Color.White;
            string name   = ob.Name;

            if (ob.MonsterInfo != null)
            {
                name = $"{ob.MonsterInfo.MonsterName}";

                if (ob.MonsterInfo.AI < 0)
                {
                    colour = Color.LightBlue;
                }
                else
                {
                    colour = Color.Red;

                    if (GameScene.Game.HasQuest(ob.MonsterInfo, GameScene.Game.MapControl.MapInfo))
                    {
                        colour = Color.Orange;
                    }
                }

                if (ob.MonsterInfo.IsBoss)
                {
                    size = new Size(5, 5);

                    if (control.Controls.Count == 0) // This is disgusting but its cheap
                    {
                        new DXControl
                        {
                            Parent      = control,
                            Location    = new Point(1, 1),
                            BackColour  = colour,
                            DrawTexture = true,
                            Size        = new Size(3, 3)
                        };
                    }
                    else
                    {
                        control.Controls[0].BackColour = colour;
                    }

                    colour = Color.White;
                }

                if (!string.IsNullOrEmpty(ob.PetOwner))
                {
                    name += $" ({ob.PetOwner})";
                    control.DrawTexture = false;
                }
            }
            else if (ob.ItemInfo != null)
            {
                colour = Color.DarkBlue;
            }
            else
            {
                if (MapObject.User.ObjectID == ob.ObjectID)
                {
                    colour = Color.Cyan;
                }
                else if (GameScene.Game.Observer)
                {
                    control.Visible = false;
                }
                else if (GameScene.Game.GroupBox.Members.Any(x => x.ObjectID == ob.ObjectID))
                {
                    colour = Color.Blue;
                }
                else if (GameScene.Game.Partner != null && GameScene.Game.Partner.ObjectID == ob.ObjectID)
                {
                    colour = Color.DeepPink;
                }
                else if (GameScene.Game.GuildBox.GuildInfo != null && GameScene.Game.GuildBox.GuildInfo.Members.Any(x => x.ObjectID == ob.ObjectID))
                {
                    colour = Color.DeepSkyBlue;
                }
            }

            control.Hint       = name;
            control.BackColour = colour;
            control.Size       = size;
            control.Location   = new Point((int)(ScaleX * ob.Location.X) - size.Width / 2, (int)(ScaleY * ob.Location.Y) - size.Height / 2);

            if (MapObject.User.ObjectID != ob.ObjectID)
            {
                return;
            }

            Image.Location = new Point(-control.Location.X + Area.Width / 2, -control.Location.Y + Area.Height / 2);
        }
        public FortuneCheckerDialog()
        {
            //HasFooter = true;
            TitleLabel.Text = "财富检查器";
            SetClientSize(new Size(485, 551));

            #region Search

            DXControl filterPanel = new DXControl
            {
                Parent       = this,
                Size         = new Size(ClientArea.Width, 26),
                Location     = new Point(ClientArea.Left, ClientArea.Top),
                Border       = true,
                BorderColour = Color.FromArgb(198, 166, 99)
            };

            DXLabel label = new DXLabel
            {
                Parent   = filterPanel,
                Location = new Point(5, 5),
                Text     = "名字:",
            };

            ItemNameBox = new DXTextBox
            {
                Parent   = filterPanel,
                Size     = new Size(180, 20),
                Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y),
            };
            ItemNameBox.TextBox.KeyPress += TextBox_KeyPress;



            label = new DXLabel
            {
                Parent   = filterPanel,
                Location = new Point(ItemNameBox.Location.X + ItemNameBox.Size.Width + 10, 5),
                Text     = "物品:",
            };



            ItemTypeBox = new DXComboBox
            {
                Parent         = filterPanel,
                Location       = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y),
                Size           = new Size(95, DXComboBox.DefaultNormalHeight),
                DropDownHeight = 198
            };


            new DXListBoxItem
            {
                Parent = ItemTypeBox.ListBox,
                Label  = { Text = "所有" },
                Item   = null
            };

            Type itemType = typeof(ItemType);

            for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++)
            {
                MemberInfo[] infos = itemType.GetMember(i.ToString());

                DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>();

                new DXListBoxItem
                {
                    Parent = ItemTypeBox.ListBox,
                    Label  = { Text = description?.Description ?? i.ToString() },
                    Item   = i
                };
            }

            ItemTypeBox.ListBox.SelectItem(null);

            SearchButton = new DXButton
            {
                Size       = new Size(80, SmallButtonHeight),
                Location   = new Point(ItemTypeBox.Location.X + ItemTypeBox.Size.Width + 15, label.Location.Y - 1),
                Parent     = filterPanel,
                ButtonType = ButtonType.SmallButton,
                Label      = { Text = "搜索" }
            };
            SearchButton.MouseClick += (o, e) => Search();

            SearchRows = new FortuneCheckerRow[9];

            SearchScrollBar = new DXVScrollBar
            {
                Parent      = this,
                Location    = new Point(ClientArea.Size.Width - 14 + ClientArea.Left, ClientArea.Y + filterPanel.Size.Height + 5),
                Size        = new Size(14, ClientArea.Height - 5 - filterPanel.Size.Height),
                VisibleSize = SearchRows.Length,
                Change      = 3,
            };
            SearchScrollBar.ValueChanged += SearchScrollBar_ValueChanged;


            for (int i = 0; i < SearchRows.Length; i++)
            {
                int index = i;
                SearchRows[index] = new FortuneCheckerRow
                {
                    Parent   = this,
                    Location = new Point(ClientArea.X, ClientArea.Y + filterPanel.Size.Height + 5 + i * 58),
                };
                //   SearchRows[index].MouseClick += (o, e) => { SelectedRow = SearchRows[index]; };
                SearchRows[index].MouseWheel += SearchScrollBar.DoMouseWheel;
            }

            #endregion
        }
Ejemplo n.º 23
0
        public MainPanel()
        {
            LibraryFile = LibraryFile.GameInter;
            Index       = 50;

            ExperienceBar = new DXImageControl
            {
                Parent      = this,
                LibraryFile = LibraryFile.GameInter,
                Index       = 51,
            };
            ExperienceBar.Location    = new Point((Size.Width - ExperienceBar.Size.Width) / 2 + 1, 2 + 1);
            ExperienceBar.BeforeDraw += (o, e) =>
            {
                if (ExperienceBar.Library == null)
                {
                    return;
                }

                if (MapObject.User.Level >= Globals.ExperienceList.Count)
                {
                    return;
                }

                decimal MaxExperience = Globals.ExperienceList[MapObject.User.Level];

                if (MaxExperience == 0)
                {
                    return;
                }

                //Get percent.
                MirImage image = ExperienceBar.Library.CreateImage(56, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                int x = (ExperienceBar.Size.Width - image.Width) / 2;
                int y = (ExperienceBar.Size.Height - image.Height) / 2;


                float percent = (float)Math.Min(1, Math.Max(0, MapObject.User.Experience / MaxExperience));

                if (percent == 0)
                {
                    return;
                }



                PresentTexture(image.Image, this, new Rectangle(ExperienceBar.DisplayArea.X + x, ExperienceBar.DisplayArea.Y + y - 1, (int)(image.Width * percent), image.Height), Color.White, ExperienceBar);
            };

            DXControl HealthBar = new DXControl
            {
                Parent   = this,
                Location = new Point(35, 22),
                Size     = ExperienceBar.Library.GetSize(52),
            };

            HealthBar.BeforeDraw += (o, e) =>
            {
                if (ExperienceBar.Library == null)
                {
                    return;
                }

                if (MapObject.User.Stats[Stat.Health] == 0)
                {
                    return;
                }

                float percent = Math.Min(1, Math.Max(0, MapObject.User.CurrentHP / (float)MapObject.User.Stats[Stat.Health]));

                if (percent == 0)
                {
                    return;
                }

                MirImage image = ExperienceBar.Library.CreateImage(52, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                PresentTexture(image.Image, this, new Rectangle(HealthBar.DisplayArea.X, HealthBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, HealthBar);
            };
            DXControl ManaBar = new DXControl
            {
                Parent   = this,
                Location = new Point(35, 36),
                Size     = ExperienceBar.Library.GetSize(52),
            };

            ManaBar.BeforeDraw += (o, e) =>
            {
                if (ExperienceBar.Library == null)
                {
                    return;
                }

                if (MapObject.User.Stats[Stat.Mana] == 0)
                {
                    return;
                }

                float percent = Math.Min(1, Math.Max(0, MapObject.User.CurrentMP / (float)MapObject.User.Stats[Stat.Mana]));

                if (percent == 0)
                {
                    return;
                }

                MirImage image = ExperienceBar.Library.CreateImage(54, ImageType.Image);

                if (image == null)
                {
                    return;
                }

                PresentTexture(image.Image, this, new Rectangle(ManaBar.DisplayArea.X, ManaBar.DisplayArea.Y, (int)(image.Width * percent), image.Height), Color.White, ManaBar);
            };
            DXImageControl OtherBar = new DXImageControl
            {
                Parent      = this,
                Location    = new Point(35, 50),
                LibraryFile = LibraryFile.GameInter,
                Index       = 58,
                Visible     = false,
            };

            DXButton CharacterButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 82,
                Parent      = this,
                Location    = new Point(650, 23),
                Hint        = "角色 [Q]"
            };

            CharacterButton.MouseClick += (o, e) =>
            {
                GameScene.Game.CharacterBox.Visible = !GameScene.Game.CharacterBox.Visible;
            };

            DXButton InventoryButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 87,
                Parent      = this,
                Location    = new Point(689, 23),
                Hint        = "背包 [W]\n" +
                              "宠物背包 [U]"
            };

            InventoryButton.MouseClick += (o, e) => GameScene.Game.InventoryBox.Visible = !GameScene.Game.InventoryBox.Visible;

            DXButton SpellButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 92,
                Parent      = this,
                Location    = new Point(728, 23),
                Hint        = "技能 [E]"
            };

            SpellButton.MouseClick += (o, e) => GameScene.Game.MagicBox.Visible = !GameScene.Game.MagicBox.Visible;

            DXButton QuestButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 112,
                Parent      = this,
                Location    = new Point(767, 23),
                Hint        = "任务 [J]"
            };

            QuestButton.MouseClick += (o, e) => GameScene.Game.QuestBox.Visible = !GameScene.Game.QuestBox.Visible;

            DXButton MailButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 97,
                Parent      = this,
                Location    = new Point(806, 23),
                Hint        = "邮件 [,]"
            };

            MailButton.MouseClick += (o, e) => GameScene.Game.MailBox.Visible = !GameScene.Game.MailBox.Visible;

            NewMailIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 240,
                Parent      = MailButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };

            AvailableQuestIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 240,
                Parent      = QuestButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };
            AvailableQuestIcon.VisibleChanged += (o, e) =>
            {
                if (AvailableQuestIcon.Visible)
                {
                    CompletedQuestIcon.Location = new Point(2, QuestButton.Size.Height - CompletedQuestIcon.Size.Height);
                }
                else
                {
                    CompletedQuestIcon.Location = new Point(2, 2);
                }
            };

            CompletedQuestIcon = new DXImageControl
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 241,
                Parent      = QuestButton,
                IsControl   = false,
                Location    = new Point(2, 2),
                Visible     = false,
            };

            DXButton BeltButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 107,
                Parent      = this,
                Location    = new Point(845, 23),
                Hint        = "快捷栏 [Z]"
            };

            BeltButton.MouseClick += (o, e) => GameScene.Game.BeltBox.Visible = !GameScene.Game.BeltBox.Visible;

            DXButton GroupButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 102,
                Parent      = this,
                Location    = new Point(884, 23),
                Hint        = "组队 [P]"
            };

            GroupButton.MouseClick += (o, e) => GameScene.Game.GroupBox.Visible = !GameScene.Game.GroupBox.Visible;

            DXButton ConfigButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 117,
                Parent      = this,
                Location    = new Point(923, 23),
                Hint        = "设置 [O]"
            };

            ConfigButton.MouseClick += (o, e) => GameScene.Game.ConfigBox.Visible = !GameScene.Game.ConfigBox.Visible;

            DXButton CashShopButton = new DXButton
            {
                LibraryFile = LibraryFile.GameInter,
                Index       = 122,
                Parent      = this,
                Location    = new Point(972, 16),
                Hint        = "元宝商铺 [Y]"
            };

            CashShopButton.MouseClick += (o, e) =>
            {
                if (GameScene.Game.MarketPlaceBox.StoreTab.IsVisible)
                {
                    GameScene.Game.MarketPlaceBox.Visible = false;
                }
                else
                {
                    GameScene.Game.MarketPlaceBox.Visible = true;
                    GameScene.Game.MarketPlaceBox.StoreTab.TabButton.InvokeMouseClick();
                }
            };

            DXLabel label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "职业",
                Hint   = "职业",
            };

            label.Location = new Point(300 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "等级",
                Hint   = "等级",
            };
            label.Location = new Point(300 - label.Size.Width, 40);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "防御",
            };
            label.Location = new Point(385 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "魔防",
            };
            label.Location = new Point(470 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "攻击",
            };
            label.Location = new Point(385 - label.Size.Width, 40);

            DXLabel MCLabelLabel = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "魔法",
            };

            MCLabelLabel.Location = new Point(470 - MCLabelLabel.Size.Width, 40);

            DXLabel SCLabelLabel = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "道术",
            };

            SCLabelLabel.Location = new Point(470 - SCLabelLabel.Size.Width, 40);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "准确",
                Hint   = "准确",
            };
            label.Location = new Point(567 - label.Size.Width, 20);

            label = new DXLabel
            {
                Parent = this,
                Font   = new Font(Config.FontName, CEnvir.FontSize(9F), FontStyle.Bold),
                Text   = "敏捷",
                Hint   = "敏捷",
            };
            label.Location = new Point(567 - label.Size.Width, 40);

            ClassLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(300, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            LevelLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(300, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            ACLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(385, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            MRLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(470, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            DCLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(385, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            MCLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(470, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            MCLabel.VisibleChanged += (o, e) => MCLabelLabel.Visible = MCLabel.Visible;

            SCLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(470, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            SCLabel.VisibleChanged += (o, e) => SCLabelLabel.Visible = SCLabel.Visible;

            AccuracyLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(567, 20),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };

            AgilityLabel = new DXLabel
            {
                AutoSize   = false,
                Parent     = this,
                Font       = new Font(Config.FontName, CEnvir.FontSize(10F)),
                Location   = new Point(567, 40),
                Size       = new Size(60, 16),
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };


            HealthLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            HealthLabel.SizeChanged += (o, e) =>
            {
                HealthLabel.Location = new Point(HealthBar.Location.X + (HealthBar.Size.Width - HealthLabel.Size.Width) / 2, HealthBar.Location.Y + (HealthBar.Size.Height - HealthLabel.Size.Height) / 2);
            };

            ManaLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            ManaLabel.SizeChanged += (o, e) =>
            {
                ManaLabel.Location = new Point(ManaBar.Location.X + (ManaBar.Size.Width - ManaLabel.Size.Width) / 2, ManaBar.Location.Y + (ManaBar.Size.Height - ManaLabel.Size.Height) / 2);
            };


            ExperienceLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.White,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            ExperienceLabel.SizeChanged += (o, e) =>
            {
                ExperienceLabel.Location = new Point(ExperienceBar.Location.X + (ExperienceBar.Size.Width - ExperienceLabel.Size.Width) / 2, ExperienceBar.Location.Y + (ExperienceBar.Size.Height - ExperienceLabel.Size.Height) / 2);
            };

            AttackModeLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.Cyan,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            AttackModeLabel.SizeChanged += (o, e) =>
            {
                AttackModeLabel.Location = new Point(OtherBar.Location.X, OtherBar.Location.Y + (OtherBar.Size.Height - AttackModeLabel.Size.Height) / 2 - 2);
            };

            PetModeLabel = new DXLabel
            {
                Parent        = this,
                ForeColour    = Color.Cyan,
                Outline       = true,
                OutlineColour = Color.Black,
                DrawFormat    = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            PetModeLabel.SizeChanged += (o, e) =>
            {
                PetModeLabel.Location = new Point(OtherBar.Location.X + OtherBar.Size.Width - PetModeLabel.Size.Width, OtherBar.Location.Y + (OtherBar.Size.Height - PetModeLabel.Size.Height) / 2 - 2);
            };
        }
Ejemplo n.º 24
0
 public void SetDatabaseSupport(bool support)
 {
     itemView.SetDatabaseSupport(support);
     npcView.SetDatabaseSupport(support);
     DXControl.SetDatabaseSupport(support);
 }