mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Add setting for disabling background music
This commit is contained in:
@@ -63,6 +63,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
||||
UI_PREFERRED_AVATARS_ONLY ("false"),
|
||||
UI_TARGETING_OVERLAY ("false"),
|
||||
UI_ENABLE_SOUNDS ("true"),
|
||||
UI_ENABLE_MUSIC ("true"),
|
||||
UI_ALT_SOUND_SYSTEM ("false"),
|
||||
UI_CURRENT_AI_PROFILE (AiProfileUtil.AI_PROFILE_RANDOM_MATCH),
|
||||
UI_CLONE_MODE_SOURCE ("false"), /** */
|
||||
|
||||
@@ -168,14 +168,16 @@ public class SoundSystem {
|
||||
changeBackgroundTrack();
|
||||
}
|
||||
|
||||
private void changeBackgroundTrack() {
|
||||
public void changeBackgroundTrack() {
|
||||
//ensure old track stopped and disposed of if needed
|
||||
if (currentTrack != null) {
|
||||
currentTrack.dispose();
|
||||
currentTrack = null;
|
||||
}
|
||||
|
||||
if (currentPlaylist == null) { return; }
|
||||
if (currentPlaylist == null || !FModel.getPreferences().getPrefBoolean(FPref.UI_ENABLE_MUSIC)) {
|
||||
return;
|
||||
}
|
||||
|
||||
String filename = currentPlaylist.getRandomFilename();
|
||||
if (filename == null) { return; }
|
||||
|
||||
Reference in New Issue
Block a user