Lore archive · Warcraft Wiki, 2023 dump
EventRegistry
Last wiki revision 2023-01-10
EventRegistry is a FrameXML utility library for handling callbacks, similar to CallbackHandler-1.0. It inherits from CallbackRegistryMixin
- Source: SharedXML\GlobalCallbackRegistry.lua
- CallbackRegistryMixin:RegisterCallback( event, func, [owner], ... ) : owner - Registers a callback to a custom defined event.
- CallbackRegistryMixin:UnregisterCallback( event, owner )
- CallbackRegistryMixin:TriggerEvent( event, ... ) - Fires a callback event.
- EventRegistry:RegisterFrameEventAndCallback( frameEvent, func, [owner], ... ) : owner - Registers a callback to a Frame Event (e.g. PLAYER_ENTERING_WORLD)
- EventRegistry:UnregisterFrameEventAndCallback( frameEvent, owner )
- There is a caveat, if one of the functions registered through the event registry takes too long to execute (script timeouts) then all the other callbacks for the same event in the registry may also not get executed.
- EventRegistry events and their payload are shown in the Event Trace panel when triggered.
- EventRegistry_01.png
A common use case is to register for Blizzard callback events, for example when the Mount Journal is opened.
Registers two callbacks to a custom event.
Callbacks are unregistered by owner handle. When registering a callback the owner can be a table, function or string; if omitted it will be assigned an internal number.
This allows you to respond to events without having to create a frame and registering an event to it.
Creates your own CallbackRegistry object instead of using EventRegistry.
for
Source
https://warcraft.wiki.gg/wiki/EventRegistry · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.