Global component signals

This commit is contained in:
Jordan Brown
2018-06-19 17:18:34 -05:00
committed by letterjay
parent 49a34614cd
commit c11557d23d
10 changed files with 102 additions and 1 deletions
+15
View File
@@ -1,3 +1,10 @@
<<<<<<< HEAD
=======
#define SEND_SIGNAL(target, sigtype, arguments...) ( !target.datum_components ? NONE : target._SendSignal(sigtype, list(##arguments)) )
#define SEND_GLOBAL_SIGNAL(sigtype, arguments...) ( !SSdcs.comp_lookup[sigtype] ? NONE : SSdcs._SendGlobalSignal(sigtype, list(##arguments)) )
>>>>>>> 84a85a5... Merge pull request #38574 from ninjanomnom/glob-signals
//shorthand
#define GET_COMPONENT_FROM(varname, path, target) var##path/##varname = ##target.GetComponent(##path)
#define GET_COMPONENT(varname, path) GET_COMPONENT_FROM(varname, path, src)
@@ -14,6 +21,14 @@
// All signals. Format:
// When the signal is called: (signal arguments)
// global signals
// These are signals which can be listened to by any component on any parent
// GLOBAL SIGNALS MUST START WITH "!"
#define COMSIG_GLOB_NEW_Z "!new_z" //from base of datum/controller/subsystem/mapping/proc/add_new_zlevel(): (list/args)
#define COMSIG_GLOB_VAR_EDIT "!var_edit" //called after a successful var edit somewhere in the world: (list/args)
//////////////////////////////////////////////////////////////////
// /datum signals
#define COMSIG_COMPONENT_ADDED "component_added" //when a component is added to a datum: (/datum/component)
#define COMSIG_COMPONENT_REMOVING "component_removing" //before a component is removed from a datum because of RemoveComponent: (/datum/component)