1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Merge pull request #2389 from UselessToucan/ignored_input_handler

Fix new input handlers not being enabled by default
This commit is contained in:
Dan Balasescu 2018-04-13 22:36:04 +09:00 committed by GitHub
commit f59eef072d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 10 deletions

@ -1 +1 @@
Subproject commit 02d7a0fa4798d197cd08570ee48951edbb7c7860
Subproject commit eb6362eaf1317b0fa27b2c9e559bd9a0f1ce357c

View File

@ -439,7 +439,7 @@ namespace osu.Game
sensitivity.Value = 1;
sensitivity.Disabled = true;
frameworkConfig.Set(FrameworkSetting.ActiveInputHandlers, string.Empty);
frameworkConfig.Set(FrameworkSetting.IgnoredInputHandlers, 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.IgnoredInputHandlers);
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>