pub fn register_hook_function(
lua: &Lua,
registry: SharedHookRegistry,
component_id: ComponentId,
) -> Result<(), LuaError>Expand description
Registers the orcs.hook() function on the orcs global table.
Requires:
registry— the shared hook registry for storing hookscomponent_id— the owning component (forregister_owned())
The registered hooks are automatically cleaned up when
HookRegistry::unregister_by_owner() is called with the same
component ID (typically on component shutdown).
§Errors
Returns an error if Lua function creation or table insertion fails.