mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:07:52 +08:00
Use touch detection for input settings
Intentionally not dynamically updating because it would complicate things, and doesn't bring any benefits to this ephemeral screen.
This commit is contained in:
parent
f0364f01ea
commit
83e1eea1ad
@ -1,7 +1,6 @@
|
||||
// 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.
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Configuration;
|
||||
@ -17,15 +16,16 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load(OsuConfigManager config, SessionStatics sessionStatics)
|
||||
{
|
||||
bool touchActive = sessionStatics.Get<bool>(Static.TouchInputActive);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new PlayerCheckbox
|
||||
{
|
||||
// TODO: change to touchscreen detection once https://github.com/ppy/osu/pull/25348 makes it in
|
||||
LabelText = RuntimeInfo.IsDesktop ? MouseSettingsStrings.DisableClicksDuringGameplay : TouchSettingsStrings.DisableTapsDuringGameplay,
|
||||
Current = config.GetBindable<bool>(RuntimeInfo.IsDesktop ? OsuSetting.MouseDisableButtons : OsuSetting.TouchDisableGameplayTaps)
|
||||
LabelText = touchActive ? TouchSettingsStrings.DisableTapsDuringGameplay : MouseSettingsStrings.DisableClicksDuringGameplay,
|
||||
Current = config.GetBindable<bool>(touchActive ? OsuSetting.TouchDisableGameplayTaps : OsuSetting.MouseDisableButtons)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user