From 4636d0d5e74656e8502e5f47903174688ac3afe3 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sat, 20 Feb 2010 00:22:27 +0100 Subject: [PATCH] Don't show power if there aint any --- oUF_P3lim.lua | 2 +- oUF_P3limTags.lua | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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) -- 1.7.9.5