Adds a delete verb to the vv_drop_down

This commit is contained in:
CitadelStationBot
2017-04-27 17:10:44 -05:00
parent 1334608d23
commit df4f3aaaad
2 changed files with 23 additions and 7 deletions

View File

@@ -27,6 +27,7 @@
. += "---"
.["Call Proc"] = "?_src_=vars;proc_call=\ref[src]"
.["Mark Object"] = "?_src_=vars;mark_object=\ref[src]"
.["Delete"] = "?_src_=vars;delete=\ref[src]"
/datum/proc/on_reagent_change()
@@ -526,6 +527,16 @@
if(T)
callproc_datum(T)
else if(href_list["delete"])
if(!check_rights(R_DEBUG, 0))
return
var/datum/D = locate(href_list["delete"])
if(!D)
to_chat(usr, "Unable to locate item!")
admin_delete(D)
href_list["datumrefresh"] = href_list["delete"]
else if(href_list["regenerateicons"])
if(!check_rights(0))
return

View File

@@ -505,7 +505,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("[key_name_admin(src)] has changed Central Command's name to [input]")
log_admin("[key_name(src)] has changed the Central Command name to: [input]")
/client/proc/cmd_admin_delete(atom/O as obj|mob|turf in world)
/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in world)
set category = "Admin"
set name = "Delete"
@@ -513,15 +513,20 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(src, "Only administrators may use this command.")
return
if (alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
log_admin("[key_name(usr)] deleted [O] at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] deleted [O] at ([O.x],[O.y],[O.z])")
admin_delete(A)
/client/proc/admin_delete(datum/D)
var/atom/A = D
var/coords = istype(A) ? " at ([A.x], [A.y], [A.z])" : ""
if (alert(src, "Are you sure you want to delete:\n[D]\nat[coords]?", "Confirmation", "Yes", "No") == "Yes")
log_admin("[key_name(usr)] deleted [D][coords]")
message_admins("[key_name_admin(usr)] deleted [D][coords]")
feedback_add_details("admin_verb","Delete") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(isturf(O))
var/turf/T = O
if(isturf(D))
var/turf/T = D
T.ChangeTurf(T.baseturf)
else
qdel(O)
qdel(D)
/client/proc/cmd_admin_list_open_jobs()
set category = "Admin"