mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:42:56 +08:00
Merge pull request #2600 from peppy/fix-main-menu-escape
Fix escape not working to go backwards in menus before finally exiting the game
This commit is contained in:
commit
52230d6279
@ -154,6 +154,8 @@ namespace osu.Game.Screens.Menu
|
||||
case Key.Space:
|
||||
logo?.TriggerOnClick(state);
|
||||
return true;
|
||||
case Key.Escape:
|
||||
return goBack();
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -164,17 +166,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