From 869e2cb5e7c27e006ea53c1d8af0e18ee6a67139 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Tue, 10 May 2022 22:57:08 +0200 Subject: [PATCH] Fixes accent icon text tags not showing up on the radio. (#13861) --- code/game/machinery/telecomms/broadcaster.dm | 7 +--- code/modules/mob/hear_say.dm | 5 ++- html/changelogs/mattatlas-radioaccentfix.yml | 41 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 html/changelogs/mattatlas-radioaccentfix.yml diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 8aa182b04c2..0daeda64f38 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -243,9 +243,6 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept var/list/obj/item/device/radio/radios = list() - // --- Gets the accent icon, if there is any --- - var/accent_icon = M.get_accent_icon(speaking, M) - // --- Broadcast only to intercom devices --- if(data == 1) @@ -361,7 +358,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept var/part_b_extra = "" if(data == 3) // intercepted radio message part_b_extra = " (Intercepted)" - var/part_a = "[accent_icon ? accent_icon + " " : ""]\[[freq_text]\][part_b_extra] " // goes in the actual output + var/part_a = "%ACCENT%\[[freq_text]\][part_b_extra] " // goes in the actual output // --- Some more pre-message formatting --- var/part_b = " " // Tweaked for security headsets -- TLE @@ -424,7 +421,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept /* --- Process all the mobs that heard a masked voice (understood) --- */ - + //Note that accent tags are handled in hear_radio. if (length(heard_masked)) for (var/mob/R in heard_masked) R.hear_radio(message, verbage, speaking, part_a, part_b, part_c, M, 0, name) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 2fadc9efdee..a21be8b0d65 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -177,7 +177,10 @@ speaker_name = "Unknown" var/changed_voice - var/accent_icon + + var/accent_icon = speaker.get_accent_icon(language, src) + accent_icon = accent_icon ? accent_icon + " " : "" + part_a = replacetext(part_a, "%ACCENT%", accent_icon) if(istype(src, /mob/living/silicon/ai) && !hard_to_hear) var/jobname // the mob's "job" diff --git a/html/changelogs/mattatlas-radioaccentfix.yml b/html/changelogs/mattatlas-radioaccentfix.yml new file mode 100644 index 00000000000..9b408763865 --- /dev/null +++ b/html/changelogs/mattatlas-radioaccentfix.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Accent text tags now show up in the radio."