mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Adds a new admin/runtime verb that allows you to easily access global variables without lag (#22407)
* fuq yeah * AA review
This commit is contained in:
@@ -1420,3 +1420,29 @@
|
||||
if(href_list["listrefresh"])
|
||||
debug_variables(locate(href_list["listrefresh"]))
|
||||
return TRUE
|
||||
|
||||
/client/proc/debug_global_variables(var_search as text)
|
||||
set category = "Debug"
|
||||
set name = "Debug Global Variables"
|
||||
|
||||
if(!check_rights(R_ADMIN|R_VIEWRUNTIMES))
|
||||
to_chat(usr, "<span class='warning'>You need to be an administrator to access this.</span>")
|
||||
return
|
||||
|
||||
var_search = trim(var_search)
|
||||
if(!var_search)
|
||||
return
|
||||
if(!GLOB.can_vv_get(var_search))
|
||||
return
|
||||
switch(var_search)
|
||||
if("vars")
|
||||
return FALSE
|
||||
if(!(var_search in GLOB.vars))
|
||||
to_chat(src, "<span class='debug'>GLOB.[var_search] does not exist.</span>")
|
||||
return
|
||||
log_and_message_admins("is debugging the Global Variables controller with the search term \"[var_search]\"")
|
||||
var/result = GLOB.vars[var_search]
|
||||
if(islist(result) || isclient(result) || istype(result, /datum))
|
||||
to_chat(src, "<span class='debug'>Now showing GLOB.[var_search].</span>")
|
||||
return debug_variables(result)
|
||||
to_chat(src, "<span class='debug'>GLOB.[var_search] returned [result].</span>")
|
||||
|
||||
@@ -180,7 +180,8 @@ GLOBAL_LIST_INIT(admin_verbs_debug, list(
|
||||
/client/proc/debug_timers,
|
||||
/client/proc/force_verb_bypass,
|
||||
/client/proc/show_gc_queues,
|
||||
/client/proc/toggle_mctabs
|
||||
/client/proc/toggle_mctabs,
|
||||
/client/proc/debug_global_variables
|
||||
))
|
||||
GLOBAL_LIST_INIT(admin_verbs_possess, list(
|
||||
/proc/possess,
|
||||
@@ -239,6 +240,18 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list(
|
||||
/client/proc/cinematic, // This will break everyone's screens in the round. Dont use this for adminbus.
|
||||
/client/proc/throw_runtime, // Do I even need to explain why this is locked?
|
||||
))
|
||||
GLOBAL_LIST_INIT(view_runtimes_verbs, list(
|
||||
/client/proc/view_runtimes,
|
||||
/client/proc/cmd_display_del_log,
|
||||
/client/proc/cmd_display_del_log_simple,
|
||||
/client/proc/toggledebuglogs,
|
||||
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
|
||||
/client/proc/ss_breakdown,
|
||||
/client/proc/show_gc_queues,
|
||||
/client/proc/toggle_mctabs,
|
||||
/client/proc/debug_global_variables,
|
||||
/client/proc/visualise_active_turfs
|
||||
))
|
||||
|
||||
/client/proc/on_holder_add()
|
||||
if(chatOutput && chatOutput.loaded)
|
||||
@@ -287,16 +300,7 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list(
|
||||
if(holder.rights & R_MAINTAINER)
|
||||
verbs += GLOB.admin_verbs_maintainer
|
||||
if(holder.rights & R_VIEWRUNTIMES)
|
||||
// TODO - Make a viewruntimes list at this point - its getting silly
|
||||
verbs += /client/proc/view_runtimes
|
||||
verbs += /client/proc/cmd_display_del_log
|
||||
verbs += /client/proc/cmd_display_del_log_simple
|
||||
verbs += /client/proc/toggledebuglogs
|
||||
verbs += /client/proc/debug_variables /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
|
||||
verbs += /client/proc/ss_breakdown
|
||||
verbs += /client/proc/show_gc_queues
|
||||
verbs += /client/proc/toggle_mctabs
|
||||
verbs += /client/proc/visualise_active_turfs
|
||||
verbs += GLOB.view_runtimes_verbs
|
||||
spawn(1) // This setting exposes the profiler for people with R_VIEWRUNTIMES. They must still have it set in cfg/admin.txt
|
||||
control_freak = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user