Hello there, i have a minor problem, i don't know it's not working but i'm trying to do a framefade, with castbars, and it's not working. Any reasons?
LUA Code:
local f = CreateFrame('Frame')
f:RegisterEvent('PLAYER_TARGET_CHANGED')
f:RegisterEvent('PLAYER_FOCUS_CHANGED')
f:RegisterEvent("UNIT_SPELLCAST_SENT")
f:RegisterEvent("UNIT_SPELLCAST_START")
f:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
f:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
f:RegisterEvent("UNIT_SPELLCAST_STOP")
f:RegisterEvent('UNIT_SPELLCAST_FAILED')
f:RegisterEvent('UNIT_SPELLCAST_INTERRUPTED')
f:RegisterEvent('UNIT_SPELLCAST_DELAYED')
f:RegisterEvent('UNIT_SPELLCAST_CHANNEL_UPDATE')
f:RegisterEvent('UNIT_SPELLCAST_CHANNEL_INTERRUPTED')
f:SetScript('OnEvent', function(event)
if unit == "player" or unit == "target" or unit == "focus" or unit == "pet" then
if self.Castbar then
if event == "UNIT_SPELLCAST_START" or event == "UNIT_SPELLCAST_CHANNEL_START" then
UIFrameFadeIn(self.Castbar, 0.8, self.Castbar:GetAlpha(), 1)
elseif event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_SENT" or event == "UNIT_SPELLCAST_FAILED" then
UIFrameFadeOut(self.Castbar, 0.8, self.Castbar:GetAlpha(), 0.2)
end
end
end
end
end)
end
end