Fix some discrepancies when changing settings

This commit is contained in:
Dean Herbert 2017-06-08 20:57:21 +09:00
parent 72cbf76a48
commit 1b0e96f411
2 changed files with 13 additions and 4 deletions

View File

@ -264,8 +264,13 @@ private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args)
case Key.R:
if (state.Keyboard.AltPressed)
{
var sensitivity = frameworkConfig.GetBindable<double>(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;

View File

@ -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<string>(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();
}