Don't show power if there aint any
Adrian L Lange [02-19-10 - 23:22]
Don't show power if there aint any
diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua
index b1c7831..9168f5b 100644
--- a/oUF_P3lim.lua
+++ b/oUF_P3lim.lua
@@ -248,7 +248,7 @@ local function Style(self, unit)
powerValue:SetFont(FONT, 8, 'OUTLINE')
powerValue:SetJustifyH('LEFT')
powerValue.frequentUpdates = 0.1
- self:Tag(powerValue, '[p3lim:power][ >p3lim:druid]')
+ self:Tag(powerValue, '[p3lim:power< ][p3lim:druid]')
else
local name = health:CreateFontString(nil, 'OVERLAY')
name:SetPoint('LEFT', health, 2, 0)
diff --git a/oUF_P3limTags.lua b/oUF_P3limTags.lua
index e88158f..4724c96 100644
--- a/oUF_P3limTags.lua
+++ b/oUF_P3limTags.lua
@@ -45,8 +45,11 @@ for name, func in pairs({
end
end,
['power'] = function(unit)
- local _, type = UnitPowerType(unit)
- return ('%s%d|r'):format(Hex(_COLORS.power[type or 'RUNES']), UnitPower(unit))
+ local power = UnitPower(unit)
+ if(power > 0) then
+ local _, type = UnitPowerType(unit)
+ return ('%s%d|r'):format(Hex(_COLORS.power[type or 'RUNES']), power)
+ end
end,
['druid'] = function(unit)
local min, max = UnitPower(unit, 0), UnitPowerMax(unit, 0)