mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 05:22:54 +08:00
Fix using "Back" binding at spectator fail screen not working
This commit is contained in:
parent
0fc86a07cb
commit
e1a376c0a7
@ -44,7 +44,15 @@ namespace osu.Game.Screens.Play
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered.
|
/// Action that is invoked when <see cref="GlobalAction.Back"/> is triggered.
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Action that is invoked when <see cref="GlobalAction.Select"/> is triggered.
|
/// Action that is invoked when <see cref="GlobalAction.Select"/> is triggered.
|
||||||
|
@ -29,7 +29,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private SkinnableSound pauseLoop;
|
private SkinnableSound pauseLoop;
|
||||||
|
|
||||||
protected override Action BackAction => () => InternalButtons.First().TriggerClick();
|
protected override Action BackAction => () =>
|
||||||
|
{
|
||||||
|
if (Buttons.Any())
|
||||||
|
Buttons.First().TriggerClick();
|
||||||
|
else
|
||||||
|
OnResume?.Invoke();
|
||||||
|
};
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
|
Loading…
Reference in New Issue
Block a user