Better emulation of main menu behavior.

- Pressing 'Esc' will now always enter the MainMenuExit state.
- Returning from MainMenuExit state does not reset button states: these must be manually reset by calling the reset() method.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2014-12-30 00:41:32 -05:00
parent 2592faec44
commit b0649541eb
3 changed files with 39 additions and 16 deletions

View File

@@ -352,6 +352,7 @@ public class SongMenu extends BasicGameState {
// back
if (Utils.getBackButton().contains(x, y)) {
SoundController.playSound(SoundController.SOUND_MENUBACK);
((MainMenu) game.getState(Opsu.STATE_MAINMENU)).reset();
game.enterState(Opsu.STATE_MAINMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
return;
}
@@ -424,6 +425,7 @@ public class SongMenu extends BasicGameState {
searchTimer = SEARCH_DELAY;
} else {
SoundController.playSound(SoundController.SOUND_MENUBACK);
((MainMenu) game.getState(Opsu.STATE_MAINMENU)).reset();
game.enterState(Opsu.STATE_MAINMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
}
break;