fixed BackgroundMusic
before play a new music, the volume prefences should be set
This commit is contained in:
@@ -181,6 +181,7 @@ private void gameMusic() {
|
|||||||
if (isEnabled() && gameMusic != null) {
|
if (isEnabled() && gameMusic != null) {
|
||||||
stopAll();
|
stopAll();
|
||||||
LOGGER.log(Level.INFO, "Playing game music"); //NON-NLS
|
LOGGER.log(Level.INFO, "Playing game music"); //NON-NLS
|
||||||
|
PREFERENCES.putFloat(VOLUME_PREF, volume);
|
||||||
gameMusic.play();
|
gameMusic.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,6 +193,7 @@ private void victoryMusic() {
|
|||||||
if (isEnabled() && victoryMusic != null) {
|
if (isEnabled() && victoryMusic != null) {
|
||||||
stopAll();
|
stopAll();
|
||||||
LOGGER.log(Level.INFO, "Playing victory music"); //NON-NLS
|
LOGGER.log(Level.INFO, "Playing victory music"); //NON-NLS
|
||||||
|
PREFERENCES.putFloat(VOLUME_PREF, volume);
|
||||||
victoryMusic.play();
|
victoryMusic.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,6 +205,7 @@ private void defeatMusic() {
|
|||||||
if (isEnabled() && defeatMusic != null) {
|
if (isEnabled() && defeatMusic != null) {
|
||||||
stopAll();
|
stopAll();
|
||||||
LOGGER.log(Level.INFO, "Playing defeat music"); //NON-NLS
|
LOGGER.log(Level.INFO, "Playing defeat music"); //NON-NLS
|
||||||
|
PREFERENCES.putFloat(VOLUME_PREF, volume);
|
||||||
defeatMusic.play();
|
defeatMusic.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user