From 23671201620cc3c33d2db9d3c1e437cbd3598bea Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Tue, 19 Aug 2014 18:37:55 +0200 Subject: [PATCH] Merge and rename some health tags --- elements/tags.lua | 12 +++--------- oUF_P3lim.lua | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/elements/tags.lua b/elements/tags.lua index ba4ffe4..71e25b4 100644 --- a/elements/tags.lua +++ b/elements/tags.lua @@ -45,7 +45,7 @@ tags.Methods['p3lim:percent'] = function(unit) return ('%d|cff0090ff%%|r'):format(UnitHealth(unit) / UnitHealthMax(unit) * 100) end -tags.Methods['p3lim:player'] = function(unit) +tags.Methods['p3lim:phealth'] = function(unit) if(Status(unit)) then return end local maxHealth = _TAGS['p3lim:health'](unit) @@ -56,18 +56,12 @@ tags.Methods['p3lim:player'] = function(unit) end end -tags.Methods['p3lim:hostile'] = function(unit) +tags.Methods['p3lim:thealth'] = function(unit) if(Status(unit)) then return end if(UnitCanAttack('player', unit)) then return ('%s (%s)'):format(ShortValue(UnitHealth(unit)), _TAGS['p3lim:percent'](unit)) - end -end - -tags.Methods['p3lim:friendly'] = function(unit) - if(Status(unit)) then return end - - if(not UnitCanAttack('player', unit)) then + else local maxHealth = _TAGS['p3lim:health'](unit) if(maxHealth) then return maxHealth diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index 12fc05b..146489a 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -369,7 +369,7 @@ local UnitSpecific = { self.Buffs.PostUpdateIcon = PostUpdateBuff self.Buffs.CustomFilter = FilterPlayerBuffs - self:Tag(self.HealthValue, '[p3lim:pet< : ][p3lim:status][p3lim:player]') + self:Tag(self.HealthValue, '[p3lim:pet< : ][p3lim:status][p3lim:phealth]') self:SetWidth(230) end, target = function(self) @@ -392,7 +392,7 @@ local UnitSpecific = { self.Debuffs.PostUpdateIcon = PostUpdateDebuff self.Power.PostUpdate = PostUpdatePower - self:Tag(self.HealthValue, '[p3lim:status][p3lim:hostile][p3lim:friendly]') + self:Tag(self.HealthValue, '[p3lim:status][p3lim:thealth]') self:SetWidth(230) end, party = function(self) -- 1.7.9.5