Implemented dynamic main menu backgrounds.

- This can be switched off in the configuration file.
- Credits: https://osu.ppy.sh/forum/t/98954

Other changes:
- Removed OsuFile setters/getters from Game state, replaced with a 'getOsuFile()' method in MusicController (a more logical location).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2014-07-02 03:02:11 -04:00
parent bcd0c23961
commit 56123363b3
9 changed files with 65 additions and 24 deletions

View File

@@ -649,6 +649,9 @@ public class Game extends BasicGameState {
@Override
public void enter(GameContainer container, StateBasedGame game)
throws SlickException {
if (restart == RESTART_NEW)
osu = MusicController.getOsuFile();
if (osu == null || osu.objects == null)
throw new RuntimeException("Running game with no OsuFile loaded.");
@@ -810,12 +813,6 @@ public class Game extends BasicGameState {
public static void setRestart(byte restart) { Game.restart = restart; }
public static byte getRestart() { return Game.restart; }
/**
* Sets or returns the associated OsuFile.
*/
public static void setOsuFile(OsuFile osu) { Game.osu = osu; }
public static OsuFile getOsuFile() { return osu; }
/**
* Returns the associated GameScore object.
*/