WoWInterface (
-   Tutorials & Other Helpful Info. (
-   -   Fading the raidframe manager (

zork 03-21-12 06:54 PM

Fading the raidframe manager
I fiddled a while since I got it. The following solution uses animationgroups to show/hide the raidframe manager. It will work in combat and does not cause taints.

The raidframe manager will be hidden until you hover the frame in collapsed state.

lua Code:
  1. --fade the raid frame manager
  2.     local crfm = _G["CompactRaidFrameManager"]
  3.     local crfb = _G["CompactRaidFrameManagerToggleButton"]
  5.     local ag1, ag2, a1, a2
  7.     --fade in anim
  8.     ag1 = crfm:CreateAnimationGroup()
  9.     a1 = ag1:CreateAnimation("Alpha")
  10.     a1:SetDuration(0.4)
  11.     a1:SetSmoothing("OUT")
  12.     a1:SetChange(1)
  13.     ag1.a1 = a1
  14.     crfm.ag1 = ag1
  16.     --fade out anim
  17.     ag2 = crfm:CreateAnimationGroup()
  18.     a2 = ag2:CreateAnimation("Alpha")
  19.     a2:SetDuration(0.3)
  20.     a2:SetSmoothing("IN")
  21.     a2:SetChange(-1)
  22.     ag2.a2 = a2
  23.     crfm.ag2 = ag2
  25.     crfm.ag1:SetScript("OnFinished", function(ag1)
  26.       local self = ag1:GetParent()
  27.       if not self.ag2:IsPlaying() then
  28.         self:SetAlpha(1)
  29.       end
  30.     end)
  32.     crfm.ag2:SetScript("OnFinished", function(ag2)
  33.       local self = ag2:GetParent()
  34.       if not self.ag1:IsPlaying() then
  35.         self:SetAlpha(0)
  36.       end
  37.     end)
  39.     crfm:SetAlpha(0)
  41.     crfm:SetScript("OnEnter", function(m)
  42.       if m.collapsed and m:GetAlpha() < 0.8 then
  43.         m.ag2:Stop()
  44.         m:SetAlpha(0)
  45.         m.ag1:Play()
  46.       end
  47.     end)
  48.     crfm:SetScript("OnMouseUp", function(self)
  49.       if self.collapsed and not InCombatLockdown() then
  50.         CompactRaidFrameManager_Toggle(self)
  51.       end
  52.     end)
  53.     crfb:SetScript("OnMouseUp", function(self)
  54.       local m = self:GetParent()
  55.       if not m.collapsed then
  56.         m.ag2:Play()
  57.       end
  58.     end)
  59.     crfm:SetScript("OnLeave", function(m)
  60.       if m.collapsed and GetMouseFocus():GetName() ~= "CompactRaidFrameManagerToggleButton" and GetMouseFocus():GetName() ~= "CompactRaidFrameManager" then
  61.         m.ag1:Stop()
  62.         m:SetAlpha(1)
  63.         m.ag2:Play()
  64.       end
  65.     end)

Goldpaw 11-28-13 07:53 PM

Hi there!

I ran into some problems trying to use this method today. This is on the 5.4.1 client patch.

The fading of the raidframe manager and its button worked perfectly. Taint free, functional in combat, and totally awesome. The problem was that the raidframes too faded, while their backdrops remained visible. My intention was of course to have the frames wholly visible (or hidden as decided by the user), while having the raidframe manager button only visible on hover.

So I tried parenting the CompactRaidFrameContainer which is the parent of all the compact raidframes to UIParent to prevent it from being a slave to the fade animation, and it appears to be working so far. No taints or bugs, and I tested it in a few Battlegrounds where people frequently come and go during combat.

The issue doesn't appear to affect the compact party frames, as they are already parented to UIParent.

Anyway, hope this addition is of help to whomever sees it, and keep up the awesome work, Zork. Your addons are a true inspiration! :)

lua Code:
  1. -- prevent the frames themselves from fading out
  2.     local crfc = _G["CompactRaidFrameContainer"]
  3.     crfc:SetParent(UIParent)

zork 11-29-13 01:56 AM

My post is outdated.


You heard me. I wrote my own raid manager now and just disabled the Blizzard raid addons.

Regarding the raidframes being faded...well that is because the raidframes are anchored to the raid frame manager. I did not recognize this because I was using my own raidframes.

All times are GMT -6. The time now is 11:12 PM.

vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI