Quantcast
WoWInterface - View Single Post - Simple Nameplate Addon help needed
View Single Post
04-22-21, 05:25 AM   #2
L3n1n
A Deviate Faerie Dragon
 
L3n1n's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 10
I know this is necroposting but i wrote solution for you:

Code:
hooksecurefunc("CompactUnitFrame_UpdateStatusText", function(frame)
	if frame:IsForbidden() then return end
	if frame.statusText then return end

	if not frame.healthBar.value then
		frame.healthBar.value = frame.healthBar:CreateFontString("$parentHeathValue", "OVERLAY")
		frame.healthBar.value:SetPoint("CENTER", frame.healthBar)
		frame.healthBar.value:SetFont('Fonts\\FRIZQT__.ttf', 12, "OUTLINE")
	end

	local cur, max = UnitHealth(frame.displayedUnit), UnitHealthMax(frame.displayedUnit)
	if cur > 0 then
		frame.healthBar.value:SetFormattedText("%d - %.0f%%", cur, 100*cur/max)
	else
		frame.healthBar.value:SetText("")
	end
end)

Last edited by L3n1n : 04-22-21 at 05:29 AM.
  Reply With Quote