From 1b0e96f4115d055e1f923167e07c2232cfe146e3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Jun 2017 20:57:21 +0900 Subject: [PATCH] Fix some discrepancies when changing settings --- osu.Game/OsuGame.cs | 7 ++++++- .../Overlays/Settings/Sections/Input/MouseSettings.cs | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index dd376b4cff..7e5b913d10 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -264,8 +264,13 @@ private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args) case Key.R: if (state.Keyboard.AltPressed) { + var sensitivity = frameworkConfig.GetBindable(FrameworkSetting.CursorSensitivity); + + sensitivity.Disabled = false; + sensitivity.Value = 1; + sensitivity.Disabled = true; + frameworkConfig.Set(FrameworkSetting.ActiveInputHandlers, string.Empty); - frameworkConfig.Set(FrameworkSetting.CursorSensitivity, 1.0); return true; } break; diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index a39073811e..5ebac37cc8 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -59,12 +59,16 @@ private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) activeInputHandlers.Value = enabled ? activeInputHandlers.Value.Replace(standard_mouse_handler, raw_mouse_handler) : activeInputHandlers.Value.Replace(raw_mouse_handler, standard_mouse_handler); - - sensitivity.Bindable.Disabled = !enabled; }; activeInputHandlers = config.GetBindable(FrameworkSetting.ActiveInputHandlers); - activeInputHandlers.ValueChanged += handlers => rawInputToggle.Value = handlers.Contains("Raw"); + activeInputHandlers.ValueChanged += handlers => + { + bool raw = handlers.Contains("Raw"); + rawInputToggle.Value = raw; + sensitivity.Bindable.Disabled = !raw; + }; + activeInputHandlers.TriggerChange(); }