http://www.wowinterface.com/forums/s...ad.php?t=56125
Also I should have told you earlier, but this kind of stuff should be going in
General Authoring Discussion or
Lua/XML Help.
This is the hack I use for this if you would ever be interested:
lua Code:
hooksecurefunc("CompactUnitFrame_UpdateHealth", function(frame)
if frame.optionTable.colorNameBySelection and not frame:IsForbidden() then
local healthPercentage = ceil((UnitHealth(frame.displayedUnit) / UnitHealthMax(frame.displayedUnit) * 100))
if not frame.health then
frame.health = CreateFrame("Frame", nil, frame)
frame.health:SetSize(170,16)
frame.health.text = frame.health.text or frame.health:CreateFontString(nil, "OVERLAY")
frame.health.text:SetAllPoints(true)
frame.health:SetFrameStrata("HIGH")
frame.health:SetPoint("CENTER", frame.healthBar)
frame.health.text:SetVertexColor(1, 1, 1)
end
if InterfaceOptionsNamesPanelUnitNameplatesMakeLarger:GetValue() == "1" then
frame.health.text:SetFont("FONTS\\FRIZQT__.TTF", 11, "OUTLINE")
else
frame.health.text:SetFont("FONTS\\FRIZQT__.TTF", 8, "OUTLINE")
end
frame.health.text:Show()
frame.health.text:SetText(healthPercentage .. "%")
end
end)