515 Compatibility (#19636)

* 515 compat

* double spaces

* Callback documentation, aa review

* spacing

* NAMEOF_STATIC

* big beta
This commit is contained in:
S34N
2022-11-08 23:08:40 +00:00
committed by GitHub
parent 2e7e556383
commit 667dd5d4ac
378 changed files with 928 additions and 919 deletions
+11 -19
View File
@@ -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)
*/