From 0f629252bc4dc35d6cf36e569d2fe8bd60d87027 Mon Sep 17 00:00:00 2001 From: "Hanno Fleischer hanno.fleischer@unibw.de" Date: Sat, 5 Oct 2024 09:01:48 +0200 Subject: [PATCH] fixed the toggle button for the victory music added the pause(gameOverMusicV) to the toggle method for the music control so that it will be paused when the music is turned off. --- .../src/main/java/pp/battleship/client/BackgroundMusic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java index 607669c5..7b497cbd 100644 --- a/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java +++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java @@ -106,7 +106,7 @@ public void pause(AudioNode audioNode) { } /** - * Toggle Method to control the music + * Toggle Method to control the music to switch it on or off */ public void toogleMusic() { this.musicEnabled = !this.musicEnabled; @@ -129,6 +129,7 @@ public void toogleMusic() { pause(menuMusic); pause(battleMusic); pause(gameOverMusicL); + pause(gameOverMusicV); } prefs.putBoolean(MUSIC_ENABLED_PREF, musicEnabled);