Yes it in the OnUpdate function. And the fade-out effect looks normal to me. Takes about a second to fade out. It may be better to use animation as you mentioned, but i'm clueless on how to use it so its out of the question.
This is the closest thing i have to seeing a fadeout effect:
Code:
function ns.OnCastbarUpdate(self, elapsed)
local alpha = self:GetAlpha() - 0.02
if alpha > 0 then
self:SetAlpha(alpha)
else
self.fadeOut = nil
self:Hide()
end
end
end
Fade out instantly on cast and does not show up again. The code makes no sense.
I also tried to implement a cast failed color and channel tick marks.
Code:
Castbar.PostCastFailed = ns.PostCastFailed i frames.lua and
function ns.PostCastFailed(self, event, unit, name, rank, castid)
self:SetStatusBarColor(1, 0, 1)
self:SetValue(self.max)
if not self.fadeOut then
self.fadeOut = true
end
self:Show()
end
and this in PostCastStart.
Code:
if self.casting then
cast.setBarTicks(self, 0)
else
local spell = UnitChannelInfo(unit)
self.channelingTicks = channelingTicks[spell] or 0
cast.setBarTicks(self, self.channelingTicks)
end
(local channelingTicks and function ns.setBarTicks there aswell
Nothing. I feel like a complete idiot messing around with this stuff:S
So to sum it up, this is what i'm trying to achieve: fade-out effect, channel tick marks, interrupt/failed color and successful cast color.