From e6e8ce042efc3f9b7e474db45109e40e4095b154 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Mon, 2 Sep 2024 20:05:33 +0100 Subject: [PATCH] snowflakes tts more so it works with headsets (#6686) ## About The Pull Request title ## Why It's Good For The Game you cant use tts with headsets right now ## Changelog :cl: fix: snowflakes tts more so it works with headsets /:cl: --------- Co-authored-by: BlueWildrose <57083662+BlueWildrose@users.noreply.github.com> --- code/game/objects/items/devices/text_to_speech.dm | 14 +++++++++++++- code/modules/mob/living/say.dm | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index 71c444de8c53..07aa8e7721a6 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -51,8 +51,20 @@ if(activated) var/message = message_args["message"] var/whispering = message_args["whispering"] + var/message_mode = message_args["message_mode"] + var/speech_verb = whispering ? "quietly states" : "states" message_args["cancelled"] = TRUE - audible_message("[icon2html(thing = src, target = world)] \The [name] [whispering ? "quietly states" : "states"], \"[message]\"", null, whispering ? 2 : world.view) + audible_message("[icon2html(thing = src, target = world)] \The [name] [speech_verb], \"[message]\"", null, whispering ? 2 : world.view) if(!whispering) linked_user.say_overhead(message, FALSE, MESSAGE_RANGE_COMBAT_LOUD) + + if(ishuman(source) && message_mode != null) + var/mob/living/carbon/human/H = source + var/obj/item/radio/headset/left_radio = H.l_ear + var/obj/item/radio/headset/right_radio = H.r_ear + if(istype(left_radio)) + left_radio.talk_into(source, message, message_mode, speech_verb, null) + if(istype(right_radio)) + right_radio.talk_into(source, message, message_mode, speech_verb, null) + playsound(src, 'sound/items/tts/stopped_type.ogg', 25, TRUE) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 8b7ac8908cc5..cac79cb47bed 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -236,7 +236,7 @@ var/list/channel_to_radio_key = new verb = speaking.speech_verb w_not_heard = "[speaking.speech_verb] something [w_adverb]" - var/list/message_args = list("message" = message, "whispering" = whispering, "cancelled" = FALSE) + var/list/message_args = list("message" = message, "whispering" = whispering, "cancelled" = FALSE, "message_mode" = message_mode) SEND_SIGNAL(src, COMSIG_MOB_SAY, message_args)