View Single Post
08-24-14, 10:14 AM   #8
MaLarsson
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 13
I feel that it is a good practice to always check which events you want to listen to before beginning with the code.
Wowwiki has a list of all the events: http://www.wowwiki.com/Events_A-Z_(Full_List)
You can try adding something like this to your code:
Lua Code:
  1. local frame, events = CreateFrame("Frame", nil, UIParent), {}
  2.  
  3. function events:UNIT_STATS(unitID)
  4.    if unitID == "player" then
  5.       updateFunction()
  6.    end
  7. end
  8.  
  9. function events:COMBAT_RATING_UPDATE()
  10.    updateFunction()
  11. end
  12.  
  13. for k, v in pairs(events) do
  14.    frame:RegisterEvent(k)
  15. end
  Reply With Quote