mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-12-22 23:44:00 +07:00
Added toggle for always playing music
This commit is contained in:
parent
76e24f7edc
commit
04ec2c0603
@ -1136,6 +1136,8 @@ category.items = Items
|
||||
category.crafting = Input/Output
|
||||
category.function = Function
|
||||
category.optional = Optional Enhancements
|
||||
setting.alwaysmusic.name = Always Play Music
|
||||
setting.alwaysmusic.description = When enabled, music will always play on loop in-game.\nWhen disabled, it only plays at random intervals.
|
||||
setting.skipcoreanimation.name = Skip Core Launch/Land Animation
|
||||
setting.landscape.name = Lock Landscape
|
||||
setting.shadows.name = Shadows
|
||||
|
@ -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();
|
||||
|
@ -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 + "%");
|
||||
|
@ -25,4 +25,4 @@ org.gradle.caching=true
|
||||
#used for slow jitpack builds; TODO see if this actually works
|
||||
org.gradle.internal.http.socketTimeout=100000
|
||||
org.gradle.internal.http.connectionTimeout=100000
|
||||
archash=7d6e89dffd
|
||||
archash=b857594d11
|
||||
|
Loading…
Reference in New Issue
Block a user