From 341ba95561bb5e69c05d6a1a9910209f2c7cd648 Mon Sep 17 00:00:00 2001 From: Seraphic8x2244 <52291933+Seraphic8x2244@users.noreply.github.com> Date: Fri, 23 Oct 2026 02:40:00 +0100 Subject: [PATCH] Fix addon button panel startup visibility (#61) * fix(addonbuttons): rescan before startup visibility check * Fix missing percentage symbols in unitframe labels --- api/unitframes.lua | 4 ++-- modules/addonbuttons.lua | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 677b99e1..4ca1797d 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -2647,7 +2647,7 @@ function pfUI.uf:GetStatusValue(unit, pos) elseif config == "healthmax" then return unit:GetColor("health") .. pfUI.api.Abbreviate(rhpmax) elseif config == "healthperc" then - return unit:GetColor("health") .. ceil(hp / hpmax * 100) + return unit:GetColor("health") .. ceil(hp / hpmax * 100) .. "%" elseif config == "healthmiss" then local health = ceil(rhp - rhpmax) if UnitIsDead(unitstr) then @@ -2700,7 +2700,7 @@ function pfUI.uf:GetStatusValue(unit, pos) return unit:GetColor("power") .. pfUI.api.Abbreviate(mpmax) elseif config == "powerperc" then local perc = UnitPowerMax(unitstr) > 0 and ceil(mp / mpmax * 100) or 0 - return unit:GetColor("power") .. perc + return unit:GetColor("power") .. perc .. "%" elseif config == "powermiss" then local power = ceil(mp - mpmax) if power == 0 then diff --git a/modules/addonbuttons.lua b/modules/addonbuttons.lua index e58c3143..57e670a8 100644 --- a/modules/addonbuttons.lua +++ b/modules/addonbuttons.lua @@ -399,15 +399,16 @@ pfUI:RegisterModule("addonbuttons", function () -- Initial setup on the next frame, once other addons' minimap buttons exist RunNextFrame(function() - -- check if the panel should be shown by default + -- rescan before deciding whether the panel should be shown by default + pfUI.addonbuttons:ProcessButtons() + if C.abuttons.showdefault == "1" and GetNumButtons() > 0 then pfUI.addonbuttons:Show() else pfUI.addonbuttons:Hide() end - -- update all buttons and apply workarounds - pfUI.addonbuttons:ProcessButtons() + -- apply workarounds for k, v in pairs(pfUI.addonbuttons.overrides) do _G[k] = v end