View Single Post
10-14-17, 04:28 PM   #13
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
I'm going to go with a much cleaner, less error-prone solution, actually.

lua Code:
  1. local function setAlphaZero()
  2.     if not CompactRaidFrameManagerDisplayFrame:IsVisible() then
  3.         CompactRaidFrameManager:SetAlpha(0)
  4.     end
  5. end
  6.  
  7. CompactRaidFrameContainer:SetParent(UIParent)
  8. CompactRaidFrameManager:SetAlpha(0)
  9.  
  10. CompactRaidFrameManager:HookScript("OnEnter", function() CompactRaidFrameManager:SetAlpha(1) end)
  11. CompactRaidFrameManager:HookScript("OnLeave", setAlphaZero)
  12.  
  13. CompactRaidFrameManagerToggleButton:HookScript("OnEnter", function() CompactRaidFrameManager:SetAlpha(1) end)
  14. CompactRaidFrameManagerToggleButton:HookScript("OnLeave", setAlphaZero)

I tried replacing the hooks on ToggleButton with an extra CompactRaidFrameManager:IsMouseOver() check, like what Fizzle did, but it gave wonky results where the side bar remains visible when you close the raid frame manager drawer, until you manually move your mouse back over and away again to "refresh" it, so I'll probably keep it like that.
  Reply With Quote