fixed BackgroundMusic

before play a new music, the volume prefences should be set
This commit is contained in:
Daniel Grigencha
2024-10-09 16:56:38 +02:00
parent a44cbf2a72
commit 28ba183b84

View File

@@ -181,6 +181,7 @@ private void gameMusic() {
if (isEnabled() && gameMusic != null) {
stopAll();
LOGGER.log(Level.INFO, "Playing game music"); //NON-NLS
PREFERENCES.putFloat(VOLUME_PREF, volume);
gameMusic.play();
}
}
@@ -192,6 +193,7 @@ private void victoryMusic() {
if (isEnabled() && victoryMusic != null) {
stopAll();
LOGGER.log(Level.INFO, "Playing victory music"); //NON-NLS
PREFERENCES.putFloat(VOLUME_PREF, volume);
victoryMusic.play();
}
}
@@ -203,6 +205,7 @@ private void defeatMusic() {
if (isEnabled() && defeatMusic != null) {
stopAll();
LOGGER.log(Level.INFO, "Playing defeat music"); //NON-NLS
PREFERENCES.putFloat(VOLUME_PREF, volume);
defeatMusic.play();
}
}