Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. local DHMM
  2. local Ignore
  3.  
  4. local MicroMenu = {
  5. AchievementMicroButton,
  6. CharacterBag0Slot,
  7. CharacterBag1Slot,
  8. CharacterBag2Slot,
  9. CharacterBag3Slot,
  10. CharacterMicroButton,
  11. CollectionsMicroButton,
  12. EJMicroButton,
  13. GuildMicroButton,
  14. LFDMicroButton,
  15. MainMenuBarBackpackButton,
  16. MainMenuMicroButton,
  17. MicroButtonAndBagsBar,
  18. QuestLogMicroButton,
  19. SpellbookMicroButton,
  20. StoreMicroButton,
  21. TalentMicroButton,
  22. }
  23.  
  24. local function SetAlpha(Frame)
  25. if Ignore then return end
  26. Ignore = true
  27. if Frame:IsMouseOver() then
  28. Frame:SetAlpha(1)
  29. else
  30. Frame:SetAlpha(0)
  31. end
  32. Ignore = nil
  33. end
  34.  
  35. local function HideMicroMenu()
  36. Ignore = true
  37. for _, Frame in pairs(MicroMenu) do
  38. Frame:SetAlpha(0)
  39. end
  40. Ignore = nil
  41. end
  42.  
  43. local function OnEnter()
  44. if DHMM then DHMM:Cancel() end
  45. Ignore = true
  46. for _, Frame in pairs(MicroMenu) do
  47. Frame:SetAlpha(1)
  48. end
  49. Ignore = nil
  50. end
  51.  
  52. local function OnLeave()
  53. DHMM = C_Timer.NewTimer(.5, HideMicroMenu)
  54. end
  55.  
  56. local function SetupHooks(Frame)
  57. Frame:HookScript("OnEnter", OnEnter)
  58. Frame:HookScript("OnLeave", OnLeave)
  59. end
  60.  
  61. for _, Frame in pairs(MicroMenu) do
  62. hooksecurefunc(Frame, "SetAlpha", SetAlpha)
  63. SetupHooks(Frame)
  64. Frame:SetAlpha(0)
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement