From 086a6f4977be28a5ad022f745480abe94442e689 Mon Sep 17 00:00:00 2001
From: magatsuchi <88991542+magatsuchi@users.noreply.github.com>
Date: Sat, 23 Apr 2022 23:10:31 -0500
Subject: [PATCH] fix (#66443)
due to the way the program is initialized computer is not set to the proper value until the ui is interacted with, whereas beforehand it is null. this means, that when you receive a message roundstart without first opening your messenger app for the first time, you won't get the chat notification for the message
oh also some qol
---
.../file_system/programs/ntmessenger.dm | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/code/modules/modular_computers/file_system/programs/ntmessenger.dm b/code/modules/modular_computers/file_system/programs/ntmessenger.dm
index 9dfcd8e929e..54d3b1a69a2 100644
--- a/code/modules/modular_computers/file_system/programs/ntmessenger.dm
+++ b/code/modules/modular_computers/file_system/programs/ntmessenger.dm
@@ -3,6 +3,7 @@
filedesc = "Direct Messenger"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "command"
+ program_state = PROGRAM_STATE_BACKGROUND
extended_desc = "This program allows old-school communication with other modular devices."
size = 8
usage_flags = PROGRAM_TABLET
@@ -271,8 +272,8 @@
// If it didn't reach, note that fact
if (!signal.data["done"])
to_chat(user, span_notice("ERROR: Server isn't responding."))
- //if(!silent)
- //playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE)
+ if(ringer_status)
+ playsound(src, 'sound/machines/terminal_error.ogg', 15, TRUE)
return FALSE
if(allow_emojis)
@@ -283,13 +284,13 @@
var/list/message_data = list()
message_data["name"] = signal.data["name"]
message_data["job"] = signal.data["job"]
- message_data["contents"] = html_decode(signal.data["message"])
+ message_data["contents"] = html_decode(signal.format_message())
message_data["outgoing"] = TRUE
message_data["ref"] = signal.data["ref"]
message_data["photo"] = signal.data["photo"]
// Show it to ghosts
- var/ghost_message = span_name("[message_data["name"]] [rigged ? "Rigged" : ""] PDA Message --> [span_name("[signal.format_target()]")]: [signal.data["message"]]")
+ var/ghost_message = span_name("[message_data["name"]] [rigged ? "Rigged" : ""] PDA Message --> [span_name("[signal.format_target()]")]: [signal.format_message()]")
for(var/mob/M in GLOB.player_list)
if(isobserver(M) && (M.client?.prefs.chat_toggles & CHAT_GHOSTPDA))
to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]")
@@ -298,7 +299,7 @@
user.log_talk(message, LOG_PDA, tag="[rigged ? "Rigged" : ""] PDA: [initial(message_data["name"])] to [signal.format_target()]")
if(rigged)
log_bomber(user, "sent a rigged PDA message (Name: [message_data["name"]]. Job: [message_data["job"]]) to [english_list(string_targets)] [!is_special_character(user) ? "(SENT BY NON-ANTAG)" : ""]")
- to_chat(user, span_info("PDA message sent to [signal.format_target()]: [signal.data["message"]]"))
+ to_chat(user, span_info("PDA message sent to [signal.format_target()]: [signal.format_message()]"))
if (ringer_status)
computer.send_sound()
@@ -316,7 +317,7 @@
var/list/message_data = list()
message_data["name"] = signal.data["name"]
message_data["job"] = signal.data["job"]
- message_data["contents"] = html_decode(signal.data["message"])
+ message_data["contents"] = signal.format_message()
message_data["outgoing"] = FALSE
message_data["ref"] = signal.data["ref"]
message_data["automated"] = signal.data["automated"]
@@ -324,11 +325,11 @@
messages += list(message_data)
var/mob/living/L = null
- if(computer.loc && isliving(computer.loc))
- L = computer.loc
+ if(holder.holder.loc && isliving(holder.holder.loc))
+ L = holder.holder.loc
//Maybe they are a pAI!
else
- L = get(computer, /mob/living/silicon)
+ L = get(holder.holder, /mob/living/silicon)
if(L && (L.stat == CONSCIOUS || L.stat == SOFT_CRIT))
var/reply = "(Reply)"