mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Merge pull request #26189 from peppy/fix-escape-key-spectator-fail
Fix using "Back" binding at spectator fail screen not working
This commit is contained in:
commit
e0279920b6
@ -44,7 +44,15 @@ namespace osu.Game.Screens.Play
|
||||
/// <summary>
|
||||
/// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered.
|
||||
/// </summary>
|
||||
protected virtual Action BackAction => () => InternalButtons.LastOrDefault()?.TriggerClick();
|
||||
protected virtual Action BackAction => () =>
|
||||
{
|
||||
// We prefer triggering the button click as it will animate...
|
||||
// but sometimes buttons aren't present (see FailOverlay's constructor as an example).
|
||||
if (Buttons.Any())
|
||||
Buttons.Last().TriggerClick();
|
||||
else
|
||||
OnQuit?.Invoke();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Action that is invoked when <see cref="GlobalAction.Select"/> is triggered.
|
||||
|
@ -29,7 +29,13 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private SkinnableSound pauseLoop;
|
||||
|
||||
protected override Action BackAction => () => InternalButtons.First().TriggerClick();
|
||||
protected override Action BackAction => () =>
|
||||
{
|
||||
if (Buttons.Any())
|
||||
Buttons.First().TriggerClick();
|
||||
else
|
||||
OnResume?.Invoke();
|
||||
};
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
|
Loading…
Reference in New Issue
Block a user