mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Change "hold for menu" button to only show for touch by default
This commit is contained in:
parent
24a0a3c47f
commit
005b1038a3
@ -205,6 +205,8 @@ namespace osu.Game.Configuration
|
||||
|
||||
SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true);
|
||||
SetDefault(OsuSetting.EditorTimelineShowTicks, true);
|
||||
|
||||
SetDefault(OsuSetting.AlwaysShowHoldForMenuButton, false);
|
||||
}
|
||||
|
||||
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
|
||||
@ -429,5 +431,6 @@ namespace osu.Game.Configuration
|
||||
HideCountryFlags,
|
||||
EditorTimelineShowTimingChanges,
|
||||
EditorTimelineShowTicks,
|
||||
AlwaysShowHoldForMenuButton
|
||||
}
|
||||
}
|
||||
|
@ -84,6 +84,11 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString AlwaysShowGameplayLeaderboard => new TranslatableString(getKey(@"gameplay_leaderboard"), @"Always show gameplay leaderboard");
|
||||
|
||||
/// <summary>
|
||||
/// "Always show hold for menu button"
|
||||
/// </summary>
|
||||
public static LocalisableString AlwaysShowHoldForMenuButton => new TranslatableString(getKey(@"always_show_hold_for_menu_button"), @"Always show hold for menu button");
|
||||
|
||||
/// <summary>
|
||||
/// "Always play first combo break sound"
|
||||
/// </summary>
|
||||
|
@ -41,6 +41,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
||||
Current = config.GetBindable<bool>(OsuSetting.GameplayLeaderboard),
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = GameplaySettingsStrings.AlwaysShowHoldForMenuButton,
|
||||
Current = config.GetBindable<bool>(OsuSetting.AlwaysShowHoldForMenuButton),
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
ClassicDefault = false,
|
||||
LabelText = GameplaySettingsStrings.ShowHealthDisplayWhenCantFail,
|
||||
|
@ -40,6 +40,10 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
private OsuSpriteText text;
|
||||
|
||||
private Bindable<bool> alwaysShow;
|
||||
|
||||
public override bool PropagatePositionalInputSubTree => alwaysShow.Value || touchActive.Value;
|
||||
|
||||
public HoldForMenuButton()
|
||||
{
|
||||
Direction = FillDirection.Horizontal;
|
||||
@ -50,7 +54,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(Player player)
|
||||
private void load(Player player, OsuConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -71,6 +75,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
};
|
||||
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
alwaysShow = config.GetBindable<bool>(OsuSetting.AlwaysShowHoldForMenuButton);
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
@ -119,7 +125,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
if (text.Alpha > 0 || button.Progress.Value > 0 || button.IsHovered)
|
||||
Alpha = 1;
|
||||
else
|
||||
else if (touchActive.Value)
|
||||
Alpha = 0.08f;
|
||||
else if (alwaysShow.Value)
|
||||
{
|
||||
float minAlpha = touchActive.Value ? .08f : 0;
|
||||
|
||||
@ -127,6 +135,10 @@ namespace osu.Game.Screens.Play.HUD
|
||||
Math.Clamp(Clock.ElapsedFrameTime, 0, 200),
|
||||
Alpha, Math.Clamp(1 - positionalAdjust, minAlpha, 1), 0, 200, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alpha = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private partial class HoldButton : HoldToConfirmContainer, IKeyBindingHandler<GlobalAction>
|
||||
|
Loading…
Reference in New Issue
Block a user