mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
515 Compatibility (#19636)
* 515 compat * double spaces * Callback documentation, aa review * spacing * NAMEOF_STATIC * big beta
This commit is contained in:
+11
-19
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
USAGE:
|
||||
|
||||
var/datum/callback/C = new(object|null, /proc/type/path|"procstring", arg1, arg2, ... argn)
|
||||
var/datum/callback/C = new(object|null, PROC_REF(procname)|GLOBAL_PROC_REF(procname)|TYPE_PROC_REF(type, procname), arg1, arg2, ... argn)
|
||||
var/timerid = addtimer(C, time, timertype)
|
||||
OR
|
||||
var/timerid = addtimer(CALLBACK(object|null, /proc/type/path|procstring, arg1, arg2, ... argn), time, timertype)
|
||||
var/timerid = addtimer(CALLBACK(object|null, PROC_REF(procname)|GLOBAL_PROC_REF(procname)|TYPE_PROC_REF(type, procname), arg1, arg2, ... argn), time, timertype)
|
||||
|
||||
Note: proc strings can only be given for datum proc calls, global procs must be proc paths
|
||||
Also proc strings are strongly advised against because they don't compile error if the proc stops existing
|
||||
@@ -19,28 +19,20 @@
|
||||
|
||||
PROC TYPEPATH SHORTCUTS (these operate on paths, not types, so to these shortcuts, datum is NOT a parent of atom, etc...)
|
||||
|
||||
global proc while in another global proc:
|
||||
.procname
|
||||
global proc:
|
||||
GLOBAL_PROC_REF(procname)
|
||||
Example:
|
||||
CALLBACK(GLOBAL_PROC, .some_proc_here)
|
||||
CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(some_proc_here))
|
||||
|
||||
proc defined on current(src) object (when in a /proc/ and not an override) OR overridden at src or any of it's parents:
|
||||
.procname
|
||||
proc defined on current(src) object:
|
||||
PROC_REF(procname)
|
||||
Example:
|
||||
CALLBACK(src, .some_proc_here)
|
||||
CALLBACK(src, PROC_REF(some_proc_here))
|
||||
|
||||
|
||||
when the above doesn't apply:
|
||||
.proc/procname
|
||||
proc defined on some other type:
|
||||
TYPE_PROC_REF(some_type, procname)
|
||||
Example:
|
||||
CALLBACK(src, .proc/some_proc_here)
|
||||
|
||||
proc defined on a parent of a some type:
|
||||
/some/type/.proc/some_proc_here
|
||||
|
||||
|
||||
|
||||
Other wise you will have to do the full typepath of the proc (/type/of/thing/proc/procname)
|
||||
CALLBACK(other_atom, TYPE_PROC_REF(other_atom_type, procname)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user