diff --git a/Changelog and Notes.txt b/Changelog and Notes.txt index 4b81cd8..1d80ac7 100644 --- a/Changelog and Notes.txt +++ b/Changelog and Notes.txt @@ -26,8 +26,6 @@ Manage Debuffs - Test IT in fight. Auto-Spirit Res. - Add function to auto ressurect once interracted with Spirit Healer -MinimapEnhance - Add Timer module, just like ShaguTweaks. - ManageBuff - Fix the weapon enhancements not scale correct! Faster Loot - Make the config option to change size of error frame with test messages @@ -163,3 +161,5 @@ AutoSellJunk - Make user able to shift click the item to add to "keep list" AutoSellJunk - Make user be able to alt-ctrl (or other bind) click on an item in bag to sell the item on next vendor visit. AutoSellJunk - The editbox must be scrollable. + +MinimapEnhance - Add Timer module, just like ShaguTweaks. diff --git a/Leatrix_Plus.lua b/Leatrix_Plus.lua index f3b567e..ca430c5 100644 --- a/Leatrix_Plus.lua +++ b/Leatrix_Plus.lua @@ -6107,6 +6107,38 @@ end end end + -- Set hover scripts for all buttons + local function SetupButtonHoverScripts() + for _, button in pairs(minimapButtons) do + if button then + button:HookScript("OnEnter", function() + -- Show all buttons when hovering over one + for _, btn in pairs(minimapButtons) do + btn:SetAlpha(1) + end + end) + button:HookScript("OnLeave", function() + -- Hide buttons if mouse is not over minimap or any button + if not Minimap:IsMouseOver() then + local mouseOverAny = false + for _, btn in pairs(minimapButtons) do + if btn:IsMouseOver() then + mouseOverAny = true + break + end + end + if not mouseOverAny then + for _, btn in pairs(minimapButtons) do + btn:SetAlpha(0) + end + end + end + end) + end + end + end + + local function HideMinimapButtons() local searchStr = LeaPlusDB["MiniExcludeList"] @@ -6230,6 +6262,7 @@ -- Finally, we create a timer that will capture new minimap children every 0.5 seconds. LibCompat.NewTicker(1, function() GetMinimapChildren() + SetupButtonHoverScripts() -- Apply hover scripts to each button end) -- We set up the minimap to respond to mouse events. @@ -6244,7 +6277,7 @@ ticks = ticks + 1 -- increment the tick counter -- print("tick #".. ticks) HideMinimapButtons() - if ticks >= 10 then + if ticks >= 4 then -- stop after 6 seconds have passed (20 ticks * 0.3 seconds per tick) LibCompat.CancelTimer(ticker) -- stop the timer end