1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 07:22:54 +08:00

Don't show buttons on fail overlay when player interaction is disabled

This commit is contained in:
Dean Herbert 2023-11-22 17:53:06 +09:00 committed by Bartłomiej Dach
parent 98ab9853ce
commit a4be28a2ae
No known key found for this signature in database
2 changed files with 14 additions and 3 deletions

View File

@ -26,11 +26,22 @@ namespace osu.Game.Screens.Play
public override LocalisableString Header => GameplayMenuOverlayStrings.FailedHeader;
private readonly bool showButtons;
public FailOverlay(bool showButtons = true)
{
this.showButtons = showButtons;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AddButton(GameplayMenuOverlayStrings.Retry, colours.YellowDark, () => OnRetry?.Invoke());
AddButton(GameplayMenuOverlayStrings.Quit, new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
if (showButtons)
{
AddButton(GameplayMenuOverlayStrings.Retry, colours.YellowDark, () => OnRetry?.Invoke());
AddButton(GameplayMenuOverlayStrings.Quit, new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
}
// from #10339 maybe this is a better visual effect
Add(new Container
{

View File

@ -267,7 +267,7 @@ namespace osu.Game.Screens.Play
createGameplayComponents(Beatmap.Value)
}
},
FailOverlay = new FailOverlay
FailOverlay = new FailOverlay(Configuration.AllowUserInteraction)
{
SaveReplay = async () => await prepareAndImportScoreAsync(true).ConfigureAwait(false),
OnRetry = () => Restart(),