Exemplo n.º 1
0
        public void Profiler_Load(object sender, EventArgs e)
        {
            m_vkcodes  = new VKCodes();
            m_profiles = new List <Profile>();

            // ModelRect
            m_dic_buttonRect = new Dictionary <WiimoteModel, Rectangle>();
            ReadRectsFromCsv(csv: Properties.Resources.modelRect);

            // Behavior
            m_bMgr = new BehaviorManager();
            m_bMgr.Add(new StandardBehavior());
            m_bMgr.Add(new MinecraftBehavior());

            m_dic_mouseAction = new Dictionary <string, MouseAction>
            {
                { "マウスのXを相対移動", MouseAction.MoveDx },
                { "マウスのYを相対移動", MouseAction.MoveDy },
                { "マウスのXを指定", MouseAction.MoveX },
                { "マウスのYを指定", MouseAction.MoveY },
                { "マウスのホイールを回転", MouseAction.ScrollWheel },
                { "マウスの左クリック", MouseAction.LeftClick },
                { "マウスの右クリック", MouseAction.RightClick },
                { "マウスの中クリック", MouseAction.MiddleClick }
            };

            // 装飾キーを追加
            m_dic_modKeys = new Dictionary <string, byte>
            {
                { "Shift", m_vkcodes["Shift"] },
                { "Ctrl", m_vkcodes["Ctrl"] },
                { "Alt", m_vkcodes["Alt"] },
                { "Win", m_vkcodes["LWin"] }
            };

            #region UIの初期化
            // RadioButton
            radioBtn_none.Checked    = true;
            radioBtn_JoyNone.Checked = true;

            // 設定Panel
            panel_setKeyMouse.Visible = true;
            panel_setJoystick.Visible = false;

            // Behavior
            combo_behavior.Items.AddRange(m_bMgr.GetBehaviorNames().ToArray());
            combo_behavior.SelectedIndex = 0;

            // キーボード
            combo_key.Items.AddRange(m_vkcodes.GetKeys().ToArray());

            // マウス
            combo_mouse.Items.AddRange(m_dic_mouseAction.Keys.ToArray());

            // 装飾キー
            combo_modKey.Items.AddRange(m_dic_modKeys.Keys.ToArray());

            #endregion

            LoadProfiles();

            // 詳細タブ
            listBox_models.Items.AddRange(Enum.GetNames(typeof(WiimoteModel)).Where(x => x != "_N_STICK").ToArray());
            listBox_models.SelectedIndex = 0;
        }