What Frames you use?
If you use oUF you can easily implement a TAG to output that.
I have implemented it on my oUF_lumen layout.
But even if you have not oUF you just need to change from a Tag to a function and register the event UNIT_POWER.
PHP Code:
-- Holy Power
oUF.Tags["lumen:holypower"] = function(unit)
local hp = UnitPower('player', SPELL_POWER_HOLY_POWER)
local str
if hp == 1 then
str = string.format("|CFFffffff%d|r",hp)
elseif hp == 2 then
str = string.format("|CFFfff880%d|r",hp)
elseif hp == 3 then
str = string.format("|CFFf5e92f%d|r",hp)
else
str = ""
end
return str
end
oUF.TagEvents["lumen:holypower"] = "UNIT_POWER"
You then need to create the string to "output" this value, like this:
PHP Code:
-- Paladin Holy Power
local PaladinHolyPower = function(self)
if(PlayerClass == "PALADIN") then
local HolyPower = self:CreateFontString(nil, 'OVERLAY')
HolyPower:SetPoint('CENTER', self, 'RIGHT', (cfg.target_frame_x_from_player/2), 0)
HolyPower:SetFont(font, cfg.fontsize*3, "OUTLINE")
HolyPower:SetJustifyH('CENTER')
HolyPower:SetShadowOffset(1, -1)
self:Tag(HolyPower, '[lumen:holypower]')
end
end
Hope that helps.