Merge pull request #10 from iceblade112/master

Mimic original osu! exit button: exit immediately instead of entering the exit menu.
This commit is contained in:
Jeffrey Han 2014-12-21 23:02:30 -05:00
commit 31d8b77217

View File

@ -101,6 +101,7 @@ public class MainMenu extends BasicGameState {
private float bgAlpha = 0f; private float bgAlpha = 0f;
// game-related variables // game-related variables
private GameContainer container;
private StateBasedGame game; private StateBasedGame game;
private int state; private int state;
@ -111,6 +112,7 @@ public class MainMenu extends BasicGameState {
@Override @Override
public void init(GameContainer container, StateBasedGame game) public void init(GameContainer container, StateBasedGame game)
throws SlickException { throws SlickException {
this.container = container;
this.game = game; this.game = game;
osuStartTime = System.currentTimeMillis(); osuStartTime = System.currentTimeMillis();
@ -329,7 +331,9 @@ public class MainMenu extends BasicGameState {
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black)); game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
} else if (exitButton.contains(x, y)) { } else if (exitButton.contains(x, y)) {
SoundController.playSound(SoundController.SOUND_MENUHIT); SoundController.playSound(SoundController.SOUND_MENUHIT);
game.enterState(Opsu.STATE_MAINMENUEXIT); Options.saveOptions();
Opsu.closeSocket();
container.exit();
} }
} }
} }