From 5f11aebbdefb67ac12ce25e135e4abb7b3463f73 Mon Sep 17 00:00:00 2001 From: SatinIsle <98125273+SatinIsle@users.noreply.github.com> Date: Fri, 8 Aug 2025 03:58:06 +0100 Subject: [PATCH] Toggle for bloopers (multiple say sounds) (#18201) * Toggle for bloopers (multiple say sounds) Added a preference for "Multiple Say Sounds", which is enabled by default. If you have it enabled it plays multiple say sounds for long sentences as normal. If disabled it will play only one say sound, if say sounds are enabled. It does mean there's an extra bloop at the beginning now, but it doesn't change the effect much in my testing. * make this respect whisper/say --------- Co-authored-by: C.L. --- code/modules/client/preferences/types/game/sound.dm | 6 ++++++ code/modules/mob/living/say.dm | 7 ++++--- .../preferences/features/game_preferences/sound.tsx | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preferences/types/game/sound.dm b/code/modules/client/preferences/types/game/sound.dm index 5c8b25b2286..a4f03bde4e2 100644 --- a/code/modules/client/preferences/types/game/sound.dm +++ b/code/modules/client/preferences/types/game/sound.dm @@ -63,6 +63,12 @@ default_value = TRUE savefile_identifier = PREFERENCE_PLAYER +/datum/preference/toggle/bloop_sounds + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "BLOOP_SOUNDS" + default_value = TRUE + savefile_identifier = PREFERENCE_PLAYER + /datum/preference/toggle/emote_sounds category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "EMOTE_SOUNDS" diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index e82a9449678..76426cd137b 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -444,7 +444,7 @@ var/list/channel_to_radio_key = list() #define BLOOPER_MAX_BLOOPERS 24 #define BLOOPER_MAX_TIME (1.5 SECONDS) -/mob/living/proc/blooper(extrarange = 0, volume, sound_preference = /datum/preference/toggle/say_sounds) +/mob/living/proc/blooper(extrarange = 0, volume, sound_preference = /datum/preference/toggle/bloop_sounds) playsound(\ src,\ pick(voice_sounds_list),\ @@ -458,13 +458,14 @@ var/list/channel_to_radio_key = list() preference = sound_preference, ) -/mob/living/proc/blooploop(message, extrarange = 0, volume, sound_preference = /datum/preference/toggle/say_sounds) +/mob/living/proc/blooploop(message, extrarange = 0, volume, sound_preference = /datum/preference/toggle/say_sounds, bloop_preference = /datum/preference/toggle/bloop_sounds) var/bloopers = min(round((LAZYLEN(message) / BLOOPER_SPEED)) + 1, BLOOPER_MAX_BLOOPERS) var/total_delay + playsound(src, pick(voice_sounds_list), 75, TRUE, extrarange = extrarange, falloff = 1 , is_global = TRUE, frequency = voice_freq > 0 ? voice_freq : null, ignore_walls = FALSE, preference = sound_preference) for(var/i in 1 to bloopers) if(total_delay > BLOOPER_MAX_TIME) break - addtimer(CALLBACK(src, PROC_REF(blooper), extrarange, volume, sound_preference), total_delay) + addtimer(CALLBACK(src, PROC_REF(blooper), extrarange, volume, bloop_preference), total_delay) total_delay += rand(\ DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE), \ DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE) + DS2TICKS(BLOOPER_SPEED / BLOOPER_SPEED_BASELINE)) TICKS diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sound.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sound.tsx index 61d1e9da32b..ecd6d774df5 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sound.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sound.tsx @@ -61,6 +61,14 @@ export const SAY_SOUNDS: FeatureToggle = { component: CheckboxInput, }; +export const BLOOP_SOUNDS: FeatureToggle = { + name: 'Multiple Say Sounds', + category: 'SOUNDS', + description: + 'Enable hearing a say sound play multiple times for longer messages.', + component: CheckboxInput, +}; + export const EMOTE_SOUNDS: FeatureToggle = { name: 'Me Sounds', category: 'SOUNDS',