1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

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.Game;
using osu.Game.Overlays.Settings;
using osu.Game.Overlays.Settings.Sections.Input;
using osu.Game.Updater;
using osu.Game.Utils;
@ -97,6 +98,9 @@ namespace osu.Android
case AndroidJoystickHandler jh:
return new AndroidJoystickSettings(jh);
case AndroidTouchHandler th:
return new TouchSettings(th);
default:
return base.CreateSettingsSubsectionFor(handler);
}

View File

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

View File

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

View File

@ -1,6 +1,7 @@
// 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;
@ -22,8 +23,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
{
new PlayerCheckbox
{
LabelText = MouseSettingsStrings.DisableClicksDuringGameplay,
Current = config.GetBindable<bool>(OsuSetting.MouseDisableButtons)
// 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)
}
};
}