View Single Post
04-30-16, 04:56 PM   #3
Ishayu
A Defias Bandit
Join Date: Feb 2016
Posts: 2
Originally Posted by Folji View Post
My first guess for a decent way to do it would probably be to use hooksecurefunc() to grab the text objects immediately after update and overwrite them with new data, though that might lead to some brief flicks in which the original text shows before it changes.

A common strategy for such things is to get rid of the original element by either going ClearAllPoints() or SetParent(SomeHiddenDummyFrame). And then write your own text update functions.
So the hooking strategy is the one that I originally tried using, and it sounds like a decent idea at first, but in practice it very quickly gets ridiculous.

For example, attempting to apply this in a consistent manner to PitBull4 or Shadowed Unit Frames, which have complicated tagging features. I end up having to redefine every single tag! And I have to do it for a big chunk of unit frame addons.

This approach allows me to simply tamper with the data before it enters.

I can of course sidestep the problem by simply telling people not to use the standard frames together with the addon, which is probably what I'll do for the time being. Either that, or I'll offer two different versions depending on people's needs.

Also, I'm not quite sure I understand why this is even happening. It didn't happen in 6.2.3. I'm not saying what I'm doing is pretty by any stretch, but why would changing that function taint the entire "UNIT_HEALTH" event and every function called because of it? The problem does not appear for UnitHealthMax, UnitPower, UnitPowerMax, GetManaRegen, etc.

Last edited by Ishayu : 04-30-16 at 04:59 PM.
  Reply With Quote