1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 21:13:01 +08:00

Add settings for toggling raw input and adjusting sensitivity

This commit is contained in:
Dean Herbert 2017-06-02 20:24:18 +09:00
parent 900e3ce3e2
commit edead2ad3a

View File

@ -14,9 +14,24 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
protected override string Header => "Mouse";
private readonly BindableBool rawInputToggle = new BindableBool();
private Bindable<string> activeInputHandlers;
[BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
{
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
rawInputToggle.Value = activeInputHandlers.Value.Contains("Raw");
rawInputToggle.ValueChanged += enabled =>
{
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);
};
Children = new Drawable[]
{
new SettingsEnumDropdown<ConfineMouseMode>
@ -34,6 +49,16 @@ namespace osu.Game.Overlays.Settings.Sections.Input
LabelText = "Disable mouse buttons during gameplay",
Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
},
new SettingsCheckbox
{
LabelText = "Raw Input",
Bindable = rawInputToggle
},
new SettingsSlider<double, SensitivitySlider>
{
LabelText = "Cursor Sensitivity",
Bindable = config.GetBindable<double>(FrameworkSetting.CursorSensitivity)
}
};
}
@ -42,4 +67,4 @@ namespace osu.Game.Overlays.Settings.Sections.Input
public override string TooltipText => Current.Value.ToString(@"0.##x");
}
}
}
}