Thread: oUF_Phanx edit
View Single Post
04-29-13, 07:30 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It's in the OnCastbarUpdate function, which I assume is used as "castbar.OnUpdate = ns.cast.OnCastbarUpdate" in the actual frame creation code. However, I'm not really sure how that would produce a reasonably visible effect, as the code simply reduces the alpha by 20% in each OnUpdate -- assuming you start at 100%, it would only take 5 frame draws to completely hide the frame. Even at 30 FPS, that means the bar is disappearing in 1/6th of a second. At 60 FPS, it's disappearing in 1/10th of a second. It would be better to use an actual animation so your fade duration wasn't dependent on your framerate. But, it should work as written, assuming you attach the relevant functions to the castbar on frame creation.

On a side note, the "local currentTime = GetTime()" line in the OnCastBarUpdate is just a wasted function call, since the variable is never used. Also, I have no idea why "cast" is defined as a frame, instead of a simple table; if a container object isn't a visible UI, and you're not registering for events or setting scripts, it should just be a table.
__________________
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