Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new input handlers not being enabled by default #2389

Merged
merged 7 commits into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osu-framework
Submodule osu-framework updated 459 files
2 changes: 1 addition & 1 deletion osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public bool OnPressed(GlobalAction action)
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:
Expand Down
14 changes: 6 additions & 8 deletions osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MouseSettings : SettingsSubsection
protected override string Header => "Mouse";

private readonly BindableBool rawInputToggle = new BindableBool();
private Bindable<string> activeInputHandlers;
private Bindable<string> ignoredInputHandler;
private SensitivitySetting sensitivity;

[BackgroundDependencyLoader]
Expand Down Expand Up @@ -61,20 +61,18 @@ private void load(OsuConfigManager osuConfig, FrameworkConfigManager config)
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>
Expand Down