diff --git a/code/datums/looping_sounds/looping_sound.dm b/code/datums/looping_sounds/looping_sound.dm index 0051476f2c9..dc6282440ac 100644 --- a/code/datums/looping_sounds/looping_sound.dm +++ b/code/datums/looping_sounds/looping_sound.dm @@ -137,4 +137,5 @@ mid_length = 80 decrease_to_amount = 10 decrease_by_amount = 5 + direct = TRUE channel = CHANNEL_DELTA_ALARM diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 8697623348c..7f2bac66fc7 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -88,6 +88,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts "1017" = 100, // CHANNEL_ENGINE "1016" = 100, // CHANNEL_FIREALARM "1015" = 100, // CHANNEL_ASH_STORM + "1014" = 100, // CHANNEL_DELTA_ALARM ) /// The volume mixer save timer handle. Used to debounce the DB call to save, to avoid spamming. var/volume_mixer_saving = null diff --git a/code/modules/client/preference/preferences_volume_mixer.dm b/code/modules/client/preference/preferences_volume_mixer.dm index 2b853812a47..c9e84373153 100644 --- a/code/modules/client/preference/preferences_volume_mixer.dm +++ b/code/modules/client/preference/preferences_volume_mixer.dm @@ -50,10 +50,21 @@ // Set the volume volume = clamp(volume, 0, 100) volume_mixer["[channel]"] = volume - // Update the sound channel - var/sound/S = sound(null, channel = channel, volume = volume) - S.status = SOUND_UPDATE - SEND_SOUND(parent, S) + var/sound/S + var/channel_already_updated = FALSE + // special handling for looping sounds, especially if they're decreasing + for(var/datum/looping_sound/D in GLOB.looping_sounds) + if(channel == D.channel) + S = sound(null, channel = channel, volume = D.volume * volume / 100) + S.status = SOUND_UPDATE + SEND_SOUND(parent, S) + channel_already_updated = TRUE + + if(!channel_already_updated) + // Update the currently playing sound to update its volume + S = sound(null, channel = channel, volume = volume) + S.status = SOUND_UPDATE + SEND_SOUND(parent, S) // Save it if(debounce_save) volume_mixer_saving = addtimer(CALLBACK(src, PROC_REF(save_volume_mixer)), 3 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE)