mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 03:32:00 +00:00
## About The Pull Request Signals were initially only usable with component listeners, which while no longer the case has lead to outdated documentation, names, and a similar location in code. This pr pulls the two apart. Partially because mso thinks we should, but also because they really aren't directly linked anymore, and having them in this midstate just confuses people. [Renames comp_lookup to listen_lookup, since that's what it does](102b79694f) [Moves signal procs over to their own file](33d07d01fd) [Renames the PREQDELETING and QDELETING comsigs to drop the parent bit since they can hook to more then just comps now](335ea4ad08) [Does something similar to the attackby comsigs (PARENT -> ATOM)](210e57051d) [And finally passes over the examine signals](65917658fb) ## Why It's Good For The Game Code makes more sense, things are better teased apart, s just good imo ## Changelog 🆑 refactor: Pulled apart the last vestiges of names/docs directly linking signals to components /🆑
92 lines
2.6 KiB
Plaintext
92 lines
2.6 KiB
Plaintext
// Clickable stat() button.
|
|
/obj/effect/statclick
|
|
name = "Initializing..."
|
|
blocks_emissive = EMISSIVE_BLOCK_NONE
|
|
var/target
|
|
|
|
INITIALIZE_IMMEDIATE(/obj/effect/statclick)
|
|
|
|
/obj/effect/statclick/Initialize(mapload, text, target)
|
|
. = ..()
|
|
name = text
|
|
src.target = target
|
|
if(isdatum(target)) //Harddel man bad
|
|
RegisterSignal(target, COMSIG_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/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(isdatum(target))
|
|
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()
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Master Controller")
|
|
if("Failsafe")
|
|
new /datum/controller/failsafe()
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Failsafe Controller")
|
|
|
|
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
|
|
|
|
/client/proc/debug_controller()
|
|
set category = "Debug"
|
|
set name = "Debug Controller"
|
|
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
|
|
|
|
if(!holder)
|
|
return
|
|
|
|
var/list/controllers = list()
|
|
var/list/controller_choices = list()
|
|
|
|
for (var/datum/controller/controller in world)
|
|
if (istype(controller, /datum/controller/subsystem))
|
|
continue
|
|
controllers["[controller] (controller.type)"] = controller //we use an associated list to ensure clients can't hold references to controllers
|
|
controller_choices += "[controller] (controller.type)"
|
|
|
|
var/datum/controller/controller_string = input("Select controller to debug", "Debug Controller") as null|anything in controller_choices
|
|
var/datum/controller/controller = controllers[controller_string]
|
|
|
|
if (!istype(controller))
|
|
return
|
|
debug_variables(controller)
|
|
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Restart Failsafe Controller")
|
|
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
|