Adds Datum Tagging for admins (#62982)

This commit is contained in:
Ryll Ryll
2021-12-21 17:00:46 -05:00
committed by GitHub
parent 6e3cacac38
commit 45eb682ee6
14 changed files with 212 additions and 2 deletions
@@ -85,6 +85,15 @@
markstring = "[VV_MARKED_DATUM] (CURRENT: [(istype(holder) && istype(holder.marked_datum))? holder.marked_datum.type : "NULL"])"
classes += markstring
var/list/tagstrings = new
if(!(VV_TAGGED_DATUM in restricted_classes) && holder && LAZYLEN(holder.tagged_datums))
var/i = 0
for(var/datum/iter_tagged_datum as anything in holder.tagged_datums)
i++
var/new_tagstring = "[VV_TAGGED_DATUM] #[i]: [iter_tagged_datum.type])"
tagstrings[new_tagstring] = iter_tagged_datum
classes += new_tagstring
if(restricted_classes)
classes -= restricted_classes
@@ -95,6 +104,12 @@
if(holder && holder.marked_datum && .["class"] == markstring)
.["class"] = VV_MARKED_DATUM
if(holder && tagstrings[.["class"]])
var/datum/chosen_datum = tagstrings[.["class"]]
.["value"] = chosen_datum
.["class"] = VV_TAGGED_DATUM
switch(.["class"])
if(VV_TEXT)
.["value"] = input("Enter new text:", "Text", current_value) as null|text
@@ -210,6 +225,11 @@
.["class"] = null
return
if(VV_TAGGED_DATUM)
if(.["value"] == null)
.["class"] = null
return
if(VV_PROCCALL_RETVAL)
var/list/get_retval = list()
callproc_blocking(get_retval)
@@ -0,0 +1,18 @@
/client/proc/tag_datum(datum/target_datum)
if(!holder || QDELETED(target_datum))
return
holder.add_tagged_datum(target_datum)
/client/proc/toggle_tag_datum(datum/target_datum)
if(!holder || !target_datum)
return
if(LAZYFIND(holder.tagged_datums, target_datum))
holder.remove_tagged_datum(target_datum)
else
holder.add_tagged_datum(target_datum)
/client/proc/tag_datum_mapview(datum/target_datum as mob|obj|turf|area in view(view))
set category = "Debug"
set name = "Tag Datum"
tag_datum(target_datum)
@@ -50,6 +50,8 @@
if(href_list[VV_HK_MARK])
usr.client.mark_datum(target)
if(href_list[VV_HK_TAG])
usr.client.tag_datum(target)
if(href_list[VV_HK_ADDCOMPONENT])
if(!check_rights(NONE))
return