Пример #1
0
        public DXInputWindow(string message, string caption)
        {
            HasFooter = true;

            TitleLabel.Text = caption;

            Parent = ActiveScene;
            MessageBoxList.Add(this);


            Label = new DXLabel
            {
                AutoSize   = false,
                Location   = new Point(10, 35),
                Parent     = this,
                Text       = message,
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.WordBreak | TextFormatFlags.HorizontalCenter
            };
            Label.Size = new Size(300, DXLabel.GetHeight(Label, 300).Height);

            ValueTextBox = new DXTextBox
            {
                Parent    = this,
                Size      = new Size(200, 20),
                Location  = new Point(60, 45 + Label.Size.Height),
                KeepFocus = true,
            };
            ValueTextBox.SetFocus();
            ValueTextBox.TextBox.TextChanged += TextBox_TextChanged;
            ValueTextBox.TextBox.KeyPress    += (o, e) => OnKeyPress(e);


            SetClientSize(new Size(300, Label.Size.Height + 30));
            Label.Location = ClientArea.Location;

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

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

            Location = new Point((ActiveScene.DisplayArea.Width - DisplayArea.Width) / 2, (ActiveScene.DisplayArea.Height - DisplayArea.Height) / 2);
        }
Пример #2
0
        public static Size GetHeight(DXLabel label, int width)
        {
            Size tempSize = TextRenderer.MeasureText(DXManager.Graphics, label.Text, label.Font, new Size(width, 2000), label.DrawFormat);

            if (label.Outline && tempSize.Width > 0 && tempSize.Height > 0)
            {
                tempSize.Width  += 2;
                tempSize.Height += 2;
            }

            return(tempSize);
        }
Пример #3
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

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

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

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

                if (ValueTextBox != null)
                {
                    if (!ValueTextBox.IsDisposed)
                    {
                        ValueTextBox.Dispose();
                    }
                    ValueTextBox = null;
                }
            }
        }
Пример #4
0
        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;
        }
Пример #5
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;
        }
Пример #6
0
        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;
        }
Пример #7
0
        public DXMessageBox(string message, string caption, DXMessageBoxButtons buttons = DXMessageBoxButtons.OK)
        {
            Buttons   = buttons;
            Modal     = true;
            HasFooter = true;

            TitleLabel.Text = caption;

            Parent = ActiveScene;
            MessageBoxList.Add(this);


            Label = new DXLabel
            {
                AutoSize   = false,
                Location   = new Point(10, 35),
                Parent     = this,
                Text       = message,
                DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter
            };
            Label.Size = new Size(380, DXLabel.GetSize(message, Label.Font, Label.Outline).Height);
            SetClientSize(Label.Size);
            Label.Location = ClientArea.Location;

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


            switch (Buttons)
            {
            case DXMessageBoxButtons.OK:
                OKButton = new DXButton
                {
                    Location = new Point((Size.Width - 80) / 2, Size.Height - 43),
                    Size     = new Size(80, DefaultHeight),
                    Parent   = this,
                    Label    = { Text = "OK" }
                };
                OKButton.MouseClick += (o, e) => Dispose();
                break;

            case DXMessageBoxButtons.YesNo:
                YesButton = new DXButton
                {
                    Location = new Point((Size.Width) / 2 - 80 - 10, Size.Height - 43),
                    Size     = new Size(80, DefaultHeight),
                    Parent   = this,
                    Label    = { Text = "Yes" }
                };
                YesButton.MouseClick += (o, e) => Dispose();
                NoButton              = new DXButton
                {
                    Location = new Point(Size.Width / 2 + 10, Size.Height - 43),
                    Size     = new Size(80, DefaultHeight),
                    Parent   = this,
                    Label    = { Text = "No" }
                };
                NoButton.MouseClick += (o, e) => Dispose();
                break;

            case DXMessageBoxButtons.Cancel:
                CancelButton = new DXButton
                {
                    Location = new Point((Size.Width - 80) / 2, Size.Height - 43),
                    Size     = new Size(80, DefaultHeight),
                    Parent   = this,
                    Label    = { Text = "Cancel" }
                };
                CancelButton.MouseClick += (o, e) => Dispose();
                break;
            }

            BringToFront();
        }
Пример #8
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

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

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

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

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

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

                if (HiddenBox != null)
                {
                    DXTextBox.ActiveTextBox = HiddenBox;
                    HiddenBox = null;
                }

                Buttons = DXMessageBoxButtons.None;
                MessageBoxList.Remove(this);
            }
        }
Пример #9
0
        public DXKeyBindWindow()
        {
            HasFooter           = true;
            TitleLabel.Text     = "Key Binds";
            Modal               = true;
            CloseButton.Visible = false;

            SetClientSize(new Size(430, 330));


            DXLabel label = new DXLabel
            {
                Parent = this,
                Text   = "[Escape] to undo changes to current Key Bind",
            };

            label.Location = new Point(ClientArea.Right - label.Size.Width, ClientArea.Y);

            BindTree = new KeyBindTree
            {
                Parent   = this,
                Location = new Point(ClientArea.X, ClientArea.Y + 20),
                Size     = new Size(ClientArea.Width, ClientArea.Height - 20)
            };

            SaveButton = new DXButton
            {
                Location = new Point(Size.Width - 190, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "Apply" }
            };
            SaveButton.MouseClick += SaveButton_MouseClick;

            CancelButton = new DXButton
            {
                Location = new Point(Size.Width - 100, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "Close" }
            };
            CancelButton.MouseClick += (o, e) => Visible = false;

            DefaultButton = new DXButton
            {
                Location = new Point(ClientArea.X, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "Defaults" }
            };
            DefaultButton.MouseClick += (o, e) =>
            {
                DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL keybinds back to the default settings?", "Reset Key Binds", DXMessageBoxButtons.YesNo);

                box.YesButton.MouseClick += (o1, e1) =>
                {
                    CEnvir.ResetKeyBinds();
                    LoadList();
                };
            };
        }
Пример #10
0
        public DXKeyBindWindow()
        {
            HasFooter           = true;
            TitleLabel.Text     = "按键绑定";
            Modal               = true;
            CloseButton.Visible = false;

            SetClientSize(new Size(430, 330));


            DXLabel label = new DXLabel
            {
                Parent = this,
                Text   = "按[Esc]键盘来撤销当前的按键绑定",
            };

            label.Location = new Point(ClientArea.Right - label.Size.Width, ClientArea.Y);

            BindTree = new KeyBindTree
            {
                Parent   = this,
                Location = new Point(ClientArea.X, ClientArea.Y + 20),
                Size     = new Size(ClientArea.Width, ClientArea.Height - 20)
            };

            SaveButton = new DXButton
            {
                Location = new Point(Size.Width - 190, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "应用" }
            };
            SaveButton.MouseClick += SaveButton_MouseClick;

            CancelButton = new DXButton
            {
                Location = new Point(Size.Width - 100, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "关闭" }
            };
            CancelButton.MouseClick += (o, e) => Visible = false;

            DefaultButton = new DXButton
            {
                Location = new Point(ClientArea.X, Size.Height - 43),
                Size     = new Size(80, DefaultHeight),
                Parent   = this,
                Label    = { Text = "默认" }
            };
            DefaultButton.MouseClick += (o, e) =>
            {
                DXMessageBox box = new DXMessageBox("确认重置所有按键绑定?", "重置", DXMessageBoxButtons.YesNo);

                box.YesButton.MouseClick += (o1, e1) =>
                {
                    CEnvir.ResetKeyBinds();
                    LoadList();
                };
            };
        }