From 071b6f05e8066b0cd87fa87e666356c78ac62f6b Mon Sep 17 00:00:00 2001
From: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
Date: Wed, 12 Jan 2022 00:58:32 -0500
Subject: [PATCH] Misc admin tools improvements (#63665)
About The Pull Request
This PR makes a few small tweaks to admin tools that I think frequent users may appreciate.
Adds the "Find Updated Panel" button to the player panel, which bring up that ckey's newest PP if one exists. Useful for when the person you're inspecting has changed mobs so you don't have to search for their new mob to get their new panel.
Adds VV and TAG links to all the entries in the Get-Contents right click verb. This should make checking and editing someone's gear easier, since you don't have to VV the person -> their satchel -> their survival box -> their oxygen tank for example, you can just click the VV link for the tank directly.
Lets you ignore punctuation in the F6 player search menu. This was a request, so if you have a silicon named "H.E.R.A.", you can now pull it up by just searching "hera". Also ignores spaces, but I doubt that'll cause any issues.
---
code/__DEFINES/admin.dm | 1 +
code/modules/admin/player_panel.dm | 6 +++++-
code/modules/admin/tag.dm | 2 +-
code/modules/admin/topic.dm | 23 +++++++++++++++++++++++
code/modules/admin/verbs/admingame.dm | 3 +++
code/modules/admin/verbs/debug.dm | 2 +-
code/modules/mob/living/living.dm | 5 ++---
7 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm
index 97e9142600d..55d836c34f4 100644
--- a/code/__DEFINES/admin.dm
+++ b/code/__DEFINES/admin.dm
@@ -65,6 +65,7 @@
#define ADMIN_COORDJMP(src) "[src ? src.Admin_Coordinates_Readable(FALSE, TRUE) : "nonexistent location"]"
#define ADMIN_VERBOSEJMP(src) "[src ? src.Admin_Coordinates_Readable(TRUE, TRUE) : "nonexistent location"]"
#define ADMIN_INDIVIDUALLOG(user) "(LOGS)"
+#define ADMIN_TAG(datum) "(TAG)"
/atom/proc/Admin_Coordinates_Readable(area_name, admin_jump_ref)
var/turf/T = Safe_COORD_Location()
diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm
index f7aad8f38a3..624d2b7a0ad 100644
--- a/code/modules/admin/player_panel.dm
+++ b/code/modules/admin/player_panel.dm
@@ -276,6 +276,9 @@
var/M_name = html_encode(M.name)
var/M_rname = html_encode(M.real_name)
+ var/M_rname_as_key = html_encode(ckey(M.real_name)) // so you can ignore punctuation
+ if(M_rname == M_rname_as_key)
+ M_rname_as_key = null
var/M_key = html_encode(M.key)
var/previous_names = ""
if(M_key)
@@ -294,10 +297,11 @@
onmouseover='expand("data[i]","item[i]")'
>
[M_name] - [M_rname] - [M_key] ([M_job])
- [M_name] [M_rname] [M_key] [M_job] [previous_names]
+ [M_name] [M_rname] [M_rname_as_key] [M_key] [M_job] [previous_names]
[M_name]
[M_job]
[M_rname]
+ [M_rname_as_key]
[previous_names]
[M_key]
[M.lastKnownIP]
diff --git a/code/modules/admin/tag.dm b/code/modules/admin/tag.dm
index c0c22806636..459c6d7ecb3 100644
--- a/code/modules/admin/tag.dm
+++ b/code/modules/admin/tag.dm
@@ -94,7 +94,7 @@
specific_info = "[resolved_subsystem.stat_entry()]"
// else, it's just a /datum
- dat += "\t[index]: [iter_datum] | [specific_info] | [ADMIN_VV(iter_datum)]| [TAG_DEL(iter_datum)] | [iter_datum == marked_datum ? "Marked" : TAG_MARK(iter_datum)] "
+ dat += "\t[index]: [iter_datum] | [specific_info] | [ADMIN_VV(iter_datum)] | [TAG_DEL(iter_datum)] | [iter_datum == marked_datum ? "Marked" : TAG_MARK(iter_datum)] "
dat += "\t([iter_datum.type])"
else
dat += "No datums tagged :("
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index e9e0252fa05..ec28ee787aa 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -726,6 +726,21 @@
var/mob/M = locate(href_list["adminplayeropts"])
show_player_panel(M)
+ else if(href_list["ppbyckey"])
+ var/target_ckey = href_list["ppbyckey"]
+ var/mob/original_mob = locate(href_list["ppbyckeyorigmob"]) in GLOB.mob_list
+ var/mob/target_mob = get_mob_by_ckey(target_ckey)
+ if(!target_mob)
+ to_chat(usr, span_warning("No mob found with that ckey."))
+ return
+
+ if(original_mob == target_mob)
+ to_chat(usr, span_warning("[target_ckey] is still in their original mob: [original_mob]."))
+ return
+
+ to_chat(usr, span_notice("Jumping to [target_ckey]'s new mob: [target_mob]!"))
+ show_player_panel(target_mob)
+
else if(href_list["adminplayerobservefollow"])
if(!isobserver(usr) && !check_rights(R_ADMIN))
return
@@ -1929,6 +1944,14 @@
return
GLOB.interviews.ui_interact(usr)
+ else if(href_list["tag_datum"])
+ if(!check_rights(R_ADMIN))
+ return
+ var/datum/datum_to_tag = locate(href_list["tag_datum"])
+ if(!datum_to_tag)
+ return
+ return add_tagged_datum(datum_to_tag)
+
else if(href_list["del_tag"])
if(!check_rights(R_ADMIN))
return
diff --git a/code/modules/admin/verbs/admingame.dm b/code/modules/admin/verbs/admingame.dm
index 59e9c24c3d1..7ed11c5f068 100644
--- a/code/modules/admin/verbs/admingame.dm
+++ b/code/modules/admin/verbs/admingame.dm
@@ -27,6 +27,9 @@
else
body += " \[Heal\] "
+ if(M.ckey)
+ body += "
\[Find Updated Panel\]"
+
if(M.client)
body += "
\[First Seen: [M.client.player_join_date]\]\[Byond account registered on: [M.client.account_join_date]\]"
body += "
CentCom Galactic Ban DB: "
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index fa3a8a6eadd..2fbcb87e1bf 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -511,7 +511,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/list/L = M.get_contents()
for(var/t in L)
- to_chat(usr, "[t]", confidential = TRUE)
+ to_chat(usr, "[t] [ADMIN_VV(t)] [ADMIN_TAG(t)]", confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Contents") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/modify_goals()
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 1fcc077b757..57017adc212 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -602,9 +602,8 @@
/mob/living/get_contents()
var/list/ret = list()
ret |= contents //add our contents
- for(var/i in ret.Copy()) //iterate storage objects
- var/atom/A = i
- SEND_SIGNAL(A, COMSIG_TRY_STORAGE_RETURN_INVENTORY, ret)
+ for(var/atom/iter_atom as anything in ret.Copy()) //iterate storage objects
+ SEND_SIGNAL(iter_atom, COMSIG_TRY_STORAGE_RETURN_INVENTORY, ret)
for(var/obj/item/folder/F in ret.Copy()) //very snowflakey-ly iterate folders
ret |= F.contents
return ret