Пример #1
0
 /// <summary>
 /// Config を読み込んでホットキーをセット
 /// </summary>
 private void SetHotkeyFromConfig()
 {
     ConfigManager.Config Config = ConfigManager.Load();
     if (Config.WinHotkey.KeyCode != Keys.None && Config.WinHotkey != null)
     {
         WinHotkey             = new HotKey(Config.WinHotkey.ModKey, Config.WinHotkey.KeyCode);
         WinHotkey.HotKeyPush += new EventHandler(WinButton_Click);
     }
     if (Config.LoseHotkey.KeyCode != Keys.None && Config.LoseHotkey != null)
     {
         LoseHotkey             = new HotKey(Config.LoseHotkey.ModKey, Config.LoseHotkey.KeyCode);
         LoseHotkey.HotKeyPush += new EventHandler(LoseButton_Click);
     }
     if (Config.DrawHotkey.KeyCode != Keys.None && Config.DrawHotkey != null)
     {
         DrawHotkey             = new HotKey(Config.DrawHotkey.ModKey, Config.DrawHotkey.KeyCode);
         DrawHotkey.HotKeyPush += new EventHandler(DrawButton_Click);
     }
 }
Пример #2
0
        private void SettingsForm_Load(object sender, EventArgs e)
        {
            // 最大化を無効に
            this.MaximizeBox = false;

            // コンフィグを読み込んで値をセット
            ConfigManager.Config Config = ConfigManager.Load();
            NameTextBox.Text             = Config.Name;
            LogoPictureBox.ImageLocation = Config.LogoImageFilePath;
            MainColorBox.BackColor       = ColorTranslator.FromHtml(Config.MainColorHtml);
            SubColorBox.BackColor        = ColorTranslator.FromHtml(Config.SubColorHtml);
            FontColorBox.BackColor       = ColorTranslator.FromHtml(Config.FontColorHtml);
            VolumeTrackbar.Value         = Config.SoundVolume;
            ScoreBoardSizeTrackbar.Value = Config.ScoreBoardSize;
            if (Config.ScoreBoardPosition == "top")
            {
                ScoreBoardPositionRadio_Top.Checked = true;
            }
            else
            {
                ScoreBoardPositionRadio_Bottom.Checked = true;
            }
            EnableProductionCheckbox.Checked = Config.EnableProduction;
            SetEnabledRegardingProductionControls(EnableProductionCheckbox.Checked);

            KeysConverter kc = new KeysConverter();

            if (Config.WinHotkey.KeyCode != Keys.None)
            {
                WinHotkeyCombobox.Text = kc.ConvertToString(Config.WinHotkey.KeyCode);
            }
            if (Config.WinHotkey.ModKey.HasFlag(MOD_KEY.CONTROL))
            {
                WinHotkeyModCheckbox_Ctrl.Checked = true;
            }
            if (Config.WinHotkey.ModKey.HasFlag(MOD_KEY.ALT))
            {
                WinHotkeyModCheckbox_Alt.Checked = true;
            }
            if (Config.WinHotkey.ModKey.HasFlag(MOD_KEY.SHIFT))
            {
                WinHotkeyModCheckbox_Shift.Checked = true;
            }
            if (Config.LoseHotkey.KeyCode != Keys.None)
            {
                LoseHotkeyCombobox.Text = kc.ConvertToString(Config.LoseHotkey.KeyCode);
            }
            if (Config.LoseHotkey.ModKey.HasFlag(MOD_KEY.CONTROL))
            {
                LoseHotkeyModCheckbox_Ctrl.Checked = true;
            }
            if (Config.LoseHotkey.ModKey.HasFlag(MOD_KEY.ALT))
            {
                LoseHotkeyModCheckbox_Alt.Checked = true;
            }
            if (Config.LoseHotkey.ModKey.HasFlag(MOD_KEY.SHIFT))
            {
                LoseHotkeyModCheckbox_Shift.Checked = true;
            }
            if (Config.DrawHotkey.KeyCode != Keys.None)
            {
                DrawHotkeyCombobox.Text = kc.ConvertToString(Config.DrawHotkey.KeyCode);
            }
            if (Config.DrawHotkey.ModKey.HasFlag(MOD_KEY.CONTROL))
            {
                DrawHotkeyModCheckbox_Ctrl.Checked = true;
            }
            if (Config.DrawHotkey.ModKey.HasFlag(MOD_KEY.ALT))
            {
                DrawHotkeyModCheckbox_Alt.Checked = true;
            }
            if (Config.DrawHotkey.ModKey.HasFlag(MOD_KEY.SHIFT))
            {
                DrawHotkeyModCheckbox_Shift.Checked = true;
            }

            // 言語をセット
            SetLanguage();
        }