Reply
Thread Tools Display Modes
Unread 03-21-12, 06:54 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,341
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"]
  4.  
  5.     local ag1, ag2, a1, a2
  6.  
  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
  15.  
  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
  24.  
  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)
  31.  
  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)
  38.  
  39.     crfm:SetAlpha(0)
  40.  
  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)
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

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

Last edited by zork : 03-21-12 at 06:58 PM.
zork is offline   Reply With Quote
Unread 11-28-13, 07:53 PM   #2
Goldpaw
A Cyclonian
 
Goldpaw's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 45
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)
__________________
http://www.friendlydruid.com/
Goldpaw is online now   Reply With Quote
Unread 11-29-13, 01:56 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,341
My post is outdated.

DO NOT TOUCH THE RAID FRAME MANAGER OR YOU WILL REGRET IT!

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.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

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

Last edited by zork : 11-29-13 at 02:02 AM.
zork is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » Fading the raidframe manager

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off