View Single Post
09-02-12, 05:25 PM   #1
Irongunner
A Deviate Faerie Dragon
Join Date: Mar 2011
Posts: 11
Problem with castbar icon in PostCastStart

Hey guys,

I am using parts of oUF_Hank in my own oUF layout. My castbar is based on the one in his addon. It has some nice fading animations based on whether the cast succeeded or not. To achieve this, a second 'dummy' castbar is used for playing the animation. In the PostCastStart function the texture of the spell icon, currently used in the 'real' castbar needs to be set in the 'dummy' castbar, so that the icon can be shown during the fade animation.

Here is the interesting part of the code from oUF_Hank:

Lua Code:
  1. oUF_Hank.PostCastStart = function(castbar, unit, name, rank, castid)
  2.     ...
  3.     castbar.Dummy.Icon:SetTexture(castbar.Icon:GetTexture())
  4.     ...

Unfortunately the GetTexture() call sometimes returns nil, so that the fading animation shows an icon from a previous cast. Is there a way to get the texture 100% of the time?

Bests
Iron
  Reply With Quote