2023-01-24 12:37:12 +08:00
|
|
|
// 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 System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Framework.Allocation;
|
2023-11-05 19:40:06 +08:00
|
|
|
using osu.Framework.Input.Handlers;
|
2023-01-24 12:37:12 +08:00
|
|
|
using osu.Framework.Localisation;
|
2023-11-05 19:40:06 +08:00
|
|
|
using osu.Game.Configuration;
|
2023-01-24 12:37:12 +08:00
|
|
|
using osu.Game.Localisation;
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings.Sections.Input
|
|
|
|
{
|
2023-11-05 19:40:06 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Touch input settings subsection common to all touch handlers (even on different platforms).
|
|
|
|
/// </summary>
|
2023-01-24 12:37:12 +08:00
|
|
|
public partial class TouchSettings : SettingsSubsection
|
|
|
|
{
|
2023-11-05 19:40:06 +08:00
|
|
|
private readonly InputHandler handler;
|
2023-01-24 12:37:12 +08:00
|
|
|
|
2023-11-05 19:40:06 +08:00
|
|
|
protected override LocalisableString Header => TouchSettingsStrings.Touch;
|
|
|
|
|
|
|
|
public TouchSettings(InputHandler handler)
|
2023-01-24 12:37:12 +08:00
|
|
|
{
|
|
|
|
this.handler = handler;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2023-11-05 19:40:06 +08:00
|
|
|
private void load(OsuConfigManager osuConfig)
|
2023-01-24 12:37:12 +08:00
|
|
|
{
|
2023-11-07 20:06:14 +08:00
|
|
|
Add(new SettingsCheckbox
|
2023-01-24 12:37:12 +08:00
|
|
|
{
|
2023-11-07 20:06:14 +08:00
|
|
|
LabelText = CommonStrings.Enabled,
|
|
|
|
Current = handler.Enabled
|
|
|
|
});
|
2023-11-05 19:40:06 +08:00
|
|
|
|
|
|
|
Add(new SettingsCheckbox
|
|
|
|
{
|
|
|
|
LabelText = TouchSettingsStrings.DisableTapsDuringGameplay,
|
2023-11-07 07:13:46 +08:00
|
|
|
Current = osuConfig.GetBindable<bool>(OsuSetting.TouchDisableGameplayTaps)
|
2023-11-05 19:40:06 +08:00
|
|
|
});
|
2023-01-24 12:37:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public override IEnumerable<LocalisableString> FilterTerms => base.FilterTerms.Concat(new LocalisableString[] { @"touchscreen" });
|
|
|
|
}
|
|
|
|
}
|