View Single Post
10-14-17, 02:54 PM   #11
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
My other idea I had worked perfectly, actually.

lua Code:
  1. local isOpen = false
  2.  
  3. local function setAlphaZero()
  4.     if not isOpen then
  5.         CompactRaidFrameManager:SetAlpha(0)
  6.     end
  7. end
  8.  
  9. CompactRaidFrameContainer:SetParent(UIParent)
  10. CompactRaidFrameManager:SetAlpha(0)
  11.  
  12. CompactRaidFrameManager:HookScript("OnEnter", function()
  13.     CompactRaidFrameManager:SetAlpha(1)
  14. end)
  15. CompactRaidFrameManager:HookScript("OnLeave", setAlphaZero)
  16.  
  17. CompactRaidFrameManagerToggleButton:HookScript("OnEnter", function()
  18.     CompactRaidFrameManager:SetAlpha(1)
  19. end)
  20. CompactRaidFrameManagerToggleButton:HookScript("OnLeave", setAlphaZero)
  21.  
  22. CompactRaidFrameManagerToggleButton:HookScript("OnClick", function()
  23.     if isOpen then
  24.         isOpen = false
  25.     else
  26.         isOpen = true
  27.     end
  28. end)

.toc
Code:
## Interface: 70300
## Title: Test
## LoadOnDemand: 1
## LoadWith: Blizzard_RaidUI

Test.lua
The drawer gets hidden when you join a group, and when you mouse over it reappears. When you click the arrow to open the drawer, it registers that the menu is open and keeps Alpha to 1 until the drawer is closed, at which point the code is allowed to set Alpha to 0 again.

Edit: Totally ninjaed by Fizzle with the better solution, though.
  Reply With Quote