1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-23 17:33:09 +08:00

Merge pull request #30878 from peppy/config-pause-hold-thing-of-course

Add setting to allow hold-for-pause to still exist
This commit is contained in:
Dan Balasescu 2024-11-26 16:35:35 +09:00 committed by GitHub
commit 943837e3b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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();