Skip to content

Commit

Permalink
fix: play main menu music again after exiting game
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminAmos committed Nov 5, 2021
1 parent 0d17b5b commit a8f97d9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public class MainMenuScreen extends NUIScreenLayer {

@Override
public void initialise() {
final OggMusicManager musicManager = solApplication.getMusicManager();
if (!musicManager.getCurrentMusicSet().equals(OggMusicManager.MENU_MUSIC_SET)) {
musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, solApplication.getOptions());
}

tutorialButton = find("tutorialButton", UIButton.class);
tutorialButton.subscribe(button -> {
solApplication.getMenuScreens().loading.setMode(true, "Imperial Small", true, new WorldConfig());
Expand Down Expand Up @@ -75,6 +70,11 @@ public void initialise() {

@Override
public void onAdded() {
final OggMusicManager musicManager = solApplication.getMusicManager();
if (!musicManager.getCurrentMusicSet().equals(OggMusicManager.MENU_MUSIC_SET)) {
musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, solApplication.getOptions());
}

tutorialButton.setEnabled(solApplication.getOptions().controlType != GameOptions.ControlType.CONTROLLER);
}

Expand Down

0 comments on commit a8f97d9

Please sign in to comment.