Skip to content

Commit

Permalink
[PORT] Mind link speech displays symbols correctly (#2523)
Browse files Browse the repository at this point in the history
* Mind link speech displays symbols correctly (#76290)

Closes #71991 
Removes a call to sanitize() in mind linker code because tgui_input_text() already sanitizes input by default, symbols now display correctly

* Mind links won't highlight your own messages (#84625)

## About The Pull Request

Linked speech now prevents messages from highlighting if its a message
you sent, or if you are the owner of said link.

Also, linked speech messages are now marked as radio messages, for chat
tab purposes.

## Why It's Good For The Game

Because when you have your own name highlighted, it's annoying having
every message with `[Shion Rosenthal's Slime Link]` highlighted, even if
it's _my own_ message.

## Changelog
:cl:
qol: Linked speech now prevents messages from highlighting if its a
message you sent, or if you are the owner of said link..
qol: Linked speech messages are now marked as radio messages, for chat
tab purposes.
/:cl:

---------

Co-authored-by: cnleth <[email protected]>
  • Loading branch information
Absolucy and rimefruit authored Jul 5, 2024
1 parent 3cab09e commit 87dc2be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/datums/components/mind_linker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,10 @@
return ..() && (owner.stat != DEAD)

/datum/action/innate/linked_speech/Activate()

var/datum/component/mind_linker/linker = target
var/mob/living/linker_parent = linker.parent

var/message = sanitize(tgui_input_text(owner, "Enter a message to transmit.", "[linker.network_name] Telepathy"))
var/message = tgui_input_text(owner, "Enter a message to transmit.", "[linker.network_name] Telepathy")
if(!message || QDELETED(src) || QDELETED(owner) || owner.stat == DEAD)
return

Expand All @@ -208,7 +207,8 @@
var/list/all_who_can_hear = assoc_to_keys(linker.linked_mobs) + linker_parent

for(var/mob/living/recipient as anything in all_who_can_hear)
to_chat(recipient, formatted_message)
var/avoid_highlighting = (recipient == owner) || (recipient == linker_parent)
to_chat(recipient, formatted_message, type = MESSAGE_TYPE_RADIO, avoid_highlighting = avoid_highlighting)

for(var/mob/recipient as anything in GLOB.dead_mob_list)
to_chat(recipient, "[FOLLOW_LINK(recipient, owner)] [formatted_message]")
to_chat(recipient, "[FOLLOW_LINK(recipient, owner)] [formatted_message]", type = MESSAGE_TYPE_RADIO)

0 comments on commit 87dc2be

Please sign in to comment.