fixed toggleMusic in BackgroundMusic.java
changed the Preference save form volume to the boolean musicenable
This commit is contained in:
parent
d471f524d0
commit
6e0a93b74d
@@ -30,7 +30,7 @@ public BackgroundMusic(Application app, String musicFilePath) {
|
|||||||
backgroundMusic = new AudioNode(app.getAssetManager(), musicFilePath, DataType.Stream);
|
backgroundMusic = new AudioNode(app.getAssetManager(), musicFilePath, DataType.Stream);
|
||||||
backgroundMusic.setLooping(true);
|
backgroundMusic.setLooping(true);
|
||||||
backgroundMusic.setPositional(false);
|
backgroundMusic.setPositional(false);
|
||||||
backgroundMusic.setVolume(1.0f);
|
backgroundMusic.setVolume(volume);
|
||||||
|
|
||||||
if(musicEnabled) {
|
if(musicEnabled) {
|
||||||
play();
|
play();
|
||||||
@@ -66,7 +66,7 @@ public void toogleMusic() {
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
prefs.putFloat(VOLUME_PREF, volume);
|
prefs.putBoolean(VOLUME_PREF, musicEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user