1
0
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:
Dean Herbert 2018-05-22 18:58:48 +09:00 committed by GitHub
commit 52230d6279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}