Add on-screen display support for RawInput and CursorSensitivity

Also allows resetting both at once using Ctrl+Alt+R.

- Depends on https://github.com/ppy/osu-framework/pull/807
This commit is contained in:
Dean Herbert
2017-06-08 17:58:28 +09:00
parent 067a5a2401
commit 028364b2d9
3 changed files with 23 additions and 5 deletions

View File

@ -125,6 +125,14 @@ namespace osu.Game.Overlays
trackSetting(frameworkConfig.GetBindable<int>(FrameworkSetting.Width), v => displayResolution());
trackSetting(frameworkConfig.GetBindable<int>(FrameworkSetting.Height), v => displayResolution());
trackSetting(frameworkConfig.GetBindable<double>(FrameworkSetting.CursorSensitivity), v => display(v, "Cursor Sensitivity", v.ToString(@"0.##x"), "Ctrl+Alt+R to reset"));
trackSetting(frameworkConfig.GetBindable<string>(FrameworkSetting.ActiveInputHandlers),
delegate (string v)
{
bool raw = v.Contains("Raw");
display(raw, "Raw Input", raw ? "enabled" : "disabled", "Ctrl+Alt+R to reset");
});
trackSetting(frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter"));
}

View File

@ -21,9 +21,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
[BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
{
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
rawInputToggle.Value = activeInputHandlers.Value.Contains("Raw");
Children = new Drawable[]
{
new SettingsCheckbox
@ -66,7 +63,9 @@ namespace osu.Game.Overlays.Settings.Sections.Input
sensitivity.Bindable.Disabled = !enabled;
};
rawInputToggle.TriggerChange();
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
activeInputHandlers.ValueChanged += handlers => rawInputToggle.Value = handlers.Contains("Raw");
activeInputHandlers.TriggerChange();
}
private class SensitivitySetting : SettingsSlider<double, SensitivitySlider>