mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-17 21:24:01 +00:00
* Adds TTS to the game. Players can select their own voices in preferences. * [SEMI-MODULAR] [MIRROR FIX] Fixes the TTS PR. (#21267) Fixes the TTS PR. --------- Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
17 lines
655 B
Plaintext
17 lines
655 B
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),
|
|
)
|
|
|
|
/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)
|
|
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, local = TRUE)
|
|
return TRUE
|