From a8f97d9a733bd16022ffd792f849fcbbf15bbe1a Mon Sep 17 00:00:00 2001 From: Benjamin Amos Date: Sun, 24 Oct 2021 14:20:03 +0100 Subject: [PATCH] fix: play main menu music again after exiting game --- .../ui/nui/screens/mainMenu/MainMenuScreen.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/src/main/java/org/destinationsol/ui/nui/screens/mainMenu/MainMenuScreen.java b/engine/src/main/java/org/destinationsol/ui/nui/screens/mainMenu/MainMenuScreen.java index a96468cb6..edd6666c6 100644 --- a/engine/src/main/java/org/destinationsol/ui/nui/screens/mainMenu/MainMenuScreen.java +++ b/engine/src/main/java/org/destinationsol/ui/nui/screens/mainMenu/MainMenuScreen.java @@ -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()); @@ -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); }