Files
Yogstation/code/modules/admin/verbs/hiddenprints.dm
adamsong e5a1515de1 Refactors VV (#13312)
* Refactors VV

* Copied more tg code

* Fixes renameing by copying more tg code

* Copies some code from yogs this time
2022-03-13 11:22:11 +00:00

31 lines
1019 B
Plaintext

/client/proc/cmd_show_hiddenprints(atom/victim)
if(!check_rights(R_ADMIN))
return
var/interface = "A log of every player who has touched [victim], sorted by last touch.<br><br><ol>"
var/victim_hiddenprints = victim.return_hiddenprints()
if(!islist(victim_hiddenprints))
victim_hiddenprints = list()
var/list/hiddenprints = flatten_list(victim_hiddenprints)
listclearnulls(hiddenprints)
if(!length(hiddenprints))
hiddenprints = list("Nobody has touched this yet!")
hiddenprints = sortList(hiddenprints, /proc/cmp_hiddenprint_lasttime_dsc)
for(var/record in hiddenprints)
interface += "<li>[record]</li><br>"
interface += "</ol>"
var/datum/browser/hiddenprint_view = new(usr, "view_hiddenprints_[REF(victim)]", "[victim]'s hiddenprints", 450, 760)
hiddenprint_view.set_content(interface)
hiddenprint_view.open()
/proc/cmp_hiddenprint_lasttime_dsc(a, b)
var/last_a = copytext(a, findtext(a, "\nLast: "))
var/last_b = copytext(b, findtext(b, "\nLast: "))
return cmp_text_dsc(last_a, last_b)