Files
Letter NandGitHub d50ea14baa effect cleanup (#7502)
yeah, also updates emissive blockers
2026-01-27 12:44:16 -05:00

121 lines
3.5 KiB
Plaintext

// Clickable stat() button.
/obj/effect/statclick
name = "Initializing..."
blocks_emissive = EMISSIVE_BLOCK_NONE
icon = null
var/target
INITIALIZE_IMMEDIATE(/obj/effect/statclick)
/obj/effect/statclick/Initialize(mapload, text, target) //Don't port this to Initialize it's too critical
. = ..()
name = text
src.target = target
if(isdatum(target)) //Harddel man bad
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(cleanup))
/obj/effect/statclick/Destroy()
target = null
return ..()
/obj/effect/statclick/proc/cleanup()
SIGNAL_HANDLER
qdel(src)
/obj/effect/statclick/proc/update(text)
name = text
return src
/obj/effect/statclick/statpanel_click(client/C, action)
Click()
/obj/effect/statclick/debug
var/class
/obj/effect/statclick/debug/Click()
if(!usr.client.holder || !target)
return
if(!class)
if(istype(target, /datum/controller/subsystem))
class = "subsystem"
else if(istype(target, /datum/controller))
class = "controller"
else if(istype(target, /datum))
class = "datum"
else
class = "unknown"
usr.client.debug_variables(target)
message_admins("Admin [key_name_admin(usr)] is debugging the [target] [class].")
// Debug verbs.
/client/proc/restart_controller(controller in list("Master", "Failsafe"))
set category = "Debug"
set name = "Restart Controller"
set desc = "Restart one of the various periodic loop controllers for the game (be careful!)"
if(!holder)
return
switch(controller)
if("Master")
Recreate_MC()
feedback_add_details("admin_verb","RMC")
if("Failsafe")
new /datum/controller/failsafe()
feedback_add_details("admin_verb","RFailsafe")
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
/client/proc/debug_antagonist_template(antag_type in GLOB.all_antag_types)
set category = "Debug"
set name = "Debug Antagonist"
set desc = "Debug an antagonist template."
var/datum/antagonist/antag = GLOB.all_antag_types[antag_type]
if(antag)
usr.client.debug_variables(antag)
message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.")
/client/proc/debug_controller()
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various subsystems/controllers for the game (be careful!)"
if(!holder)
return
var/list/options = list()
options["MC"] = global.Master
options["Failsafe"] = global.Failsafe
options["Global Variables"] = global.GLOB
options["Configuration"] = global.config
options["Gas Data"] = global.gas_data
options["Legacy Configuration"] = config_legacy
for(var/i in Master.subsystems)
var/datum/controller/subsystem/S = i
if(!istype(S)) //Eh, we're a debug verb, let's have typechecking.
continue
var/strtype = "SS[get_end_section_of_type(S.type)]"
if(options[strtype])
var/offset = 2
while(istype(options["[strtype]_[offset] - DUPE ERROR"], /datum/controller/subsystem))
offset++
options["[strtype]_[offset] - DUPE ERROR"] = S //Something is very, very wrong.
else
options[strtype] = S
//Goon PS stuff, and other yet-to-be-subsystem things.
options["LEGACY: radio_controller"] = radio_controller
options["LEGACY: paiController"] = paiController
options["LEGACY: GLOB.cameranet"] = GLOB.cameranet
var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options
if(!pick)
return
var/datum/D = options[pick]
if(!istype(D))
return
feedback_add_details("admin_verb", "DebugController")
message_admins("Admin [key_name_admin(mob)] is debugging the [pick] controller.")
debug_variables(D)