public DXConfigWindow() { ActiveConfig = this; Size = new Size(300, 305); TitleLabel.Text = "游戏设置"; HasFooter = true; TabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; GraphicsTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "图像" } }, }; SoundTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "声音" } }, }; GameTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "游戏" } }, }; NetworkTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "网络" } }, }; ColourTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "颜色" }, Visible = false }, }; KeyBindWindow = new DXKeyBindWindow { Visible = false }; #region Graphics FullScreenCheckBox = new DXCheckBox { Label = { Text = "全屏显示:" }, Parent = GraphicsTab, Checked = Config.FullScreen, }; FullScreenCheckBox.Location = new Point(120 - FullScreenCheckBox.Size.Width, 10); DXLabel label = new DXLabel { Text = "游戏分辨率:", Outline = true, Parent = GraphicsTab, }; label.Location = new Point(104 - label.Size.Width, 35); GameSizeComboBox = new DXComboBox { Parent = GraphicsTab, Location = new Point(104, 35), Size = new Size(100, DXComboBox.DefaultNormalHeight), }; foreach (Size resolution in Globals.ValidResolutions) { new DXListBoxItem { Parent = GameSizeComboBox.ListBox, Label = { Text = $"{resolution.Width} x {resolution.Height}" }, Item = resolution } } ; VSyncCheckBox = new DXCheckBox { Label = { Text = "垂直同步:" }, Parent = GraphicsTab, }; VSyncCheckBox.Location = new Point(120 - VSyncCheckBox.Size.Width, 60); LimitFPSCheckBox = new DXCheckBox { Label = { Text = "帧数限制:" }, Parent = GraphicsTab, }; LimitFPSCheckBox.Location = new Point(120 - LimitFPSCheckBox.Size.Width, 80); ClipMouseCheckBox = new DXCheckBox { Label = { Text = "使用Clip鼠标:" }, Parent = GraphicsTab, }; ClipMouseCheckBox.Location = new Point(120 - ClipMouseCheckBox.Size.Width, 100); DebugLabelCheckBox = new DXCheckBox { Label = { Text = "调试信息:" }, Parent = GraphicsTab, }; DebugLabelCheckBox.Location = new Point(120 - DebugLabelCheckBox.Size.Width, 120); label = new DXLabel { Text = "语言:", Outline = true, Parent = GraphicsTab, }; label.Location = new Point(104 - label.Size.Width, 140); LanguageComboBox = new DXComboBox { Parent = GraphicsTab, Location = new Point(104, 140), Size = new Size(100, DXComboBox.DefaultNormalHeight), }; foreach (string language in Globals.Languages) { new DXListBoxItem { Parent = LanguageComboBox.ListBox, Label = { Text = language }, Item = language } } ; #endregion #region Sound BackgroundSoundBox = new DXCheckBox { Label = { Text = "背景音乐:" }, Parent = SoundTab, Checked = Config.SoundInBackground, }; BackgroundSoundBox.Location = new Point(120 - BackgroundSoundBox.Size.Width, 10); label = new DXLabel { Text = "系统音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 35); SystemVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 35) }; label = new DXLabel { Text = "音乐音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 60); MusicVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 60) }; label = new DXLabel { Text = "玩家音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 85); PlayerVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 85) }; label = new DXLabel { Text = "怪物音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 110); MonsterVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 110) }; label = new DXLabel { Text = "魔法音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 135); SpellVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 135) }; #endregion #region Game ItemNameCheckBox = new DXCheckBox { Label = { Text = "物品名称:" }, Parent = GameTab, }; ItemNameCheckBox.Location = new Point(120 - ItemNameCheckBox.Size.Width, 10); MonsterNameCheckBox = new DXCheckBox { Label = { Text = "怪物名称:" }, Parent = GameTab, }; MonsterNameCheckBox.Location = new Point(120 - MonsterNameCheckBox.Size.Width, 35); PlayerNameCheckBox = new DXCheckBox { Label = { Text = "玩家名称:" }, Parent = GameTab, }; PlayerNameCheckBox.Location = new Point(120 - PlayerNameCheckBox.Size.Width, 60); UserHealthCheckBox = new DXCheckBox { Label = { Text = "角色生命值:" }, Parent = GameTab, }; UserHealthCheckBox.Location = new Point(120 - UserHealthCheckBox.Size.Width, 85); MonsterHealthCheckBox = new DXCheckBox { Label = { Text = "怪物生命值:" }, Parent = GameTab, }; MonsterHealthCheckBox.Location = new Point(120 - MonsterHealthCheckBox.Size.Width, 110); DamageNumbersCheckBox = new DXCheckBox { Label = { Text = "伤害数字:" }, Parent = GameTab, }; DamageNumbersCheckBox.Location = new Point(120 - DamageNumbersCheckBox.Size.Width, 135); EscapeCloseAllCheckBox = new DXCheckBox { Label = { Text = "ESC关闭所有窗口:" }, Parent = GameTab, }; EscapeCloseAllCheckBox.Location = new Point(270 - EscapeCloseAllCheckBox.Size.Width, 10); ShiftOpenChatCheckBox = new DXCheckBox { Label = { Text = "Shift + 1 快捷聊天:" }, Parent = GameTab, Hint = "如果打开,则按Shift + 1将打开聊天,如果关闭,则将使用物品快捷栏槽1。" }; ShiftOpenChatCheckBox.Location = new Point(270 - ShiftOpenChatCheckBox.Size.Width, 35); RightClickDeTargetCheckBox = new DXCheckBox { Label = { Text = "右键取消目标:" }, Parent = GameTab, Hint = "如果开启,单击右键取消目标锁定。" }; RightClickDeTargetCheckBox.Location = new Point(270 - RightClickDeTargetCheckBox.Size.Width, 60); MonsterBoxVisibleCheckBox = new DXCheckBox { Label = { Text = "显示怪物信息:" }, Parent = GameTab, }; MonsterBoxVisibleCheckBox.Location = new Point(270 - MonsterBoxVisibleCheckBox.Size.Width, 85); LogChatCheckBox = new DXCheckBox { Label = { Text = "日志信息:" }, Parent = GameTab, }; LogChatCheckBox.Location = new Point(270 - LogChatCheckBox.Size.Width, 110); DrawEffectsCheckBox = new DXCheckBox { Label = { Text = "绘制特效:" }, Parent = GameTab, }; DrawEffectsCheckBox.Location = new Point(270 - DrawEffectsCheckBox.Size.Width, 135); KeyBindButton = new DXButton { Parent = GameTab, Location = new Point(190, 160), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Label = { Text = "按键绑定" } }; KeyBindButton.MouseClick += (o, e) => KeyBindWindow.Visible = !KeyBindWindow.Visible; #endregion #region Network UseNetworkConfigCheckBox = new DXCheckBox { Label = { Text = "使用设置:" }, Parent = NetworkTab, Checked = Config.FullScreen, }; UseNetworkConfigCheckBox.Location = new Point(120 - UseNetworkConfigCheckBox.Size.Width, 10); label = new DXLabel { Text = "服务器地址:", Outline = true, Parent = NetworkTab, }; label.Location = new Point(104 - label.Size.Width, 35); IPAddressTextBox = new DXTextBox { Location = new Point(104, 35), Size = new Size(100, 16), Parent = NetworkTab, }; label = new DXLabel { Text = "服务器端口:", Outline = true, Parent = NetworkTab, }; label.Location = new Point(104 - label.Size.Width, 60); PortBox = new DXNumberBox { Parent = NetworkTab, Change = 100, MaxValue = ushort.MaxValue, Location = new Point(104, 60) }; #endregion #region Colours label = new DXLabel { Text = "本地聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 10); LocalColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 10), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "GM私聊:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 10); GMWhisperInColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 10), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "对你私聊:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 35); WhisperInColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 35), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "对玩家私聊:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 35); WhisperOutColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 35), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "组队聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 60); GroupColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 60), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "公会聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 60); GuildColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 60), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "大喊:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 85); ShoutColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 85), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "全局聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 85); GlobalColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 85), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "观看聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 110); ObserverColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 110), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "提示信息:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 110); HintColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 110), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "系统信息:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 135); SystemColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 135), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "拾取信息:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 135); GainsColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 135), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "游戏公告:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 160); AnnouncementColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 160), Size = new Size(40, label.Size.Height), }; ResetColoursButton = new DXButton { Parent = ColourTab, Location = new Point(180, 160), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Label = { Text = "恢复默认" } }; ResetColoursButton.MouseClick += (o, e) => { LocalColourBox.BackColour = Color.White; GMWhisperInColourBox.BackColour = Color.Red; WhisperInColourBox.BackColour = Color.Cyan; WhisperOutColourBox.BackColour = Color.Aquamarine; GroupColourBox.BackColour = Color.Plum; GuildColourBox.BackColour = Color.LightPink; ShoutColourBox.BackColour = Color.Yellow; GlobalColourBox.BackColour = Color.Lime; ObserverColourBox.BackColour = Color.Silver; HintColourBox.BackColour = Color.AntiqueWhite; SystemColourBox.BackColour = Color.Red; GainsColourBox.BackColour = Color.GreenYellow; AnnouncementColourBox.BackColour = Color.DarkBlue; }; #endregion SaveButton = new DXButton { Location = new Point(Size.Width - 190, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "应用" } }; SaveButton.MouseClick += SaveSettings; CancelButton = new DXButton { Location = new Point(Size.Width - 100, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "取消" } }; CancelButton.MouseClick += CancelSettings; ExitButton = new DXButton { Location = new Point(Size.Width - 280, Size.Height - 43), Size = new Size(60, DefaultHeight), Parent = this, Label = { Text = "退出" }, Visible = false, }; ExitButton.MouseClick += CancelSettings; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (ActiveConfig == this) { ActiveConfig = null; } if (TabControl != null) { if (!TabControl.IsDisposed) { TabControl.Dispose(); } TabControl = null; } if (KeyBindWindow != null) { if (!KeyBindWindow.IsDisposed) { KeyBindWindow.Dispose(); } KeyBindWindow = null; } #region Graphics if (GraphicsTab != null) { if (!GraphicsTab.IsDisposed) { GraphicsTab.Dispose(); } GraphicsTab = null; } if (FullScreenCheckBox != null) { if (!FullScreenCheckBox.IsDisposed) { FullScreenCheckBox.Dispose(); } FullScreenCheckBox = null; } if (VSyncCheckBox != null) { if (!VSyncCheckBox.IsDisposed) { VSyncCheckBox.Dispose(); } VSyncCheckBox = null; } if (LimitFPSCheckBox != null) { if (!LimitFPSCheckBox.IsDisposed) { LimitFPSCheckBox.Dispose(); } LimitFPSCheckBox = null; } if (ClipMouseCheckBox != null) { if (!ClipMouseCheckBox.IsDisposed) { ClipMouseCheckBox.Dispose(); } ClipMouseCheckBox = null; } if (DebugLabelCheckBox != null) { if (!DebugLabelCheckBox.IsDisposed) { DebugLabelCheckBox.Dispose(); } DebugLabelCheckBox = null; } if (GameSizeComboBox != null) { if (!GameSizeComboBox.IsDisposed) { GameSizeComboBox.Dispose(); } GameSizeComboBox = null; } if (LanguageComboBox != null) { if (!LanguageComboBox.IsDisposed) { LanguageComboBox.Dispose(); } LanguageComboBox = null; } #endregion #region Sound if (SoundTab != null) { if (!SoundTab.IsDisposed) { SoundTab.Dispose(); } SoundTab = null; } if (SystemVolumeBox != null) { if (!SystemVolumeBox.IsDisposed) { SystemVolumeBox.Dispose(); } SystemVolumeBox = null; } if (MusicVolumeBox != null) { if (!MusicVolumeBox.IsDisposed) { MusicVolumeBox.Dispose(); } MusicVolumeBox = null; } if (PlayerVolumeBox != null) { if (!PlayerVolumeBox.IsDisposed) { PlayerVolumeBox.Dispose(); } PlayerVolumeBox = null; } if (MonsterVolumeBox != null) { if (!MonsterVolumeBox.IsDisposed) { MonsterVolumeBox.Dispose(); } MonsterVolumeBox = null; } if (SpellVolumeBox != null) { if (!SpellVolumeBox.IsDisposed) { SpellVolumeBox.Dispose(); } SpellVolumeBox = null; } if (BackgroundSoundBox != null) { if (!BackgroundSoundBox.IsDisposed) { BackgroundSoundBox.Dispose(); } BackgroundSoundBox = null; } #endregion #region Game if (GameTab != null) { if (!GameTab.IsDisposed) { GameTab.Dispose(); } GameTab = null; } if (ItemNameCheckBox != null) { if (!ItemNameCheckBox.IsDisposed) { ItemNameCheckBox.Dispose(); } ItemNameCheckBox = null; } if (MonsterNameCheckBox != null) { if (!MonsterNameCheckBox.IsDisposed) { MonsterNameCheckBox.Dispose(); } MonsterNameCheckBox = null; } if (PlayerNameCheckBox != null) { if (!PlayerNameCheckBox.IsDisposed) { PlayerNameCheckBox.Dispose(); } PlayerNameCheckBox = null; } if (UserHealthCheckBox != null) { if (!UserHealthCheckBox.IsDisposed) { UserHealthCheckBox.Dispose(); } UserHealthCheckBox = null; } if (MonsterHealthCheckBox != null) { if (!MonsterHealthCheckBox.IsDisposed) { MonsterHealthCheckBox.Dispose(); } MonsterHealthCheckBox = null; } if (DamageNumbersCheckBox != null) { if (!DamageNumbersCheckBox.IsDisposed) { DamageNumbersCheckBox.Dispose(); } DamageNumbersCheckBox = null; } if (EscapeCloseAllCheckBox != null) { if (!EscapeCloseAllCheckBox.IsDisposed) { EscapeCloseAllCheckBox.Dispose(); } EscapeCloseAllCheckBox = null; } if (ShiftOpenChatCheckBox != null) { if (!ShiftOpenChatCheckBox.IsDisposed) { ShiftOpenChatCheckBox.Dispose(); } ShiftOpenChatCheckBox = null; } if (RightClickDeTargetCheckBox != null) { if (!RightClickDeTargetCheckBox.IsDisposed) { RightClickDeTargetCheckBox.Dispose(); } RightClickDeTargetCheckBox = null; } if (MonsterBoxVisibleCheckBox != null) { if (!MonsterBoxVisibleCheckBox.IsDisposed) { MonsterBoxVisibleCheckBox.Dispose(); } MonsterBoxVisibleCheckBox = null; } if (LogChatCheckBox != null) { if (!LogChatCheckBox.IsDisposed) { LogChatCheckBox.Dispose(); } LogChatCheckBox = null; } if (KeyBindButton != null) { if (!KeyBindButton.IsDisposed) { KeyBindButton.Dispose(); } KeyBindButton = null; } #endregion #region Network if (NetworkTab != null) { if (!NetworkTab.IsDisposed) { NetworkTab.Dispose(); } NetworkTab = null; } if (UseNetworkConfigCheckBox != null) { if (!UseNetworkConfigCheckBox.IsDisposed) { UseNetworkConfigCheckBox.Dispose(); } UseNetworkConfigCheckBox = null; } if (IPAddressTextBox != null) { if (!IPAddressTextBox.IsDisposed) { IPAddressTextBox.Dispose(); } IPAddressTextBox = null; } if (PortBox != null) { if (!PortBox.IsDisposed) { PortBox.Dispose(); } PortBox = null; } #endregion #region Colours if (ColourTab != null) { if (!ColourTab.IsDisposed) { ColourTab.Dispose(); } ColourTab = null; } if (LocalColourBox != null) { if (!LocalColourBox.IsDisposed) { LocalColourBox.Dispose(); } LocalColourBox = null; } if (GMWhisperInColourBox != null) { if (!GMWhisperInColourBox.IsDisposed) { GMWhisperInColourBox.Dispose(); } GMWhisperInColourBox = null; } if (WhisperInColourBox != null) { if (!WhisperInColourBox.IsDisposed) { WhisperInColourBox.Dispose(); } WhisperInColourBox = null; } if (WhisperOutColourBox != null) { if (!WhisperOutColourBox.IsDisposed) { WhisperOutColourBox.Dispose(); } WhisperOutColourBox = null; } if (GroupColourBox != null) { if (!GroupColourBox.IsDisposed) { GroupColourBox.Dispose(); } GroupColourBox = null; } if (GuildColourBox != null) { if (!GuildColourBox.IsDisposed) { GuildColourBox.Dispose(); } GuildColourBox = null; } if (ShoutColourBox != null) { if (!ShoutColourBox.IsDisposed) { ShoutColourBox.Dispose(); } ShoutColourBox = null; } if (GlobalColourBox != null) { if (!GlobalColourBox.IsDisposed) { GlobalColourBox.Dispose(); } GlobalColourBox = null; } if (ObserverColourBox != null) { if (!ObserverColourBox.IsDisposed) { ObserverColourBox.Dispose(); } ObserverColourBox = null; } if (HintColourBox != null) { if (!HintColourBox.IsDisposed) { HintColourBox.Dispose(); } HintColourBox = null; } if (SystemColourBox != null) { if (!SystemColourBox.IsDisposed) { SystemColourBox.Dispose(); } SystemColourBox = null; } if (GainsColourBox != null) { if (!GainsColourBox.IsDisposed) { GainsColourBox.Dispose(); } GainsColourBox = null; } #endregion if (SaveButton != null) { if (!SaveButton.IsDisposed) { SaveButton.Dispose(); } SaveButton = null; } if (CancelButton != null) { if (!CancelButton.IsDisposed) { CancelButton.Dispose(); } CancelButton = null; } if (ExitButton != null) { if (!ExitButton.IsDisposed) { ExitButton.Dispose(); } ExitButton = null; } } }
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) { CompanionDisplay = null; CompanionDisplayPoint = Point.Empty; if (CompanionTabControl != null) { if (!CompanionTabControl.IsDisposed) { CompanionTabControl.Dispose(); } CompanionTabControl = null; } if (CompanionBagTab != null) { if (!CompanionBagTab.IsDisposed) { CompanionBagTab.Dispose(); } CompanionBagTab = null; } if (PickUpFilterTab != null) { if (!PickUpFilterTab.IsDisposed) { PickUpFilterTab.Dispose(); } PickUpFilterTab = null; } if (ItemNameFilterTab != null) { if (!ItemNameFilterTab.IsDisposed) { ItemNameFilterTab.Dispose(); } ItemNameFilterTab = null; } if (EquipmentGrid != null) { for (int i = 0; i < EquipmentGrid.Length; i++) { if (EquipmentGrid[i] != null) { if (!EquipmentGrid[i].IsDisposed) { EquipmentGrid[i].Dispose(); } EquipmentGrid[i] = null; } } EquipmentGrid = null; } if (InventoryGrid != null) { if (!InventoryGrid.IsDisposed) { InventoryGrid.Dispose(); } InventoryGrid = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (HungerLabel != null) { if (!HungerLabel.IsDisposed) { HungerLabel.Dispose(); } HungerLabel = null; } if (NameLabel != null) { if (!NameLabel.IsDisposed) { NameLabel.Dispose(); } NameLabel = null; } if (LevelLabel != null) { if (!LevelLabel.IsDisposed) { LevelLabel.Dispose(); } LevelLabel = null; } if (ExperienceLabel != null) { if (!ExperienceLabel.IsDisposed) { ExperienceLabel.Dispose(); } ExperienceLabel = null; } if (Level3Label != null) { if (!Level3Label.IsDisposed) { Level3Label.Dispose(); } Level3Label = null; } if (Level5Label != null) { if (!Level5Label.IsDisposed) { Level5Label.Dispose(); } Level5Label = null; } if (Level7Label != null) { if (!Level7Label.IsDisposed) { Level7Label.Dispose(); } Level7Label = null; } if (Level10Label != null) { if (!Level10Label.IsDisposed) { Level10Label.Dispose(); } Level10Label = null; } if (ModeComboBox != null) { if (!ModeComboBox.IsDisposed) { ModeComboBox.Dispose(); } ModeComboBox = null; } BagWeight = 0; MaxBagWeight = 0; InventorySize = 0; } }
public DXConfigWindow() { ActiveConfig = this; Size = new Size(300, 305); TitleLabel.Text = "Configuration"; HasFooter = true; TabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; GraphicsTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Graphics" } }, }; SoundTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Sound" } }, }; GameTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Game" } }, }; NetworkTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Network" } }, }; ColourTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Colours" }, Visible = false }, }; KeyBindWindow = new DXKeyBindWindow { Visible = false }; #region Graphics FullScreenCheckBox = new DXCheckBox { Label = { Text = "Full Screen:" }, Parent = GraphicsTab, Checked = Config.FullScreen, }; FullScreenCheckBox.Location = new Point(120 - FullScreenCheckBox.Size.Width, 10); DXLabel label = new DXLabel { Text = "Game Size:", Outline = true, Parent = GraphicsTab, }; label.Location = new Point(104 - label.Size.Width, 35); GameSizeComboBox = new DXComboBox { Parent = GraphicsTab, Location = new Point(104, 35), Size = new Size(100, DXComboBox.DefaultNormalHeight), }; foreach (Size resolution in Globals.ValidResolutions) { new DXListBoxItem { Parent = GameSizeComboBox.ListBox, Label = { Text = $"{resolution.Width} x {resolution.Height}" }, Item = resolution } } ; VSyncCheckBox = new DXCheckBox { Label = { Text = "V-Sync:" }, Parent = GraphicsTab, }; VSyncCheckBox.Location = new Point(120 - VSyncCheckBox.Size.Width, 60); LimitFPSCheckBox = new DXCheckBox { Label = { Text = "Limit FPS:" }, Parent = GraphicsTab, }; LimitFPSCheckBox.Location = new Point(120 - LimitFPSCheckBox.Size.Width, 80); ClipMouseCheckBox = new DXCheckBox { Label = { Text = "Clip Mouse:" }, Parent = GraphicsTab, }; ClipMouseCheckBox.Location = new Point(120 - ClipMouseCheckBox.Size.Width, 100); DebugLabelCheckBox = new DXCheckBox { Label = { Text = "Debug Label:" }, Parent = GraphicsTab, }; DebugLabelCheckBox.Location = new Point(120 - DebugLabelCheckBox.Size.Width, 120); label = new DXLabel { Text = "Language:", Outline = true, Parent = GraphicsTab, }; label.Location = new Point(104 - label.Size.Width, 140); LanguageComboBox = new DXComboBox { Parent = GraphicsTab, Location = new Point(104, 140), Size = new Size(100, DXComboBox.DefaultNormalHeight), }; foreach (string language in Globals.Languages) { new DXListBoxItem { Parent = LanguageComboBox.ListBox, Label = { Text = language }, Item = language } } ; #endregion #region Sound BackgroundSoundBox = new DXCheckBox { Label = { Text = "Background Sound:" }, Parent = SoundTab, Checked = Config.SoundInBackground, }; BackgroundSoundBox.Location = new Point(120 - BackgroundSoundBox.Size.Width, 10); label = new DXLabel { Text = "System Volume:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 35); SystemVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 35) }; label = new DXLabel { Text = "Music Volume:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 60); MusicVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 60) }; label = new DXLabel { Text = "Player Volume:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 85); PlayerVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 85) }; label = new DXLabel { Text = "Monster Volume:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 110); MonsterVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 110) }; label = new DXLabel { Text = "Magic Volume:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 135); SpellVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 135) }; #endregion #region Game ItemNameCheckBox = new DXCheckBox { Label = { Text = "Item Names:" }, Parent = GameTab, }; ItemNameCheckBox.Location = new Point(120 - ItemNameCheckBox.Size.Width, 10); MonsterNameCheckBox = new DXCheckBox { Label = { Text = "Monster Names:" }, Parent = GameTab, }; MonsterNameCheckBox.Location = new Point(120 - MonsterNameCheckBox.Size.Width, 35); PlayerNameCheckBox = new DXCheckBox { Label = { Text = "Player Name:" }, Parent = GameTab, }; PlayerNameCheckBox.Location = new Point(120 - PlayerNameCheckBox.Size.Width, 60); UserHealthCheckBox = new DXCheckBox { Label = { Text = "User Health:" }, Parent = GameTab, }; UserHealthCheckBox.Location = new Point(120 - UserHealthCheckBox.Size.Width, 85); MonsterHealthCheckBox = new DXCheckBox { Label = { Text = "Monster Health:" }, Parent = GameTab, }; MonsterHealthCheckBox.Location = new Point(120 - MonsterHealthCheckBox.Size.Width, 110); DamageNumbersCheckBox = new DXCheckBox { Label = { Text = "Damage Numbers:" }, Parent = GameTab, }; DamageNumbersCheckBox.Location = new Point(120 - DamageNumbersCheckBox.Size.Width, 135); DrawParticlesCheckBox = new DXCheckBox { Label = { Text = "Draw Particles:" }, Parent = GameTab, }; DrawParticlesCheckBox.Location = new Point(120 - DrawParticlesCheckBox.Size.Width, 160); EscapeCloseAllCheckBox = new DXCheckBox { Label = { Text = "Escape Close All:" }, Parent = GameTab, }; EscapeCloseAllCheckBox.Location = new Point(270 - EscapeCloseAllCheckBox.Size.Width, 10); ShiftOpenChatCheckBox = new DXCheckBox { Label = { Text = "Shift + 1 Open Chat:" }, Parent = GameTab, Hint = "If turned on, Pressing Shift + 1 will open chat, if this is off you will use Quick Slot 1" }; ShiftOpenChatCheckBox.Location = new Point(270 - ShiftOpenChatCheckBox.Size.Width, 35); RightClickDeTargetCheckBox = new DXCheckBox { Label = { Text = "Right Click De-Target:" }, Parent = GameTab, Hint = "If turned on, Right clicking to move away will also remove monster target." }; RightClickDeTargetCheckBox.Location = new Point(270 - RightClickDeTargetCheckBox.Size.Width, 60); MonsterBoxVisibleCheckBox = new DXCheckBox { Label = { Text = "Show Monster Info:" }, Parent = GameTab, }; MonsterBoxVisibleCheckBox.Location = new Point(270 - MonsterBoxVisibleCheckBox.Size.Width, 85); LogChatCheckBox = new DXCheckBox { Label = { Text = "Log Chat:" }, Parent = GameTab, }; LogChatCheckBox.Location = new Point(270 - LogChatCheckBox.Size.Width, 110); DrawEffectsCheckBox = new DXCheckBox { Label = { Text = "Draw Effects:" }, Parent = GameTab, }; DrawEffectsCheckBox.Location = new Point(270 - DrawEffectsCheckBox.Size.Width, 135); KeyBindButton = new DXButton { Parent = GameTab, Location = new Point(190, 160), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Label = { Text = "Key Binds" } }; KeyBindButton.MouseClick += (o, e) => KeyBindWindow.Visible = !KeyBindWindow.Visible; #endregion #region Network UseNetworkConfigCheckBox = new DXCheckBox { Label = { Text = "Use Config:" }, Parent = NetworkTab, Checked = Config.FullScreen, }; UseNetworkConfigCheckBox.Location = new Point(120 - UseNetworkConfigCheckBox.Size.Width, 10); label = new DXLabel { Text = "IP Address:", Outline = true, Parent = NetworkTab, }; label.Location = new Point(104 - label.Size.Width, 35); IPAddressTextBox = new DXTextBox { Location = new Point(104, 35), Size = new Size(100, 16), Parent = NetworkTab, }; label = new DXLabel { Text = "Port:", Outline = true, Parent = NetworkTab, }; label.Location = new Point(104 - label.Size.Width, 60); PortBox = new DXNumberBox { Parent = NetworkTab, Change = 100, MaxValue = ushort.MaxValue, Location = new Point(104, 60) }; #endregion #region Colours label = new DXLabel { Text = "Local Chat:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 10); LocalColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 10), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "GM Whisper In:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 10); GMWhisperInColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 10), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Whisper In:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 35); WhisperInColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 35), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Whisper Out:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 35); WhisperOutColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 35), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Group Chat:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 60); GroupColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 60), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Guild Chat:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 60); GuildColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 60), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Shout Chat:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 85); ShoutColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 85), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Global Chat:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 85); GlobalColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 85), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Observer Chat:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 110); ObserverColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 110), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Hint Text:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 110); HintColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 110), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "System Text:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 135); SystemColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 135), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Gains Text:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 135); GainsColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 135), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "Announcements:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 160); AnnouncementColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 160), Size = new Size(40, label.Size.Height), }; ResetColoursButton = new DXButton { Parent = ColourTab, Location = new Point(180, 160), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Label = { Text = "Reset All" } }; ResetColoursButton.MouseClick += (o, e) => { LocalColourBox.BackColour = Color.White; GMWhisperInColourBox.BackColour = Color.Red; WhisperInColourBox.BackColour = Color.Cyan; WhisperOutColourBox.BackColour = Color.Aquamarine; GroupColourBox.BackColour = Color.Plum; GuildColourBox.BackColour = Color.LightPink; ShoutColourBox.BackColour = Color.Yellow; GlobalColourBox.BackColour = Color.Lime; ObserverColourBox.BackColour = Color.Silver; HintColourBox.BackColour = Color.AntiqueWhite; SystemColourBox.BackColour = Color.Red; GainsColourBox.BackColour = Color.GreenYellow; AnnouncementColourBox.BackColour = Color.DarkBlue; }; #endregion SaveButton = new DXButton { Location = new Point(Size.Width - 190, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "Apply" } }; SaveButton.MouseClick += SaveSettings; CancelButton = new DXButton { Location = new Point(Size.Width - 100, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "Cancel" } }; CancelButton.MouseClick += CancelSettings; ExitButton = new DXButton { Location = new Point(Size.Width - 280, Size.Height - 43), Size = new Size(60, DefaultHeight), Parent = this, Label = { Text = "Exit" }, Visible = false, }; ExitButton.MouseClick += CancelSettings; }
public DXConfigWindow() { ActiveConfig = this; Size = new Size(300, 305); TitleLabel.Text = "系统设置"; HasFooter = true; TabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; GraphicsTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "图像" } }, }; SoundTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "声音" } }, }; GameTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "游戏" } }, }; NetworkTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "网络" } }, }; ColourTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "颜色" }, Visible = false }, }; KeyBindWindow = new DXKeyBindWindow { Visible = false }; #region Graphics FullScreenCheckBox = new DXCheckBox { Label = { Text = "全屏:" }, Parent = GraphicsTab, Checked = Config.FullScreen, }; FullScreenCheckBox.Location = new Point(120 - FullScreenCheckBox.Size.Width, 10); DXLabel label = new DXLabel { Text = "分辨率:", Outline = true, Parent = GraphicsTab, }; label.Location = new Point(104 - label.Size.Width, 35); GameSizeComboBox = new DXComboBox { Parent = GraphicsTab, Location = new Point(104, 35), Size = new Size(100, DXComboBox.DefaultNormalHeight), }; foreach (Size resolution in Globals.ValidResolutions) { new DXListBoxItem { Parent = GameSizeComboBox.ListBox, Label = { Text = $"{resolution.Width} x {resolution.Height}" }, Item = resolution } } ; VSyncCheckBox = new DXCheckBox { Label = { Text = "垂直同步:" }, Parent = GraphicsTab, }; VSyncCheckBox.Location = new Point(120 - VSyncCheckBox.Size.Width, 60); LimitFPSCheckBox = new DXCheckBox { Label = { Text = "限制FPS:" }, Parent = GraphicsTab, }; LimitFPSCheckBox.Location = new Point(120 - LimitFPSCheckBox.Size.Width, 80); ClipMouseCheckBox = new DXCheckBox { Label = { Text = "捕获鼠标:" }, Parent = GraphicsTab, }; ClipMouseCheckBox.Location = new Point(120 - ClipMouseCheckBox.Size.Width, 100); DebugLabelCheckBox = new DXCheckBox { Label = { Text = "显示顶部信息行:" }, Parent = GraphicsTab, }; DebugLabelCheckBox.Location = new Point(120 - DebugLabelCheckBox.Size.Width, 120); label = new DXLabel { Text = "语音:", Outline = true, Parent = GraphicsTab, }; label.Location = new Point(104 - label.Size.Width, 140); LanguageComboBox = new DXComboBox { Parent = GraphicsTab, Location = new Point(104, 140), Size = new Size(100, DXComboBox.DefaultNormalHeight), }; foreach (string language in Globals.Languages) { new DXListBoxItem { Parent = LanguageComboBox.ListBox, Label = { Text = language }, Item = language } } ; #endregion #region Sound BackgroundSoundBox = new DXCheckBox { Label = { Text = "背景音:" }, Parent = SoundTab, Checked = Config.SoundInBackground, }; BackgroundSoundBox.Location = new Point(120 - BackgroundSoundBox.Size.Width, 10); label = new DXLabel { Text = "系统音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 35); SystemVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 35) }; label = new DXLabel { Text = "音乐音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 60); MusicVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 60) }; label = new DXLabel { Text = "角色音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 85); PlayerVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 85) }; label = new DXLabel { Text = "怪物音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 110); MonsterVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 110) }; label = new DXLabel { Text = "魔法音量:", Outline = true, Parent = SoundTab, }; label.Location = new Point(104 - label.Size.Width, 135); SpellVolumeBox = new DXNumberBox { Parent = SoundTab, MinValue = 0, MaxValue = 100, Location = new Point(104, 135) }; #endregion #region Game ItemNameCheckBox = new DXCheckBox { Label = { Text = "物品显名:" }, Parent = GameTab, }; ItemNameCheckBox.Location = new Point(120 - ItemNameCheckBox.Size.Width, 10); MonsterNameCheckBox = new DXCheckBox { Label = { Text = "怪物显名:" }, Parent = GameTab, }; MonsterNameCheckBox.Location = new Point(120 - MonsterNameCheckBox.Size.Width, 35); PlayerNameCheckBox = new DXCheckBox { Label = { Text = "角色名称:" }, Parent = GameTab, }; PlayerNameCheckBox.Location = new Point(120 - PlayerNameCheckBox.Size.Width, 60); UserHealthCheckBox = new DXCheckBox { Label = { Text = "显示玩家血量:" }, Parent = GameTab, }; UserHealthCheckBox.Location = new Point(120 - UserHealthCheckBox.Size.Width, 85); MonsterHealthCheckBox = new DXCheckBox { Label = { Text = "显示怪物血量:" }, Parent = GameTab, }; MonsterHealthCheckBox.Location = new Point(120 - MonsterHealthCheckBox.Size.Width, 110); DamageNumbersCheckBox = new DXCheckBox { Label = { Text = "数字飘血:" }, Parent = GameTab, }; DamageNumbersCheckBox.Location = new Point(120 - DamageNumbersCheckBox.Size.Width, 135); EscapeCloseAllCheckBox = new DXCheckBox { Label = { Text = "Esc关闭所有窗口:" }, Parent = GameTab, }; EscapeCloseAllCheckBox.Location = new Point(270 - EscapeCloseAllCheckBox.Size.Width, 10); ShiftOpenChatCheckBox = new DXCheckBox { Label = { Text = "Shift + 1 打开对话栏:" }, Parent = GameTab, Hint = "If turned on, Pressing Shift + 1 will open chat, if this is off you will use Quick Slot 1" }; ShiftOpenChatCheckBox.Location = new Point(270 - ShiftOpenChatCheckBox.Size.Width, 35); RightClickDeTargetCheckBox = new DXCheckBox { Label = { Text = "跑开后取消攻击目标:" }, Parent = GameTab, Hint = "If turned on, Right clicking to move away will also remove monster target." }; RightClickDeTargetCheckBox.Location = new Point(270 - RightClickDeTargetCheckBox.Size.Width, 60); MonsterBoxVisibleCheckBox = new DXCheckBox { Label = { Text = "显示怪物信息:" }, Parent = GameTab, }; MonsterBoxVisibleCheckBox.Location = new Point(270 - MonsterBoxVisibleCheckBox.Size.Width, 85); LogChatCheckBox = new DXCheckBox { Label = { Text = "记录聊天对话:" }, Parent = GameTab, }; LogChatCheckBox.Location = new Point(270 - LogChatCheckBox.Size.Width, 110); DrawEffectsCheckBox = new DXCheckBox { Label = { Text = "显示特效:" }, Parent = GameTab, }; DrawEffectsCheckBox.Location = new Point(270 - DrawEffectsCheckBox.Size.Width, 135); KeyBindButton = new DXButton { Parent = GameTab, Location = new Point(190, 160), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Label = { Text = "按键绑定" } }; KeyBindButton.MouseClick += (o, e) => KeyBindWindow.Visible = !KeyBindWindow.Visible; #endregion #region Network UseNetworkConfigCheckBox = new DXCheckBox { Label = { Text = "使用文本配置:" }, Parent = NetworkTab, Checked = Config.FullScreen, }; UseNetworkConfigCheckBox.Location = new Point(120 - UseNetworkConfigCheckBox.Size.Width, 10); label = new DXLabel { Text = "IP地址:", Outline = true, Parent = NetworkTab, }; label.Location = new Point(104 - label.Size.Width, 35); IPAddressTextBox = new DXTextBox { Location = new Point(104, 35), Size = new Size(100, 16), Parent = NetworkTab, }; label = new DXLabel { Text = "端口:", Outline = true, Parent = NetworkTab, }; label.Location = new Point(104 - label.Size.Width, 60); PortBox = new DXNumberBox { Parent = NetworkTab, Change = 100, MaxValue = ushort.MaxValue, Location = new Point(104, 60) }; #endregion #region Colours label = new DXLabel { Text = "本地聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 10); LocalColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 10), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "GM消息:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 10); GMWhisperInColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 10), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "收到私聊:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 35); WhisperInColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 35), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "发送私聊:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 35); WhisperOutColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 35), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "组队聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 60); GroupColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 60), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "行会聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 60); GuildColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 60), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "喊话聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 85); ShoutColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 85), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "全服聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 85); GlobalColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 85), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "观察者聊天:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 110); ObserverColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 110), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "提示信息:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 110); HintColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 110), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "系统消息:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 135); SystemColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 135), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "获取物品:", Outline = true, Parent = ColourTab, }; label.Location = new Point(220 - label.Size.Width, 135); GainsColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(220, 135), Size = new Size(40, label.Size.Height), }; label = new DXLabel { Text = "匿名:", Outline = true, Parent = ColourTab, }; label.Location = new Point(90 - label.Size.Width, 160); AnnouncementColourBox = new DXColourControl { Parent = ColourTab, Location = new Point(90, 160), Size = new Size(40, label.Size.Height), }; ResetColoursButton = new DXButton { Parent = ColourTab, Location = new Point(180, 160), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Label = { Text = "重置所有" } }; ResetColoursButton.MouseClick += (o, e) => { LocalColourBox.BackColour = Color.White; GMWhisperInColourBox.BackColour = Color.Red; WhisperInColourBox.BackColour = Color.Cyan; WhisperOutColourBox.BackColour = Color.Aquamarine; GroupColourBox.BackColour = Color.Plum; GuildColourBox.BackColour = Color.LightPink; ShoutColourBox.BackColour = Color.Yellow; GlobalColourBox.BackColour = Color.Lime; ObserverColourBox.BackColour = Color.Silver; HintColourBox.BackColour = Color.AntiqueWhite; SystemColourBox.BackColour = Color.Red; GainsColourBox.BackColour = Color.GreenYellow; AnnouncementColourBox.BackColour = Color.DarkBlue; }; #endregion SaveButton = new DXButton { Location = new Point(Size.Width - 190, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "应用" } }; SaveButton.MouseClick += SaveSettings; CancelButton = new DXButton { Location = new Point(Size.Width - 100, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "取消" } }; CancelButton.MouseClick += CancelSettings; ExitButton = new DXButton { Location = new Point(Size.Width - 280, Size.Height - 43), Size = new Size(60, DefaultHeight), Parent = this, Label = { Text = "退出" }, Visible = false, }; ExitButton.MouseClick += CancelSettings; }
public StorageDialog() { TitleLabel.Text = "仓库"; SetClientSize(new Size(483, 411)); 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) }; TabControl = new DXTabControl { Parent = this, Location = new Point(filterPanel.Location.X, filterPanel.Location.Y + filterPanel.Size.Height), Size = new Size(ClientArea.Width, 390), }; 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 = "物品:", }; 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 = "Clear" } }; ClearButton.MouseClick += (o, e) => { ItemTypeComboBox.ListBox.SelectItem(null); ItemNameTextBox.TextBox.Text = string.Empty; }; StorageTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "仓库" } }, Visible = true, }; PartsTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Parts" } }, Visible = false, }; Grid = new DXItemGrid { Parent = StorageTab, GridSize = new Size(1, 1), Location = new Point(5, 10), GridType = GridType.Storage, ItemGrid = CEnvir.Storage, VisibleHeight = 10, }; Grid.GridSizeChanged += StorageGrid_GridSizeChanged; PartGrid = new DXItemGrid { Parent = PartsTab, GridSize = new Size(13, 76), Location = new Point(5, 10), GridType = GridType.PartsStorage, ItemGrid = CEnvir.PartsStorage, VisibleHeight = 10, }; StorageScrollBar = new DXVScrollBar { Parent = StorageTab, Location = new Point(Grid.Location.X + PartGrid.Size.Width, Grid.Location.Y), Size = new Size(14, 349), VisibleSize = 10, Change = 1, }; StorageScrollBar.ValueChanged += StorageScrollBar_ValueChanged; PartsScrollBar = new DXVScrollBar { Parent = PartsTab, Location = new Point(PartGrid.Location.X + PartGrid.Size.Width, PartGrid.Location.Y), Size = new Size(14, 349), VisibleSize = 10, Change = 1, }; PartsScrollBar.ValueChanged += PartsScrollBar_ValueChanged; PartsScrollBar.MaxValue = PartGrid.GridSize.Height; foreach (DXItemCell cell in Grid.Grid) { cell.MouseWheel += StorageScrollBar.DoMouseWheel; } foreach (DXItemCell cell in PartGrid.Grid) { cell.MouseWheel += PartsScrollBar.DoMouseWheel; } }
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; } } }