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

@@ -176,6 +176,7 @@ public class GameRanking extends BasicGameState {
game.enterState(Opsu.STATE_GAME, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
} else if (exitButton.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));
} else if (Utils.getBackButton().contains(x, y)) {
MusicController.pause();