Admin Verb Datums MkIII | Now with functional command bar (#82511)

This commit is contained in:
Zephyr
2024-04-12 12:27:09 -07:00
committed by GitHub
parent e0d335b442
commit 7f8752be14
104 changed files with 1898 additions and 3287 deletions
+15 -25
View File
@@ -92,11 +92,8 @@ GLOBAL_PROTECT(AdminProcCallHandler)
usr = lastusr
handler.remove_caller(user)
/client/proc/callproc()
set category = "Debug"
set name = "Advanced ProcCall"
set waitfor = FALSE
callproc_blocking()
ADMIN_VERB(advanced_proc_call, R_DEBUG, "Advanced ProcCall", "Call a proc on any datum in the server.", ADMIN_CATEGORY_DEBUG)
user.callproc_blocking()
/client/proc/callproc_blocking(list/get_retval)
if(!check_rights(R_DEBUG))
@@ -230,37 +227,30 @@ GLOBAL_PROTECT(LastAdminCalledProc)
return (GLOB.AdminProcCaller && GLOB.AdminProcCaller == usr?.client?.ckey) || (GLOB.AdminProcCallHandler && usr == GLOB.AdminProcCallHandler)
#endif
/client/proc/callproc_datum(datum/A as null|area|mob|obj|turf)
set category = "Debug"
set name = "Atom ProcCall"
set waitfor = FALSE
if(!check_rights(R_DEBUG))
return
var/procname = input("Proc name, eg: fake_blood","Proc:", null) as text|null
ADMIN_VERB_ONLY_CONTEXT_MENU(call_proc_datum, R_DEBUG, "Atom ProcCall", datum/thing as null|area|mob|obj|turf)
var/procname = input(user, "Proc name, eg: fake_blood","Proc:", null) as text|null
if(!procname)
return
if(!hascall(A,procname))
to_chat(usr, "<font color='red'>Error: callproc_datum(): type [A.type] has no proc named [procname].</font>", confidential = TRUE)
if(!hascall(thing, procname))
to_chat(user, "<font color='red'>Error: callproc_datum(): type [thing.type] has no proc named [procname].</font>", confidential = TRUE)
return
var/list/lst = get_callproc_args()
var/list/lst = user.get_callproc_args()
if(!lst)
return
if(!A || !is_valid_src(A))
to_chat(usr, span_warning("Error: callproc_datum(): owner of proc no longer exists."), confidential = TRUE)
if(!thing || !is_valid_src(thing))
to_chat(user, span_warning("Error: callproc_datum(): owner of proc no longer exists."), confidential = TRUE)
return
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
var/msg = "[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]."
log_admin("[key_name(user)] called [thing]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
var/msg = "[key_name(user)] called [thing]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]."
message_admins(msg)
admin_ticket_log(A, msg)
admin_ticket_log(thing, msg)
BLACKBOX_LOG_ADMIN_VERB("Atom ProcCall")
var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc
. = get_callproc_returnval(returnval,procname)
var/returnval = WrapAdminProcCall(thing, procname, lst) // Pass the lst as an argument list to the proc
. = user.get_callproc_returnval(returnval,procname)
if(.)
to_chat(usr, ., confidential = TRUE)
to_chat(user, ., confidential = TRUE)
/client/proc/get_callproc_args()
var/argnum = input("Number of arguments","Number:",0) as num|null