From de4e706abfab99439c6ef4406b4064a069cb87c3 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 12 Jan 2022 13:35:49 +0100 Subject: [PATCH] [MIRROR] Misc admin tools improvements [MDB IGNORE] (#10624) * 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. * Misc admin tools improvements Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com> --- 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 734840b6078..4e7eb20936d 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -68,6 +68,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]) - + + 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 1764f5e5809..faf7a5b090a 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -778,6 +778,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 @@ -1981,6 +1996,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 b001f6ebab6..42ab8856522 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 929b0cc6c1e..55875137d81 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 81121ac0c40..27431318014 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -649,9 +649,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