Merge pull request #25399 from Susko3/mobile-touch-settings

Show touch input settings on mobile
This commit is contained in:
Dean Herbert 2023-11-10 16:25:01 +09:00 committed by GitHub
commit 7c4e9506da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 9 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Input.Handlers;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game; using osu.Game;
using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings;
using osu.Game.Overlays.Settings.Sections.Input;
using osu.Game.Updater; using osu.Game.Updater;
using osu.Game.Utils; using osu.Game.Utils;
@ -97,6 +98,9 @@ namespace osu.Android
case AndroidJoystickHandler jh: case AndroidJoystickHandler jh:
return new AndroidJoystickSettings(jh); return new AndroidJoystickSettings(jh);
case AndroidTouchHandler th:
return new TouchSettings(th);
default: default:
return base.CreateSettingsSubsectionFor(handler); return base.CreateSettingsSubsectionFor(handler);
} }

View File

@ -575,14 +575,14 @@ namespace osu.Game
case JoystickHandler jh: case JoystickHandler jh:
return new JoystickSettings(jh); return new JoystickSettings(jh);
case TouchHandler th:
return new TouchSettings(th);
} }
} }
switch (handler) switch (handler)
{ {
case TouchHandler th:
return new TouchSettings(th);
case MidiHandler: case MidiHandler:
return new InputSection.HandlerSection(handler); return new InputSection.HandlerSection(handler);

View File

@ -3,6 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Input.Handlers; using osu.Framework.Input.Handlers;
using osu.Framework.Localisation; using osu.Framework.Localisation;
@ -28,11 +29,14 @@ namespace osu.Game.Overlays.Settings.Sections.Input
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig) private void load(OsuConfigManager osuConfig)
{ {
Add(new SettingsCheckbox if (!RuntimeInfo.IsMobile) // don't allow disabling the only input method (touch) on mobile.
{ {
LabelText = CommonStrings.Enabled, Add(new SettingsCheckbox
Current = handler.Enabled {
}); LabelText = CommonStrings.Enabled,
Current = handler.Enabled
});
}
Add(new SettingsCheckbox Add(new SettingsCheckbox
{ {

View File

@ -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.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
@ -22,8 +23,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
{ {
new PlayerCheckbox new PlayerCheckbox
{ {
LabelText = MouseSettingsStrings.DisableClicksDuringGameplay, // TODO: change to touchscreen detection once https://github.com/ppy/osu/pull/25348 makes it in
Current = config.GetBindable<bool>(OsuSetting.MouseDisableButtons) LabelText = RuntimeInfo.IsDesktop ? MouseSettingsStrings.DisableClicksDuringGameplay : TouchSettingsStrings.DisableTapsDuringGameplay,
Current = config.GetBindable<bool>(RuntimeInfo.IsDesktop ? OsuSetting.MouseDisableButtons : OsuSetting.TouchDisableGameplayTaps)
} }
}; };
} }