|1.2.0 +1 More release||33.88 KB||Jun 20, 2019||8.1.5||207||Download|
|1.1.0 +1 More release||33.63 KB||Jun 17, 2019||8.1.5||996||Download|
|1.0.0 +1 More release||33.54 KB||Aug 14, 2017||7.2.5||211||Download|
|1.1.0-2-g3688a92-alpha +1 More alpha||33.85 KB||Jun 19, 2019||8.1.5||18||Download|
|1.1.0-1-g37c6f64-alpha +1 More alpha||33.77 KB||Jun 18, 2019||8.1.5||17||Download|
|1.0.0-4-g2b36a0f-alpha +1 More alpha||33.60 KB||Jun 17, 2019||8.1.5||14||Download|
|4d39766-alpha +1 More alpha||33.54 KB||Aug 14, 2017||7.2.5||45||Download|
|af85587-alpha +1 More alpha||33.47 KB||Aug 14, 2017||7.2.5||22||Download|
This is a small addon that allows you to write event handlers in a GUI in-game. Useful if you want to look up the event
arguments, check some state or even save stuff to saved variables.
- you can enable/disable events without losing your handler code
- a default handler displaying all event arguments is provided
- you can write stuff to the addon's SavedVariables from within your handler
- you can register further events and add additional event handlers from within your handlers (use at your own risk)
How to use
/hit in the chat to open the options. Click "New event" or a select an existing one. Edit to your
Anytime you change something, the event will be automatically disabled. Re-enable when you are done.
In your handler you get the following arguments through
..., the same way you get the addon's name and namespace in addons, meaning you can name those whatever you like:
- self – the frame the addon uses for event registration (Frame)
- db – a reference to the addon's global SavedVariables. Use this to save your state if needed (table)
- event – the name of the triggered event (string)
- … – any further event arguments
Calling other event handlers is done by
self is the addon's frame,
event is the event name
... preserves the argument order as above.
The API, in its current state, is not meant to replace or alter the GUI. This is what the GUI uses to (un)register
events and is exposed to you in case you find it useful. The state of the GUI is saved to the addon's SavedVariables.
:AddEvent(data)– used to add a new event, or add further callbacks to its handler. Adding an event means
registering it and attaching the supplied callbacks to make up a handler.
datais a simple associative array as follows:
- event – the name of the event you'd like to register (string)
- unit1 – the first event unit (string or nil)
- unit2 – the second event unit (string or nil)
- handler – the callback(s) you want to use as the event handler (string or function or a table thereof)
NOTE: If you call
:AddEventfor an already added event, it will add the new callbacks instead of rewriting the old
RegisterUnitEventwill be used for event registration potentially
overwriting event units from previous calls.
:RemoveEvent(data)– used to remove an event, where
datais structured as described above. Actually only
data.eventplays a role here. Removing an event means unregistering it und deleting the associated handler.
The GUI is limited to one handler per event. So if you added another handler from code and then edit the event in
the GUI, the handler you added will be detached automatically without notice.
The GUI does not list events and handlers you added from code.
You can file bug reports and issues on the project's page at GitHub.