From 9cc0161d41017f9f8ab8288c461e75de4dc91413 Mon Sep 17 00:00:00 2001 From: I-VAPE-VOX-CLOACA-EVERY-DAY-OF-MY-LIFE <40967382+I-VAPE-VOX-CLOACA-EVERY-DAY-OF-MY-LIFE@users.noreply.github.com> Date: Tue, 7 May 2019 20:19:29 -0300 Subject: [PATCH] NO_AMBIENCE config (#22797) --- code/controllers/configuration.dm | 3 +++ code/controllers/subsystem/ambient_sound.dm | 4 +++- code/modules/client/preferences.dm | 4 ++++ config-example/config.txt | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index bd3b39b714e..2d8a56201c3 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -173,6 +173,7 @@ var/skip_vault_generation = 0 //If 1, don't generate vaults var/shut_up_automatic_diagnostic_and_announcement_system = 0 //If 1, don't play the vox sounds at the start of every shift. var/no_lobby_music = 0 //If 1, don't play lobby music, regardless of client preferences. + var/no_ambience = 0 //If 1, don't play ambience, regardless of client preferences. var/enable_roundstart_away_missions = 0 @@ -571,6 +572,8 @@ shut_up_automatic_diagnostic_and_announcement_system = 1 if("no_lobby_music") no_lobby_music = 1 + if("no_ambience") + no_ambience = 1 if("enable_roundstart_away_missions") enable_roundstart_away_missions = 1 if("enable_wages") diff --git a/code/controllers/subsystem/ambient_sound.dm b/code/controllers/subsystem/ambient_sound.dm index 379c21e1b43..7baa2bf4aca 100644 --- a/code/controllers/subsystem/ambient_sound.dm +++ b/code/controllers/subsystem/ambient_sound.dm @@ -15,6 +15,8 @@ var/datum/subsystem/ambientsound/SSambience /datum/subsystem/ambientsound/fire(resumed = FALSE) + if(config.no_ambience) + return for (var/client/C in clients) if(C && (C.prefs.toggles & SOUND_AMBIENCE)) C.handle_ambience() @@ -65,4 +67,4 @@ client/proc/handle_ambience() /datum/ambience var/length = 0 MINUTES //doesn't need to be 100% accurate. should be in the ballpark though. var/sound = null //the actual file it points to. - var/prob_fire = 35 //The chance we play this ambience \ No newline at end of file + var/prob_fire = 35 //The chance we play this ambience diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index b92d3617f1b..a32333f0ca0 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1345,6 +1345,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."} user << sound(null, repeat = 0, wait = 0, volume = 0, channel = CHANNEL_ADMINMUSIC) if("lobby_music") + if(config.no_lobby_music) + to_chat(user, "DEBUG: Lobby music is globally disabled via server config.") toggles ^= SOUND_LOBBY if(toggles & SOUND_LOBBY) if(istype(user,/mob/new_player)) @@ -1356,6 +1358,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."} user.client.set_new_volume() if("ambience") + if(config.no_ambience) + to_chat(user, "DEBUG: Ambience is globally disabled via server config.") toggles ^= SOUND_AMBIENCE if(!(toggles & SOUND_AMBIENCE)) user << sound(null, repeat = 0, wait = 0, volume = 0, channel = CHANNEL_AMBIENCE) diff --git a/config-example/config.txt b/config-example/config.txt index 1801be52350..12a306df046 100644 --- a/config-example/config.txt +++ b/config-example/config.txt @@ -313,6 +313,10 @@ SKIP_VAULT_GENERATION ## Uncomment to never play lobby music. Useful if you use guest keys to multiaccount-test stuff, since you can't use client preferences for those. #NO_LOBBY_MUSIC +## NO_AMBIENCE +## Same as above. +#NO_AMBIENCE + ## ENABLE_ROUNDSTART_AWAY_MISSIONS ## Uncomment to genereate an away mission at the beginning of each round #ENABLE_ROUNDSTART_AWAY_MISSIONS