Exemple #1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

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

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

                if (ItemCell != null)
                {
                    if (!ItemCell.IsDisposed)
                    {
                        ItemCell.Dispose();
                    }
                    ItemCell = null;
                }
            }
        }
        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 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;
        }
Exemple #4
0
        public DXItemAmountWindow(string caption, ClientUserItem item)
        {
            HasFooter = true;

            TitleLabel.Text = caption;
            SetClientSize(new Size(200, DXItemCell.CellHeight + 10));

            Parent = ActiveScene;
            MessageBoxList.Add(this);
            Modal = true;

            Location = new Point((ActiveScene.DisplayArea.Width - DisplayArea.Width) / 2, (ActiveScene.DisplayArea.Height - DisplayArea.Height) / 2);

            ConfirmButton = new DXButton
            {
                Location = new Point(Size.Width / 2 + 10, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "Confirm" }
            };
            ConfirmButton.MouseClick += (o, e) => Dispose();

            AmountBox = new DXNumberBox
            {
                Parent   = this,
                MaxValue = item.Count,
                Change   = Math.Max(1, item.Count / 5),
            };

            AmountBox.ValueTextBox.ValueChanged += (o, e) =>
            {
                Amount = AmountBox.Value;

                if (Amount <= 0)
                {
                    AmountBox.ValueTextBox.BorderColour = Color.Red;
                }
                else if (Amount == AmountBox.MaxValue)
                {
                    AmountBox.ValueTextBox.BorderColour = Color.Orange;
                }
                else
                {
                    AmountBox.ValueTextBox.BorderColour = Color.Green;
                }

                ConfirmButton.Enabled = Amount > 0;

                if (item.Info.Effect == ItemEffect.Gold)
                {
                    item.Count = Amount;
                    ItemCell.RefreshItem();
                }
            };

            ItemCell = new DXItemCell
            {
                Location    = new Point(ClientArea.Location.X + (ClientArea.Width - DXItemCell.CellWidth - AmountBox.Size.Width - 5) / 2, ClientArea.Location.Y + 5),
                Parent      = this,
                FixedBorder = true,
                Border      = true,
                ItemGrid    = new[] { item },
                Slot        = 0,
                GridType    = GridType.None,
                ReadOnly    = true,
            };

            AmountBox.Location = new Point(ItemCell.Location.X + ItemCell.Size.Width + 10, ItemCell.Location.Y + (ItemCell.Size.Height - AmountBox.Size.Height) / 2);

            AmountBox.Value = 1;
            AmountBox.ValueTextBox.KeepFocus = true;
            AmountBox.ValueTextBox.SetFocus();
            AmountBox.ValueTextBox.TextBox.KeyPress += AmountBox_KeyPress;
        }
        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;
        }