Boss frames not working anymore
View Single Post
04-04-13, 08:18 PM
A Pyroguard Emberseer
Join Date: Mar 2006
Originally Posted by
I asume the Blizzard event dispatcher is C coded, but they set an OnUpdate script for the stock frames instead of registering UNIT_HEALTH_FREQUENT. Why would they do that? The only reason I could think of would be that UNIT_HEALTH_FREQUENT does not work like other events and simply sets an OnUpdate script on the frame it gets registered to.
It doesn't, as you can set your own OnUpdate script without preventing UNIT_HEALTH_FREQUENT from working. The only difference between UNIT_HEALTH and UNIT_HEALTH_FREQUENT is that the former only fires every 0.2 seconds, while the latter fires more often (I'm not sure exactly how often). There's just a bug in Blizzard's code right now that prevents UNIT_HEALTH from firing for boss units. It's not because the event itself is mysteriously "different" from other events; it's just a coincidence that the two events are so closely related. It could just as easily be UNIT_POWER that was bugged, or UNIT_NAME_UPDATE, or UNIT_AURA, or anything else.
As for Blizzard's code using OnUpdate scripts instead of UNIT_HEALTH_FREQUENT, there are two equally likely reasons for that:
1) They actually want to use UNIT_HEALTH, but the UI coders know it's bugged, and are using an OnUpdate script as a temporary workaround until the C coders fix the bug.
2) The code was written before UNIT_HEALTH_FREQUENT existed, and the UI coders have just not bothered updating it. You can see lots of examples of this throughout the Blizzard UI code.
Originally Posted by
OnUpdate is also a kind of event handler reacting to the event of refreshing the screen, isn't it?
You could think of it that way, but that's not really accurate. In layman's terms, redrawing the screen is an "event", but in WoW API terms, it's not, as that term is reserved for the specific meaning as relates to RegisterEvent etc.
Troubleshoot an addon
Turn any code into an addon
More addon resources
Need help with your code?
code! Attach or
Please don’t PM me
about addon bugs or code questions. Post a comment or forum thread instead!
View Public Profile
Send a private message to Phanx
Find More Posts by Phanx