mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-29 02:21:44 +00:00
## About The Pull Request See title. ## Why It's Good For The Game Makes it easier for people to add new admin buttons, and also removes the giant ass ugly lists that are an affront to my eyes. Yes you are still able to call them manually via the verb bar   ## Changelog 🆑 refactor: Admin verbs are now datums with a dedicated panel handler admin: Admin verbs now come with a handy description when you hover over them! /🆑 --------- Signed-off-by: GitHub <noreply@github.com>
27 lines
974 B
Plaintext
27 lines
974 B
Plaintext
/datum/admins/proc/admin_delete(datum/D)
|
|
var/atom/A = D
|
|
var/coords = ""
|
|
var/jmp_coords = ""
|
|
if(istype(A))
|
|
var/turf/T = get_turf(A)
|
|
if(T)
|
|
var/atom/a_loc = A.loc
|
|
var/is_turf = isturf(a_loc)
|
|
coords = "[is_turf ? "at" : "from [a_loc] at"] [AREACOORD(T)]"
|
|
jmp_coords = "[is_turf ? "at" : "from [a_loc] at"] [ADMIN_VERBOSEJMP(T)]"
|
|
else
|
|
jmp_coords = coords = "in nullspace"
|
|
|
|
if (tgui_alert(usr, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", list("Yes", "No")) == "Yes")
|
|
log_admin("[key_name(usr)] deleted [D] [coords]")
|
|
message_admins("[key_name_admin(usr)] deleted [D] [jmp_coords]")
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Delete") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
if(isturf(D))
|
|
var/turf/T = D
|
|
T.ScrapeAway()
|
|
else
|
|
owner?.vv_update_display(D, "deleted", VV_MSG_DELETED)
|
|
qdel(D)
|
|
if(!QDELETED(D))
|
|
owner?.vv_update_display(D, "deleted", "")
|