Raise pet health text above unit frame artwork

Render Real Health Numbers pet health/power text through a dedicated PetFrame overlay at a higher frame level while preserving the existing 9 px font size and anchors.
This commit is contained in:
Dusk-92
2026-09-08 13:08:04 +02:00
committed by GitHub
parent 05d29bb798
commit 439156479a
+21 -2
View File
@@ -67,12 +67,31 @@ module.enable = function(self)
self.valueTexts.targetHealth = CreateValueText(TargetFrameHealthBar, 10)
self.valueTexts.targetMana = CreateValueText(TargetFrameManaBar, 10)
local petTextParent
if PetFrame and (PetFrameHealthBar or PetFrameManaBar) then
self.petTextOverlay = CreateFrame("Frame", nil, PetFrame)
self.petTextOverlay:SetAllPoints(PetFrame)
local petTextLevel = PetFrame:GetFrameLevel()
if PetFrameHealthBar then
petTextLevel = math.max(petTextLevel, PetFrameHealthBar:GetFrameLevel())
end
if PetFrameManaBar then
petTextLevel = math.max(petTextLevel, PetFrameManaBar:GetFrameLevel())
end
-- Keep the text on PetFrame's strata while rendering it above the
-- nested pet artwork and status bars.
self.petTextOverlay:SetFrameLevel(petTextLevel + 5)
petTextParent = self.petTextOverlay
end
if PetFrameHealthBar then
self.valueTexts.petHealth = CreateValueText(PetFrameHealthBar, 9)
self.valueTexts.petHealth = CreateValueText(petTextParent or PetFrameHealthBar, 9)
end
if PetFrameManaBar then
self.valueTexts.petMana = CreateValueText(PetFrameManaBar, 9)
self.valueTexts.petMana = CreateValueText(petTextParent or PetFrameManaBar, 9)
end
if _G.PlayerFrameAlternatePowerBar then