register_callback
Registers a "frozen" callback handler,
For example, this code:
register_callback("on_script_unloaded", my_unload_handler) function my_unload_handler() print("handling unload!") endwould call the
my_unload_handlerfunction, whenever theon_script_unloadedcallback is triggered, which is when your script is about to be unloaded.Registered callbacks take precedence over free-standing function callbacks, i.e. the below top level function:
function on_script_unloaded() print("freestanding unload handler!") endwould be a valid handler, but if a registered callback existed, it would be called instead.
Arguments
| Name | Type | Documentation |
|---|---|---|
| callback | String | the callback label to register this function against. |
| function | DynamicFunction | the callback function which will be stored as a handler for this callback label. |
Returns
| Name | Type | Documentation |
|---|---|---|
| arg0 | () | No Documentation 🚧 |