View Single Post
12-14-11, 02:54 PM   #23
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I looked again at my raidframe manager code. UIFrameFadeIn is actually causing a taint in combat. Probably because there is any hide or whatever involved.

I could add an animationgroup myself but actually just doing this works fine aswell:
lua Code:
  1. local crfm = _G["CompactRaidFrameManager"]
  2.     local crfb = _G["CompactRaidFrameManagerToggleButton"]
  3.  
  4.     local ag1, ag2, a1, a2
  5.  
  6.     --fade in anim
  7.     ag1 = crfm:CreateAnimationGroup()
  8.     a1 = ag1:CreateAnimation("Alpha")
  9.     a1:SetDuration(0.4)
  10.     a1:SetSmoothing("OUT")
  11.     a1:SetChange(1)
  12.     ag1.a1 = a1
  13.     crfm.ag1 = ag1
  14.  
  15.     --fade out anim
  16.     ag2 = crfm:CreateAnimationGroup()
  17.     a2 = ag2:CreateAnimation("Alpha")
  18.     a2:SetDuration(0.3)
  19.     a2:SetSmoothing("IN")
  20.     a2:SetChange(-1)
  21.     ag2.a2 = a2
  22.     crfm.ag2 = ag2
  23.  
  24.     crfm.ag1:SetScript("OnFinished", function(ag1)
  25.       local self = ag1:GetParent()
  26.       if not self.ag2:IsPlaying() then
  27.         self:SetAlpha(1)
  28.       end
  29.     end)
  30.  
  31.     crfm.ag2:SetScript("OnFinished", function(ag2)
  32.       local self = ag2:GetParent()
  33.       if not self.ag1:IsPlaying() then
  34.         self:SetAlpha(0)
  35.       end
  36.     end)
  37.  
  38.     crfm:SetAlpha(0)
  39.  
  40.     crfm:SetScript("OnEnter", function(m)
  41.       if m.collapsed and not m.ag1:IsPlaying() then
  42.         m.ag2:Stop()
  43.         m:SetAlpha(0)
  44.         m.ag1:Play()
  45.       end
  46.     end)
  47.     crfm:SetScript("OnMouseUp", function(self)
  48.       if self.collapsed and not InCombatLockdown() then
  49.         CompactRaidFrameManager_Toggle(self)
  50.       end
  51.     end)
  52.     crfb:SetScript("OnMouseUp", function(self)
  53.       local m = self:GetParent()
  54.       if not m.collapsed and not m.ag2:IsPlaying() then
  55.         m.ag1:Stop()
  56.         m:SetAlpha(1)
  57.         m.ag2:Play()
  58.       end
  59.     end)
  60.     crfm:SetScript("OnLeave", function(m)
  61.       if m.collapsed and GetMouseFocus():GetName() == "WorldFrame" and not m.ag2:IsPlaying() then
  62.         m.ag1:Stop()
  63.         m:SetAlpha(1)
  64.         m.ag2:Play()
  65.       end
  66.     end)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 12-14-11 at 04:43 PM.
  Reply With Quote