mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:57:38 +08:00
Disable raw input toggle on all but windows
This commit is contained in:
parent
aefd2fd847
commit
997ce397ef
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
@ -56,24 +57,32 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
rawInputToggle.ValueChanged += enabled =>
|
if (RuntimeInfo.OS != RuntimeInfo.Platform.Windows)
|
||||||
{
|
{
|
||||||
// this is temporary until we support per-handler settings.
|
rawInputToggle.Disabled = true;
|
||||||
const string raw_mouse_handler = @"OsuTKRawMouseHandler";
|
sensitivity.Bindable.Disabled = true;
|
||||||
const string standard_mouse_handler = @"OsuTKMouseHandler";
|
}
|
||||||
|
else
|
||||||
ignoredInputHandler.Value = enabled.NewValue ? standard_mouse_handler : raw_mouse_handler;
|
|
||||||
};
|
|
||||||
|
|
||||||
ignoredInputHandler = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandlers);
|
|
||||||
ignoredInputHandler.ValueChanged += handler =>
|
|
||||||
{
|
{
|
||||||
bool raw = !handler.NewValue.Contains("Raw");
|
rawInputToggle.ValueChanged += enabled =>
|
||||||
rawInputToggle.Value = raw;
|
{
|
||||||
sensitivity.Bindable.Disabled = !raw;
|
// this is temporary until we support per-handler settings.
|
||||||
};
|
const string raw_mouse_handler = @"OsuTKRawMouseHandler";
|
||||||
|
const string standard_mouse_handler = @"OsuTKMouseHandler";
|
||||||
|
|
||||||
ignoredInputHandler.TriggerChange();
|
ignoredInputHandler.Value = enabled.NewValue ? standard_mouse_handler : raw_mouse_handler;
|
||||||
|
};
|
||||||
|
|
||||||
|
ignoredInputHandler = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandlers);
|
||||||
|
ignoredInputHandler.ValueChanged += handler =>
|
||||||
|
{
|
||||||
|
bool raw = !handler.NewValue.Contains("Raw");
|
||||||
|
rawInputToggle.Value = raw;
|
||||||
|
sensitivity.Bindable.Disabled = !raw;
|
||||||
|
};
|
||||||
|
|
||||||
|
ignoredInputHandler.TriggerChange();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SensitivitySetting : SettingsSlider<double, SensitivitySlider>
|
private class SensitivitySetting : SettingsSlider<double, SensitivitySlider>
|
||||||
|
Loading…
Reference in New Issue
Block a user