public MagicTab(MagicSchool school) { TabButton.LibraryFile = LibraryFile.Interface; TabButton.Hint = school.ToString(); Border = true; switch (school) { case MagicSchool.Passive: TabButton.Index = 54; break; case MagicSchool.WeaponSkills: TabButton.Index = 65; break; case MagicSchool.Neutral: TabButton.Index = 64; break; case MagicSchool.Fire: TabButton.Index = 56; break; case MagicSchool.Ice: TabButton.Index = 57; break; case MagicSchool.Lightning: TabButton.Index = 58; break; case MagicSchool.Wind: TabButton.Index = 59; break; case MagicSchool.Holy: TabButton.Index = 61; break; case MagicSchool.Dark: TabButton.Index = 62; break; case MagicSchool.Phantom: TabButton.Index = 60; break; case MagicSchool.Combat: TabButton.Index = 66; break; case MagicSchool.Assassination: TabButton.Index = 67; break; case MagicSchool.None: TabButton.Index = 55; break; } ScrollBar = new DXVScrollBar { Parent = this, }; ScrollBar.ValueChanged += (o, e) => UpdateLocations(); }
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); }
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; } } }
public StorageDialog() { TitleLabel.Text = "个人仓库"; 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 = "名称:", }; 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 = "物品:", }; 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 = "全部" }, 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 = "清理" } }; 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; } }
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(); }; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (CollectAllButton != null) { if (!CollectAllButton.IsDisposed) { CollectAllButton.Dispose(); } CollectAllButton = null; } if (DeleteAll != null) { if (!DeleteAll.IsDisposed) { DeleteAll.Dispose(); } DeleteAll = null; } if (NewButton != null) { if (!NewButton.IsDisposed) { NewButton.Dispose(); } NewButton = null; } if (Header != null) { if (!Header.IsDisposed) { Header.Dispose(); } Header = null; } if (ScrollBar != null) { if (!ScrollBar.IsDisposed) { ScrollBar.Dispose(); } ScrollBar = null; } if (NewButton != null) { if (!NewButton.IsDisposed) { NewButton.Dispose(); } NewButton = null; } if (Rows != null) { for (int i = 0; i < Rows.Length; i++) { if (Rows[i] != null) { if (!Rows[i].IsDisposed) { Rows[i].Dispose(); } Rows[i] = null; } } Rows = null; } MailList.Clear(); MailList = null; } }
public FortuneCheckerDialog() { //HasFooter = true; TitleLabel.Text = "Fortune Checker"; 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 = "Name:", }; 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 = "Item:", }; 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 = $"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 = 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 = "Search" } }; 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 }
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(); }
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; } } }