1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

ActiveInputHandlers -> IgnoredInputHandler

This commit is contained in:
TocoToucan 2018-04-12 17:06:35 +03:00
parent 3de460f84c
commit 7c3441e2d0
2 changed files with 7 additions and 9 deletions

View File

@ -439,7 +439,7 @@ namespace osu.Game
sensitivity.Value = 1;
sensitivity.Disabled = true;
frameworkConfig.Set(FrameworkSetting.ActiveInputHandlers, string.Empty);
frameworkConfig.Set(FrameworkSetting.IgnoredInputHandler, string.Empty);
frameworkConfig.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode).SetDefault();
return true;
case GlobalAction.ToggleToolbar:

View File

@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
protected override string Header => "Mouse";
private readonly BindableBool rawInputToggle = new BindableBool();
private Bindable<string> activeInputHandlers;
private Bindable<string> ignoredInputHandler;
private SensitivitySetting sensitivity;
[BackgroundDependencyLoader]
@ -61,20 +61,18 @@ namespace osu.Game.Overlays.Settings.Sections.Input
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);
ignoredInputHandler.Value = enabled ? standard_mouse_handler : raw_mouse_handler;
};
activeInputHandlers = config.GetBindable<string>(FrameworkSetting.ActiveInputHandlers);
activeInputHandlers.ValueChanged += handlers =>
ignoredInputHandler = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandler);
ignoredInputHandler.ValueChanged += handler =>
{
bool raw = handlers.Contains("Raw");
bool raw = !handler.Contains("Raw");
rawInputToggle.Value = raw;
sensitivity.Bindable.Disabled = !raw;
};
activeInputHandlers.TriggerChange();
ignoredInputHandler.TriggerChange();
}
private class SensitivitySetting : SettingsSlider<double, SensitivitySlider>