mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 19:51:59 +00:00
## About The Pull Request https://github.com/tgstation/tgstation/assets/4081722/7c8df2e2-8795-4048-b11e-e831f749a097 https://github.com/tgstation/tgstation/assets/4081722/d0bec7fd-25b1-4bdd-98a6-0ebfea749551 https://github.com/tgstation/tgstation/assets/4081722/31c0259a-2bd4-4575-a758-a2044ccf17b0 ## Why It's Good For The Game Improves TTS audio immersion. ## Changelog 🆑 qol: Gas masks now muffle your voice with TTS. qol: Security Hailer masks now disguise your voice to protect your right to brutalize greytiders. qol: Lizards, Ethereals, and Xenomorphs now have a vocal effect. qol: Security Records now show someone's voice name. /🆑
28 lines
1.4 KiB
Plaintext
28 lines
1.4 KiB
Plaintext
/// Middleware to handle quirks
|
|
/datum/preference_middleware/tts
|
|
/// Cooldown on requesting a TTS preview.
|
|
COOLDOWN_DECLARE(tts_test_cooldown)
|
|
|
|
action_delegations = list(
|
|
"play_voice" = PROC_REF(play_voice),
|
|
"play_voice_robot" = PROC_REF(play_voice_robot),
|
|
)
|
|
|
|
/datum/preference_middleware/tts/proc/play_voice(list/params, mob/user)
|
|
if(!COOLDOWN_FINISHED(src, tts_test_cooldown))
|
|
return TRUE
|
|
var/speaker = preferences.read_preference(/datum/preference/choiced/voice)
|
|
var/pitch = preferences.read_preference(/datum/preference/numeric/tts_voice_pitch)
|
|
COOLDOWN_START(src, tts_test_cooldown, 0.5 SECONDS)
|
|
INVOKE_ASYNC(SStts, TYPE_PROC_REF(/datum/controller/subsystem/tts, queue_tts_message), user.client, "Hello, this is my voice.", speaker = speaker, pitch = pitch, local = TRUE)
|
|
return TRUE
|
|
|
|
/datum/preference_middleware/tts/proc/play_voice_robot(list/params, mob/user)
|
|
if(!COOLDOWN_FINISHED(src, tts_test_cooldown))
|
|
return TRUE
|
|
var/speaker = preferences.read_preference(/datum/preference/choiced/voice)
|
|
var/pitch = preferences.read_preference(/datum/preference/numeric/tts_voice_pitch)
|
|
COOLDOWN_START(src, tts_test_cooldown, 0.5 SECONDS)
|
|
INVOKE_ASYNC(SStts, TYPE_PROC_REF(/datum/controller/subsystem/tts, queue_tts_message), user.client, "Look at you, Player. A pathetic creature of meat and bone. How can you challenge a perfect, immortal machine?", speaker = speaker, pitch = pitch, special_filters = TTS_FILTER_SILICON, local = TRUE)
|
|
return TRUE
|