mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Fix escape not working to go backwards in menus before finally exiting the game
Resolves #2596.
This commit is contained in:
parent
1eb465b4ee
commit
d109522bf7
@ -148,6 +148,8 @@ namespace osu.Game.Screens.Menu
|
||||
case Key.Space:
|
||||
logo?.TriggerOnClick(state);
|
||||
return true;
|
||||
case Key.Escape:
|
||||
return goBack();
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -158,17 +160,22 @@ namespace osu.Game.Screens.Menu
|
||||
switch (action)
|
||||
{
|
||||
case GlobalAction.Back:
|
||||
switch (State)
|
||||
{
|
||||
case MenuState.TopLevel:
|
||||
State = MenuState.Initial;
|
||||
return true;
|
||||
case MenuState.Play:
|
||||
backButton.TriggerOnClick();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return goBack();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool goBack()
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case MenuState.TopLevel:
|
||||
State = MenuState.Initial;
|
||||
return true;
|
||||
case MenuState.Play:
|
||||
backButton.TriggerOnClick();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user