-
Notifications
You must be signed in to change notification settings - Fork 20
event_object
local event = require('event')
local event_object = event.new()
Event objects are used as a mechanism to call previously registered functions at certain in-game or Windower specific events.
An event object contains the following functions:
- event_object:register : Registers a function to execute on a certain event
- event_object:unregister : Removes a function from the event registry
- event_object:trigger : Executes functions registered with the event object
Registers a function to execute for a certain event. The parameters to the specified function will be whatever trigger
passes in.
function event_object:register(fn : function)
fn function
The function to execute. Should be able to receive whichever arguments are passed in by
trigger
.
This function does not return any values.
Removes a function from the event registry for this event. After this, it will no longer be called by trigger
.
function event_object:unregister(fn : function)
fn function
The function to remove from the registry.
This function does not return any values.
Executes all functions registered to this event.
function event_object:register(...args: any)
...args any
Can be any type and number of arguments. Are passed to the registered functions in the same order. For regular events all caveats of serialization and deserialization apply. See the serializer documentation for more details.
This function does not return any values.
- Background and Architecture
- Windower Data Locations
- Code Standards and Guidelines
- Addon Development
- Windower Commands
- Packet Tutorial
- burdometer
- config
- delay_me_not
- distance
- dress_up
- enternity
- fps
- ime
- logger
- party_time
- paste
- pouches
- send
- shortcuts
- speedometer
- target_info
- terminate
- timestamp
- window_title
- Game
- Windower
- General