Skip to content

Commit

Permalink
Minimap handynotes fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Aug 24, 2024
1 parent e94a6ef commit 363b784
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions Modules/Minimap/Minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,26 @@ function module:SetupExpansionButton()
-- end)
end

local isFrameIgnored = function(item)
local ignored = { 'HybridMinimap', 'AAP-Classic', 'HandyNotes' }
local WildcardIgnore = { 'Questie', 'HandyNotes' }
if not item or not item.GetName then return false end

local name = item:GetName()
if name ~= nil then
if SUI:IsInTable(ignored, name) then return true end

for _, v in ipairs(WildcardIgnore) do
if string.match(name, v) then return true end
end
end
return false
end

function module:SetupAddonButtons()
local function setupButtonFading(button)
local name = button:GetName()
if isFrameIgnored(name) then print('ignore me!' .. name) end
if button.fadeInAnim then return end -- Already set up

button.fadeInAnim = button:CreateAnimationGroup()
Expand Down Expand Up @@ -489,7 +507,7 @@ function module:SetupAddonButtons()
if event == 'ADDON_LOADED' then
C_Timer.After(0.1, function()
for _, child in ipairs({ self:GetChildren() }) do
if child:IsObjectType('Button') and not child.fadeInAnim then
if child:IsObjectType('Button') and not child.fadeInAnim and not isFrameIgnored(child) then
setupButtonFading(child)
child:HookScript('OnEnter', showAllButtons)
child:HookScript('OnLeave', hideAllButtons)
Expand All @@ -509,15 +527,15 @@ function module:UpdateAddonButtons()
local style = module.Settings.elements.addonButtons.style
if style == 'always' then
for _, child in ipairs({ Minimap:GetChildren() }) do
if child:IsObjectType('Button') then child:SetAlpha(1) end
if child:IsObjectType('Button') and not isFrameIgnored(child) then child:SetAlpha(1) end
end
elseif style == 'never' then
for _, child in ipairs({ Minimap:GetChildren() }) do
if child:IsObjectType('Button') then child:SetAlpha(0) end
if child:IsObjectType('Button') and not isFrameIgnored(child) then child:SetAlpha(0) end
end
else -- "mouseover"
for _, child in ipairs({ Minimap:GetChildren() }) do
if child:IsObjectType('Button') then
if child:IsObjectType('Button') and not isFrameIgnored(child) then
child:SetAlpha(0) -- Start hidden
end
end
Expand Down
2 changes: 1 addition & 1 deletion Modules/Nameplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ local NameplateCallback = function(self, event, unit)
end
end
end
-- self.Name:Show()
self.Name:Show()

self.widgetContainer:SetParent(self)
self.widgetContainer:ClearAllPoints()
Expand Down

0 comments on commit 363b784

Please sign in to comment.