HideMinimapButtons - lil improve

Initial setup did never show all buttons after hiding if the minimap was not mouseovered.
So we could mouseover a button and never see it.
Should be fixed now!
This commit is contained in:
Sattva
2025-01-22 06:27:17 +03:00
parent 96b86d4962
commit b5f5960c58
2 changed files with 36 additions and 3 deletions
+2 -2
View File
@@ -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.
+34 -1
View File
@@ -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