Added toggle for always playing music

This commit is contained in:
Anuken
2024-07-05 21:42:23 -04:00
parent 76e24f7edc
commit 04ec2c0603
4 changed files with 9 additions and 3 deletions

View File

@@ -164,8 +164,11 @@ public class SoundControl{
//this just fades out the last track to make way for ingame music
silence();
//play music at intervals
if(Time.timeSinceMillis(lastPlayed) > 1000 * musicInterval / 60f){
if(Core.settings.getBool("alwaysmusic")){
if(current == null){
playRandom();
}
}else if(Time.timeSinceMillis(lastPlayed) > 1000 * musicInterval / 60f){
//chance to play it per interval
if(Mathf.chance(musicChance)){
lastPlayed = Time.millis();

View File

@@ -297,6 +297,7 @@ public class SettingsMenuDialog extends BaseDialog{
}
void addSettings(){
sound.checkPref("alwaysmusic", false);
sound.sliderPref("musicvol", 100, 0, 100, 1, i -> i + "%");
sound.sliderPref("sfxvol", 100, 0, 100, 1, i -> i + "%");
sound.sliderPref("ambientvol", 100, 0, 100, 1, i -> i + "%");