1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Fix escape not always handling back action correctly at main menu (back button not yet visible).

This commit is contained in:
Dean Herbert 2017-02-07 21:53:40 +09:00
parent dc5e9dde56
commit d06f0cf870
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -85,7 +85,7 @@ namespace osu.Game.Screens.Menu
Children = new[]
{
settingsButton = new Button(@"settings", @"options", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH, Key.Escape),
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH),
iconFacade = new Container //need a container to make the osu! icon flow properly.
{
Size = new Vector2(0, BUTTON_AREA_HEIGHT)
@ -140,11 +140,18 @@ namespace osu.Game.Screens.Menu
osuLogo.TriggerClick(state);
return true;
case Key.Escape:
if (State == MenuState.Initial)
return false;
switch (State)
{
case MenuState.TopLevel:
State = MenuState.Initial;
return true;
case MenuState.Play:
State = MenuState.TopLevel;
return true;
}
State = MenuState.Initial;
return true;
return false;
}
return false;