From 3a9168b69355f1d1c337e5dd2dfe9a07ed6e16fd Mon Sep 17 00:00:00 2001 From: Lars Norberg Date: Fri, 18 Oct 2024 22:15:24 +0200 Subject: [PATCH] manually add PatTheMav's fix --- AzeriteUI/Components/Misc/Minimap.lua | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/AzeriteUI/Components/Misc/Minimap.lua b/AzeriteUI/Components/Misc/Minimap.lua index 4d6d9ac..2faaeca 100644 --- a/AzeriteUI/Components/Misc/Minimap.lua +++ b/AzeriteUI/Components/Misc/Minimap.lua @@ -833,6 +833,53 @@ MinimapMod.CreateCustomElements = function(self) self.mail = mail + -- Addon Compartment + if (ns.IsRetail) then + local addonCompartment = self.Objects.Addons + if (addonCompartment) then + local addons = CreateFrame("DropdownButton", nil, Minimap) + addons:SetPoint("BOTTOMRIGHT", -252, 43) + addons:SetSize(16, 16) + + addons:SetupMenu(addonCompartment.menuGenerator) + + local addonsAnchor = AnchorUtil.CreateAnchor("BOTTOMRIGHT", addons, "TOPLEFT", 0, 0) + addons:SetMenuAnchor(addonsAnchor) + + addons:SetScript("OnEnter", function(self) + addons:SetAlpha(.95) + + if (GameTooltip:IsForbidden()) then return end + + GameTooltip_SetDefaultAnchor(GameTooltip, self) + GameTooltip_SetTitle(GameTooltip, ADDONS) + GameTooltip:Show() + end) + + addons:SetScript("OnLeave", function(self) + addons:SetAlpha(.5) + + if (GameTooltip:IsForbidden()) then return end + + GameTooltip:Hide() + end) + + local addonsText = addons:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall") + addonsText:SetText(addonCompartment:GetText()) + addonsText:SetPoint("CENTER") + addons:SetFontString(addonsText) + addons.text = addonsText + + hooksecurefunc(addonCompartment, "UpdateDisplay", function(self) + addonsText:SetText(self:GetText()) + end) + + addons:SetAlpha(.5) + + self.addonCompartment = addons + end + end + local dropdown = nil -- This is broken?