View Single Post
03/17/23, 01:01 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,001
Events: https://wiki.esoui.com/Events
Event filters: https://wiki.esoui.com/AddFilterForEvent

Registering your event callback function:

Lua Code:
  1. local function callbackFuncForThisEvent(eventI, param1, param2)
  2.  --do your stuff here
  3. end
  4. EVENT_MANAGER:RegisterForEvent("UniqueNameHere_forExmaple_MyAddon_EVENT_ADD_ON_LOADED", EVENT_ADD_ON_LOADED, callbackFuncForThisEvent)

Unregistering your event callback function if not needed anymore
Lua Code:
  1. EVENT_MANAGER:UnregisterForEvent("SameUniqueNameHereWhchWasUsedToReisterIt_inThisExample_MyAddon_EVENT_ADD_ON_LOADED", EVENT_ADD_ON_LOADED)
  Reply With Quote