Merge and rename some health tags
Adrian L Lange [08-19-14 - 16:37]
Merge and rename some health tags
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)