コード例 #1
0
        private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
        {
            Children = new Drawable[]
            {
                new SettingsCheckbox
                {
                    LabelText = "Raw Input",
                    Bindable  = rawInputToggle
                },
                sensitivity = new SensitivitySetting
                {
                    LabelText = "Cursor Sensitivity",
                    Bindable  = config.GetBindable <double>(FrameworkSetting.CursorSensitivity)
                },
                new SettingsCheckbox
                {
                    LabelText = "Map absolute input to window",
                    Bindable  = config.GetBindable <bool>(FrameworkSetting.MapAbsoluteInputToWindow)
                },
                new SettingsEnumDropdown <ConfineMouseMode>
                {
                    LabelText = "Confine mouse cursor to window",
                    Bindable  = config.GetBindable <ConfineMouseMode>(FrameworkSetting.ConfineMouseMode),
                },
                new SettingsCheckbox
                {
                    LabelText = "Disable mouse wheel during gameplay",
                    Bindable  = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel)
                },
                new SettingsCheckbox
                {
                    LabelText = "Disable mouse buttons during gameplay",
                    Bindable  = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons)
                },
            };

            rawInputToggle.ValueChanged += enabled =>
            {
                // this is temporary until we support per-handler settings.
                const string raw_mouse_handler      = @"OpenTKRawMouseHandler";
                const string standard_mouse_handler = @"OpenTKMouseHandler";

                activeInputHandlers.Value = enabled ?
                                            activeInputHandlers.Value.Replace(standard_mouse_handler, raw_mouse_handler) :
                                            activeInputHandlers.Value.Replace(raw_mouse_handler, standard_mouse_handler);
            };

            activeInputHandlers = config.GetBindable <string>(FrameworkSetting.ActiveInputHandlers);
            activeInputHandlers.ValueChanged += handlers =>
            {
                bool raw = handlers.Contains("Raw");
                rawInputToggle.Value          = raw;
                sensitivity.Bindable.Disabled = !raw;
            };

            activeInputHandlers.TriggerChange();
        }
コード例 #2
0
        private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
        {
            Children = new Drawable[]
            {
                new SettingsCheckbox
                {
                    LabelText = "绝对输入(在Linux上有问题)",
                    Bindable  = rawInputToggle
                },
                sensitivity = new SensitivitySetting
                {
                    LabelText = "光标灵敏度",
                    Bindable  = config.GetBindable <double>(FrameworkSetting.CursorSensitivity)
                },
                new SettingsCheckbox
                {
                    LabelText = "绝对坐标只映射在osu!窗口中",
                    Bindable  = config.GetBindable <bool>(FrameworkSetting.MapAbsoluteInputToWindow)
                },
                new SettingsEnumDropdown <ConfineMouseMode>
                {
                    LabelText = "光标边界",
                    Bindable  = config.GetBindable <ConfineMouseMode>(FrameworkSetting.ConfineMouseMode),
                },
                new SettingsCheckbox
                {
                    LabelText = "在游戏中禁用鼠标滚轮",
                    Bindable  = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel)
                },
                new SettingsCheckbox
                {
                    LabelText = "在游戏中禁用鼠标按键",
                    Bindable  = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons)
                },
            };

            rawInputToggle.ValueChanged += enabled =>
            {
                // this is temporary until we support per-handler settings.
                const string raw_mouse_handler      = @"OsuTKRawMouseHandler";
                const string standard_mouse_handler = @"OsuTKMouseHandler";

                ignoredInputHandler.Value = enabled.NewValue ? standard_mouse_handler : raw_mouse_handler;
            };

            ignoredInputHandler = config.GetBindable <string>(FrameworkSetting.IgnoredInputHandlers);
            ignoredInputHandler.ValueChanged += handler =>
            {
                bool raw = !handler.NewValue.Contains("Raw");
                rawInputToggle.Value          = raw;
                sensitivity.Bindable.Disabled = !raw;
            };

            ignoredInputHandler.TriggerChange();
        }
コード例 #3
0
 public static void SetAccelerometerSensitivity(SensitivitySetting sensitivity)
 {
     if (sensitivity == SensitivitySetting.High)
     {
         instance.m_rollRange = 0.1f;
         instance.m_tiltRange = 0.08f;
     }
     else if (sensitivity == SensitivitySetting.Medium)
     {
         instance.m_rollRange = 0.2f;
         instance.m_tiltRange = 0.15f;
     }
     else if (sensitivity == SensitivitySetting.Low)
     {
         instance.m_rollRange = 0.3f;
         instance.m_tiltRange = 0.2f;
     }
 }
コード例 #4
0
    public static void LoadPlayerPrefs()
    {
        m_invertX     = (OnOffSetting)PlayerPrefs.GetInt("InvertX", 2);
        m_invertY     = (OnOffSetting)PlayerPrefs.GetInt("InvertY", 2);
        m_music       = (OnOffSetting)PlayerPrefs.GetInt("MusicOn", 1);
        m_sound       = (OnOffSetting)PlayerPrefs.GetInt("SoundOn", 1);
        m_sensitivity = (SensitivitySetting)PlayerPrefs.GetInt("Sensitivity", 2);
        float centerRoll = PlayerPrefs.GetFloat("CenterRoll", 0f);
        float centerTilt = PlayerPrefs.GetFloat("CenterTilt", -0.60f);

        //	print("load cent "+centerRoll+" "+centerTilt);
        InputManager.SetCenter(centerRoll, centerTilt);
        InputManager.SetAccelerometerSensitivity(m_sensitivity);

        bool music_enabled = m_music == OnOffSetting.On;

        MusicManager.SetEnabled(music_enabled);

        bool sound_enabled = m_sound == OnOffSetting.On;

        SoundManager.SetEnabled(sound_enabled);
    }
コード例 #5
0
 public static void SetSensitivity(SensitivitySetting new_sensitivity)
 {
     m_sensitivity = new_sensitivity;
     InputManager.SetAccelerometerSensitivity(new_sensitivity);
 }
コード例 #6
0
ファイル: MouseSettings.cs プロジェクト: gpsbird/osu-1
        private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
        {
            Children = new Drawable[]
            {
                new SettingsCheckbox
                {
                    LabelText = "Raw input",
                    Bindable  = rawInputToggle
                },
                sensitivity = new SensitivitySetting
                {
                    LabelText = "Cursor sensitivity",
                    Bindable  = config.GetBindable <double>(FrameworkSetting.CursorSensitivity)
                },
                new SettingsCheckbox
                {
                    LabelText = "Map absolute input to window",
                    Bindable  = config.GetBindable <bool>(FrameworkSetting.MapAbsoluteInputToWindow)
                },
                new SettingsEnumDropdown <ConfineMouseMode>
                {
                    LabelText = "Confine mouse cursor to window",
                    Bindable  = config.GetBindable <ConfineMouseMode>(FrameworkSetting.ConfineMouseMode),
                },
                new SettingsCheckbox
                {
                    LabelText = "Disable mouse wheel during gameplay",
                    Bindable  = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel)
                },
                new SettingsCheckbox
                {
                    LabelText = "Disable mouse buttons during gameplay",
                    Bindable  = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons)
                },
            };

            if (RuntimeInfo.OS != RuntimeInfo.Platform.Windows)
            {
                rawInputToggle.Disabled       = true;
                sensitivity.Bindable.Disabled = true;
            }
            else
            {
                rawInputToggle.ValueChanged += enabled =>
                {
                    // this is temporary until we support per-handler settings.
                    const string raw_mouse_handler      = @"OsuTKRawMouseHandler";
                    const string standard_mouse_handler = @"OsuTKMouseHandler";

                    ignoredInputHandler.Value = enabled.NewValue ? standard_mouse_handler : raw_mouse_handler;
                };

                ignoredInputHandler = config.GetBindable <string>(FrameworkSetting.IgnoredInputHandlers);
                ignoredInputHandler.ValueChanged += handler =>
                {
                    bool raw = !handler.NewValue.Contains("Raw");
                    rawInputToggle.Value          = raw;
                    sensitivity.Bindable.Disabled = !raw;
                };

                ignoredInputHandler.TriggerChange();
            }
        }