From 6e0a93b74d54c7e60df619cc41f6a05a031dcd20 Mon Sep 17 00:00:00 2001 From: "Hanno Fleischer hanno.fleischer@unibw.de" Date: Thu, 3 Oct 2024 17:56:12 +0200 Subject: [PATCH] fixed toggleMusic in BackgroundMusic.java changed the Preference save form volume to the boolean musicenable --- .../src/main/java/pp/battleship/client/BackgroundMusic.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 262b9150..972b6c2c 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 @@ -30,7 +30,7 @@ public BackgroundMusic(Application app, String musicFilePath) { backgroundMusic = new AudioNode(app.getAssetManager(), musicFilePath, DataType.Stream); backgroundMusic.setLooping(true); backgroundMusic.setPositional(false); - backgroundMusic.setVolume(1.0f); + backgroundMusic.setVolume(volume); if(musicEnabled) { play(); @@ -66,7 +66,7 @@ public void toogleMusic() { stop(); } - prefs.putFloat(VOLUME_PREF, volume); + prefs.putBoolean(VOLUME_PREF, musicEnabled); } /**