Skip to content

Commit

Permalink
snowflakes tts more so it works with headsets (#6686)
Browse files Browse the repository at this point in the history
## About The Pull Request
title

## Why It's Good For The Game
you cant use tts with headsets right now

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
fix: snowflakes tts more so it works with headsets
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: BlueWildrose <[email protected]>
  • Loading branch information
timothyteakettle and BlueWildrose authored Sep 2, 2024
1 parent 9e30d9e commit e6e8ce0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion code/game/objects/items/devices/text_to_speech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion code/modules/mob/living/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e6e8ce0

Please sign in to comment.