View Single Post
08-21-14, 09:03 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I'm pretty sure there are events that fire when these stats changed, so there's no reason to use an OnUpdate script here. Just register for the event(s) that tell you when your stats change, and update when they fire:

Code:
local f = CreateFrame("Frame")
f:RegisterEvent("HEY_YOUR_STATS_CHANGED") -- not the real event name
f:RegisterEvent("SOME_OTHER_EVENT")
f:SetScript("OnEvent", function(self, event, ...)
     -- update the display here
end)
Use the /eventtrace command in-game, do something that changes your stats, and look in the window to see which event fired. I recommend either doing this far away from other players, or leaving /eventtrace open for a minute beforehand and removing all the irrelevant events that are filling the window (hover and click the X).
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote