1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-12 20:07:22 +08:00

Add setting to allow hold-for-pause to still exist

Users have asked for this multiple times since last release.

Not sure on the best default value, but I'm going with the
stable/classic one, at least for the initial release to avoid needing
migrations.

In the future we may reconsider this for new users.
This commit is contained in:
Dean Herbert 2024-11-26 15:12:38 +09:00
parent 285959943f
commit e3ea38a366
No known key found for this signature in database
4 changed files with 19 additions and 3 deletions

View File

@ -214,6 +214,7 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.EditorContractSidebars, false);
SetDefault(OsuSetting.AlwaysShowHoldForMenuButton, false);
SetDefault(OsuSetting.AlwaysRequireHoldingForPause, false);
}
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
@ -444,5 +445,6 @@ namespace osu.Game.Configuration
EditorRotationOrigin,
EditorTimelineShowBreaks,
EditorAdjustExistingObjectsOnTimingChanges,
AlwaysRequireHoldingForPause
}
}

View File

@ -89,6 +89,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString AlwaysShowHoldForMenuButton => new TranslatableString(getKey(@"always_show_hold_for_menu_button"), @"Always show hold for menu button");
/// <summary>
/// "Require holding key to pause gameplay"
/// </summary>
public static LocalisableString AlwaysRequireHoldForMenu => new TranslatableString(getKey(@"require_holding_key_to_pause_gameplay"), @"Require holding key to pause gameplay");
/// <summary>
/// "Always play first combo break sound"
/// </summary>

View File

@ -41,6 +41,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
Current = config.GetBindable<bool>(OsuSetting.GameplayLeaderboard),
},
new SettingsCheckbox
{
LabelText = GameplaySettingsStrings.AlwaysRequireHoldForMenu,
Current = config.GetBindable<bool>(OsuSetting.AlwaysRequireHoldingForPause),
},
new SettingsCheckbox
{
LabelText = GameplaySettingsStrings.AlwaysShowHoldForMenuButton,
Current = config.GetBindable<bool>(OsuSetting.AlwaysShowHoldForMenuButton),

View File

@ -162,14 +162,18 @@ namespace osu.Game.Screens.Play.HUD
private bool pendingAnimation;
private ScheduledDelegate shakeOperation;
private Bindable<bool> alwaysRequireHold;
public HoldButton(bool isDangerousAction)
: base(isDangerousAction)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OsuColour colours, OsuConfigManager config)
{
alwaysRequireHold = config.GetBindable<bool>(OsuSetting.AlwaysRequireHoldingForPause);
Size = new Vector2(60);
Child = new CircularContainer
@ -300,7 +304,7 @@ namespace osu.Game.Screens.Play.HUD
case GlobalAction.Back:
if (!pendingAnimation)
{
if (IsDangerousAction)
if (IsDangerousAction || alwaysRequireHold.Value)
BeginConfirm();
else
Confirm();
@ -314,7 +318,7 @@ namespace osu.Game.Screens.Play.HUD
if (!pendingAnimation)
{
if (IsDangerousAction)
if (IsDangerousAction || alwaysRequireHold.Value)
BeginConfirm();
else
Confirm();