Thread: UIFrameFade
View Single Post
06-10-11, 11:54 AM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
UIFrameFade

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:
  1. local f = CreateFrame('Frame')
  2.             f:RegisterEvent('PLAYER_TARGET_CHANGED')
  3.             f:RegisterEvent('PLAYER_FOCUS_CHANGED')
  4.             f:RegisterEvent("UNIT_SPELLCAST_SENT")
  5.             f:RegisterEvent("UNIT_SPELLCAST_START")
  6.             f:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
  7.             f:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
  8.             f:RegisterEvent("UNIT_SPELLCAST_STOP")
  9.             f:RegisterEvent('UNIT_SPELLCAST_FAILED')
  10.             f:RegisterEvent('UNIT_SPELLCAST_INTERRUPTED')
  11.             f:RegisterEvent('UNIT_SPELLCAST_DELAYED')
  12.             f:RegisterEvent('UNIT_SPELLCAST_CHANNEL_UPDATE')
  13.             f:RegisterEvent('UNIT_SPELLCAST_CHANNEL_INTERRUPTED')
  14.             f:SetScript('OnEvent', function(event)
  15.                     if unit == "player" or unit == "target" or unit == "focus" or unit == "pet" then
  16.                         if self.Castbar then
  17.                             if event == "UNIT_SPELLCAST_START" or event == "UNIT_SPELLCAST_CHANNEL_START" then
  18.                                 UIFrameFadeIn(self.Castbar, 0.8, self.Castbar:GetAlpha(), 1)
  19.                             elseif event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_SENT" or event == "UNIT_SPELLCAST_FAILED" then
  20.                                 UIFrameFadeOut(self.Castbar, 0.8, self.Castbar:GetAlpha(), 0.2)
  21.                             end
  22.                         end
  23.                     end
  24.                 end
  25.             end)
  26.         end
  27.     end
  Reply With Quote