diff --git a/modular_bandastation/tts/code/tts_preferences.dm b/modular_bandastation/tts/code/tts_preferences.dm index e747d7a18b1f3..2c7d6a1989728 100644 --- a/modular_bandastation/tts/code/tts_preferences.dm +++ b/modular_bandastation/tts/code/tts_preferences.dm @@ -53,3 +53,14 @@ /datum/preference/text/tts_seed/apply_to_human(mob/living/carbon/human/target, value) target.AddComponent(/datum/component/tts_component, SStts220.tts_seeds[value]) + +/datum/preference/numeric/sound_tts_volume_radio + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "sound_tts_volume_radio" + savefile_identifier = PREFERENCE_PLAYER + + minimum = 0 + maximum = 100 + +/datum/preference/numeric/sound_tts_volume_radio/create_default_value() + return maximum diff --git a/modular_bandastation/tts/code/tts_subsystem.dm b/modular_bandastation/tts/code/tts_subsystem.dm index df429adbe378e..69f0ab0217acd 100644 --- a/modular_bandastation/tts/code/tts_subsystem.dm +++ b/modular_bandastation/tts/code/tts_subsystem.dm @@ -352,7 +352,12 @@ SUBSYSTEM_DEF(tts220) queue_sound_effect_processing(pure_filename, effect, filename2play, output_tts_cb) /datum/controller/subsystem/tts220/proc/output_tts(atom/speaker, mob/listener, filename2play, is_local = TRUE, preSFX = null, postSFX = null) - var/volume = listener?.client?.prefs?.read_preference(/datum/preference/numeric/sound_tts_volume) + var/volume + if(findtext(filename2play, "radio")) + volume = listener?.client?.prefs?.read_preference(/datum/preference/numeric/sound_tts_volume_radio) + else + volume = listener?.client?.prefs?.read_preference(/datum/preference/numeric/sound_tts_volume) + if(!volume) return @@ -362,7 +367,7 @@ SUBSYSTEM_DEF(tts220) output.status = SOUND_STREAM if(!is_local || isnull(speaker)) output.wait = TRUE - output.volume = volume * 0.75 // non-local is slightly less loud // TODO220: Make volume different + output.volume = volume output.environment = SOUND_ENVIRONMENT_NONE if(output.volume <= 0) diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds220.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds220.tsx new file mode 100644 index 0000000000000..ec38fa2c364e3 --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds220.tsx @@ -0,0 +1,10 @@ +import { Feature, FeatureSliderInput } from '../base'; + +// BANDASTATION SOUND PREFS + +export const sound_tts_volume_radio: Feature = { + name: 'TTS - громкость рации', + category: 'ЗВУК', + description: 'Громкость text-to-speech, когда используется рация.', + component: FeatureSliderInput, +};