Quantcast
WoWInterface - View Single Post - [AceAddon-3.0] Module doesn't fire OnEnable/OnDisable function
View Single Post
12-31-17, 08:59 PM   #8
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,111
Lua Code:
  1. function myaddon:OnEnable()
  2.     self:RegisterEvent("SOME_EVENT")
  3.  
  4.     -- now call it if you need it right away
  5.     self:SOME_EVENT()
  6. end
  7.  
  8. function myaddon:OnDisable()
  9.     self:UnregisterEvent("SOME_EVENT")
  10.     -- or
  11.     self:UnregisterAllEvents()
  12.  
  13. function myaddon:SOME_EVENT()
  14.     -- handle it
  15. end
  Reply With Quote