Upstream fix mirror spree (#7362)
* tgstation/tgstation#39025 - Fixes nukeop eshield not being buyable * tgstation/tgstation#39011 - [s] Adds missing logging to the staff of storms * tgstation/tgstation#38980 - Corrects a stat error in the Nuke Ops uplink * tgstation/tgstation#38988 - Fixes blob victory. * tgstation/tgstation#38990 - Allow players to un-ignore previously ignored popups for ghostroles, and ignore notifications with no ignore button needs tgui recompile * tgstation/tgstation#38994 - Fix timer bug * TGUI recompile * tgstation/tgstation#39035 - Fixes navigation computers. * tgstation/tgstation#39043 - Fixes minor genetics scanner runtime * tgstation/tgstation#39044 - Fixes burgers icons * tgstation/tgstation#39055 - Fixes porta_turret and decal shuttle rotations * tgstation/tgstation#39063 - Stops extinguishers from cooling turfs to absolute zero * tgstation/tgstation#38967 - Fixes smuggler's satchel init typo * tgstation/tgstation#38931 - Fixes pulse rifles exploding structures in nullspace and that sort of thing
This commit is contained in:
@@ -115,6 +115,12 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Clears `parent` and removes the component from it's component list
|
||||
1. `/datum/component/proc/_JoinParent` (private, final)
|
||||
* Tries to add the component to it's `parent`s `datum_components` list
|
||||
1. `/datum/component/proc/RegisterWithParent` (abstract, no-sleep)
|
||||
* Used to register the signals that should be on the `parent` object
|
||||
* Use this if you plan on the component transfering between parents
|
||||
1. `/datum/component/proc/UnregisterFromParent` (abstract, no-sleep)
|
||||
* Counterpart to `RegisterWithParent()`
|
||||
* Used to unregister the signals that should only be on the `parent` object
|
||||
1. `/datum/component/proc/RegisterSignal(datum/target, signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final)
|
||||
* If signal is a list it will be as if RegisterSignal was called for each of the entries with the same following arguments
|
||||
* Makes a component listen for the specified `signal` on it's `parent` datum.
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
else //only component of this type, no list
|
||||
dc[I] = src
|
||||
|
||||
RegisterWithParent()
|
||||
|
||||
// If you want/expect to be moving the component around between parents, use this to register on the parent for signals
|
||||
/datum/component/proc/RegisterWithParent()
|
||||
return
|
||||
|
||||
/datum/component/proc/Initialize(...)
|
||||
return
|
||||
|
||||
@@ -78,10 +84,15 @@
|
||||
if(!dc.len)
|
||||
P.datum_components = null
|
||||
|
||||
UnregisterFromParent()
|
||||
|
||||
/datum/component/proc/UnregisterFromParent()
|
||||
return
|
||||
|
||||
/datum/component/proc/RegisterSignal(datum/target, sig_type_or_types, proc_or_callback, override = FALSE)
|
||||
if(QDELETED(src) || QDELETED(target))
|
||||
return
|
||||
|
||||
|
||||
var/list/procs = signal_procs
|
||||
if(!procs)
|
||||
signal_procs = procs = list()
|
||||
|
||||
@@ -5,20 +5,28 @@
|
||||
var/description
|
||||
var/mutable_appearance/pic
|
||||
|
||||
var/first_dir // This only stores the dir arg from init
|
||||
|
||||
/datum/component/decal/Initialize(_icon, _icon_state, _dir, _cleanable=CLEAN_GOD, _color, _layer=TURF_LAYER, _description)
|
||||
if(!isatom(parent) || !generate_appearance(_icon, _icon_state, _dir, _layer, _color))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
first_dir = _dir
|
||||
description = _description
|
||||
cleanable = _cleanable
|
||||
|
||||
if(_dir) // If no dir is assigned at start then it follows the atom's dir
|
||||
RegisterSignal(parent, COMSIG_ATOM_DIR_CHANGE, .proc/rotate_react)
|
||||
if(_cleanable)
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
|
||||
if(_description)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
apply()
|
||||
|
||||
/datum/component/decal/RegisterWithParent()
|
||||
if(first_dir)
|
||||
RegisterSignal(parent, COMSIG_ATOM_DIR_CHANGE, .proc/rotate_react)
|
||||
if(cleanable)
|
||||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean_react)
|
||||
if(description)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
|
||||
|
||||
/datum/component/decal/UnregisterFromParent()
|
||||
UnregisterSignal(parent, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE))
|
||||
|
||||
/datum/component/decal/Destroy()
|
||||
remove()
|
||||
return ..()
|
||||
@@ -63,4 +71,4 @@
|
||||
qdel(src)
|
||||
|
||||
/datum/component/decal/proc/examine(mob/user)
|
||||
to_chat(user, description)
|
||||
to_chat(user, description)
|
||||
|
||||
Reference in New Issue
Block a user