Highlight codewords

Phrases in blue, responses in red.
This commit is contained in:
Akrilla
2019-05-24 22:34:46 +01:00
parent 1262f1d4fc
commit d87fdaaefa
2 changed files with 16 additions and 0 deletions
+14
View File
@@ -70,6 +70,18 @@ GLOBAL_LIST_INIT(freqtospan, list(
return "[spanpart1][spanpart2][freqpart][languageicon][compose_track_href(speaker, namepart)][namepart][compose_job(speaker, message_language, raw_message, radio_freq)][endspanpart][messagepart]"
/atom/movable/proc/augment_heard(message, mob/mob_hearing)
if (mob_hearing.mind.special_role == ROLE_TRAITOR)
for (var/codeword in GLOB.syndicate_code_phrase)
var/regex/codeword_match = new("(" + codeword + ")", "ig")
message = codeword_match.Replace(message, "<font color=blue>$1</font>")
for (var/codeword in GLOB.syndicate_code_response)
var/regex/codeword_match = new("(" + codeword + ")", "ig")
message = codeword_match.Replace(message, "<font color=red>$1</font>")
return message
/atom/movable/proc/compose_track_href(atom/movable/speaker, message_langs, raw_message, radio_freq)
return ""
@@ -203,6 +215,8 @@ INITIALIZE_IMMEDIATE(/atom/movable/virtualspeaker)
else // Unidentifiable mob
job = "Unknown"
/atom/movable/virtualspeaker/GetJob()
return job
+2
View File
@@ -229,6 +229,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
// Recompose message for AI hrefs, language incomprehension.
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode)
message = hear_intercept(message, speaker, message_language, raw_message, radio_freq, spans, message_mode)
message = augment_heard(message, src)
show_message(message, 2, deaf_message, deaf_type)
return message