Name | Type | Deprecated | Secure | Description |
---|---|---|---|---|
Command.Event.Attach | function | Attaches an event handler to an event. | ||
Command.Event.Detach | function | Detaches an event handler from an event. Any parameter can be 'nil', and this is interpreted as a... | ||
Inspect.Event.List | function | Lists the current event handlers for an event. | ||
Utility.Event.Create | function | Creates a custom event. Takes an identifier and an event path as parameters. Called with Create("... |
Attaches an event handler to an event.
Command.Event.Attach(event, handler, label) | |||
Command.Event.Attach(event, handler, label, priority) | |||
Parameter | Type | Datatype | Description |
---|---|---|---|
event | parameter | eventGlobal | A global event handle, usually pulled out of the "Event." hierarchy. |
handler | parameter | function | A global event handler function. This will be called when the event fires. The first parameter will be the standard global event handle, any other parameters will follow that. |
label | parameter | string | Human-readable label used to identify the handler in error reports, performance reports, and for later detaching. |
priority | parameter | number | Priority of the event handler. Higher numbers trigger first. |
Detaches an event handler from an event. Any parameter can be 'nil', and this is interpreted as a wildcard. If multiple events match the constraints, only one will be detached.
Command.Event.Detach(event, handler) | |||
Command.Event.Detach(event, handler, label) | |||
Command.Event.Detach(event, handler, label, priority) | |||
Command.Event.Detach(event, handler, label, priority, owner) | |||
Parameter | Type | Datatype | Description |
---|---|---|---|
event | parameter | eventGlobal | A global event handle, usually pulled out of the "Event." hierarchy. |
handler | parameter | function/nil | A global event handler function. This will be called when the event fires. The first parameter will be the standard global event handle, any other parameters will follow that. |
label | parameter | string/nil | Human-readable label used to identify the handler in error reports, performance reports, and for later detaching. |
owner | parameter | string/nil | Owner to search for. |
priority | parameter | number/nil | Priority of the event handler. Higher numbers trigger first. |
Lists the current event handlers for an event.
result = Inspect.Event.List(event) | |||
Parameter | Type | Datatype | Description |
---|---|---|---|
event | parameter | eventGlobal | A global event handle, usually pulled out of the "Event." hierarchy. |
result | result | table | A table of event handlers for this event. |
handler | The handler that will be called when the event fires. |
---|---|
label | Label assigned to the event handler at creation. |
owner | Owner addon for the event handler. |
priority | Priority for the event handler. |
Creates a custom event. Takes an identifier and an event path as parameters. Called with Create("Identifier", "The.Event.Path") the event table will end up at Event.Identifier.The.Event.Path, and will behave like a standard Rift event table in every way. Undefined behavior if given an identifier or a path that conflicts with a built-in Rift event or an existing addon event.
caller, handle = Utility.Event.Create(identifier, event) | |||
Parameter | Type | Datatype | Description |
---|---|---|---|
event | parameter | string | The event's name. "." characters will be treated as hierarchy delimeters. |
identifier | parameter | string | The identifier of the addon creating this event. |
caller | result | function | A function used to trigger the event. Called with any selection of parameters, it will pass those parameters through to properly registered event handlers in order. Any errors caused by those event handlers will be caught and handled. |
handle | result | table | The resulting event handle. |