mirror of
https://github.com/ppy/osu.git
synced 2024-09-21 17:27:24 +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.
|
// 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.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -17,15 +16,16 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config, SessionStatics sessionStatics)
|
||||||
{
|
{
|
||||||
|
bool touchActive = sessionStatics.Get<bool>(Static.TouchInputActive);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new PlayerCheckbox
|
new PlayerCheckbox
|
||||||
{
|
{
|
||||||
// TODO: change to touchscreen detection once https://github.com/ppy/osu/pull/25348 makes it in
|
LabelText = touchActive ? TouchSettingsStrings.DisableTapsDuringGameplay : MouseSettingsStrings.DisableClicksDuringGameplay,
|
||||||
LabelText = RuntimeInfo.IsDesktop ? MouseSettingsStrings.DisableClicksDuringGameplay : TouchSettingsStrings.DisableTapsDuringGameplay,
|
Current = config.GetBindable<bool>(touchActive ? OsuSetting.TouchDisableGameplayTaps : OsuSetting.MouseDisableButtons)
|
||||||
Current = config.GetBindable<bool>(RuntimeInfo.IsDesktop ? OsuSetting.MouseDisableButtons : OsuSetting.TouchDisableGameplayTaps)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user