From 83e1eea1adb2f376e5b7e5802c056bd6398bf60e Mon Sep 17 00:00:00 2001 From: Susko3 Date: Mon, 4 Dec 2023 20:10:12 +0100 Subject: [PATCH] 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. --- osu.Game/Screens/Play/PlayerSettings/InputSettings.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs b/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs index 1387e01305..e71e7dd990 100644 --- a/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/InputSettings.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . 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(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(RuntimeInfo.IsDesktop ? OsuSetting.MouseDisableButtons : OsuSetting.TouchDisableGameplayTaps) + LabelText = touchActive ? TouchSettingsStrings.DisableTapsDuringGameplay : MouseSettingsStrings.DisableClicksDuringGameplay, + Current = config.GetBindable(touchActive ? OsuSetting.TouchDisableGameplayTaps : OsuSetting.MouseDisableButtons) } }; }