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!") end
would call the
my_unload_handler
function, whenever theon_script_unloaded
callback 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!") end
would 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 🚧 |