From 8362a5b056ca18d244da62500c6a2fc4ec7a6b6c Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Mon, 27 May 2019 20:50:42 +0200 Subject: [PATCH 1/2] Re-add ghost PDA messages --- code/__DEFINES/preferences.dm | 3 ++- code/modules/client/preference/preferences.dm | 4 ++++ code/modules/client/preference/preferences_toggles.dm | 8 ++++++++ code/modules/pda/messenger.dm | 8 ++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 22b4334e3be..45f1b3e5b3d 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -31,10 +31,11 @@ #define CHAT_NO_MENTORTICKETLOGS 524288 #define TYPING_ONCE 1048576 #define AMBIENT_OCCLUSION 2097152 +#define CHAT_GHOSTPDA 4194304 #define TOGGLES_TOTAL 4194303 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined. -#define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION) +#define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION|CHAT_GHOSTPDA) // Admin attack logs filter system, see /proc/add_attack_logs and /proc/msg_admin_attack #define ATKLOG_ALL 0 diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 4b24d267f29..98e688222c7 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -454,6 +454,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "Ghost Ears: [(toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]
" dat += "Ghost Radio: [(toggles & CHAT_GHOSTRADIO) ? "All Chatter" : "Nearest Speakers"]
" dat += "Ghost Sight: [(toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]
" + dat += "Ghost PDA: [(toggles & CHAT_GHOSTPDA) ? "All PDA Messages" : "No PDA Messages"]
" if(check_rights(R_ADMIN,0)) dat += "OOC Color:     Change
" if(config.allow_Metadata) @@ -2028,6 +2029,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("ghost_radio") toggles ^= CHAT_GHOSTRADIO + + if("ghost_pda") + toggles ^= CHAT_GHOSTPDA if("ghost_anonsay") ghost_anonsay = !ghost_anonsay diff --git a/code/modules/client/preference/preferences_toggles.dm b/code/modules/client/preference/preferences_toggles.dm index c4d7599d2de..8096a707916 100644 --- a/code/modules/client/preference/preferences_toggles.dm +++ b/code/modules/client/preference/preferences_toggles.dm @@ -242,3 +242,11 @@ else to_chat(usr, "You have disabled text popup limiting.") +/client/verb/toggle_ghost_pda() + set name = "Show/Hide GhostPDA" + set category = "Preferences" + set desc = ".Toggle seeing PDA messages as an observer." + prefs.toggles ^= CHAT_GHOSTPDA + to_chat(src, "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTPDA) ? "see all PDA messages" : "no longer see PDA messages"].") + prefs.save_preferences(src) + feedback_add_details("admin_verb","TGP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! \ No newline at end of file diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 67ccf48df8a..ab97c956d85 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -169,10 +169,18 @@ if(useTC != 2) // Does our recipient have a broadcaster on their level? to_chat(U, "ERROR: Cannot reach recipient.") return + useMS.send_pda_message("[P.owner]","[pda.owner]","[t]") tnote.Add(list(list("sent" = 1, "owner" = "[P.owner]", "job" = "[P.ownjob]", "message" = "[t]", "target" = "\ref[P]"))) PM.tnote.Add(list(list("sent" = 0, "owner" = "[pda.owner]", "job" = "[pda.ownjob]", "message" = "[t]", "target" = "\ref[pda]"))) pda.investigate_log("PDA Message - [U.key] - [pda.owner] -> [P.owner]: [t]", "pda") + + // Show it to ghosts + for(var/mob/M in GLOB.dead_mob_list) + if(isobserver(M) && M.client && (M.client.prefs.toggles & CHAT_GHOSTPDA)) + var/ghost_message = "[pda.owner] ([ghost_follow_link(pda, ghost=M)]) PDA Message --> [P.owner] ([ghost_follow_link(P, ghost=M)]): [t]" + to_chat(M, "[ghost_message]") + if(!conversations.Find("\ref[P]")) conversations.Add("\ref[P]") if(!PM.conversations.Find("\ref[pda]")) From 1f3d40f11a2467eb28d866025fb631383e209fdb Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Mon, 27 May 2019 20:56:50 +0200 Subject: [PATCH 2/2] Total toggles update --- code/__DEFINES/preferences.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 45f1b3e5b3d..dbd29b1d4d1 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -33,7 +33,7 @@ #define AMBIENT_OCCLUSION 2097152 #define CHAT_GHOSTPDA 4194304 -#define TOGGLES_TOTAL 4194303 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined. +#define TOGGLES_TOTAL 8388607 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined. #define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION|CHAT_GHOSTPDA)