From 6130988951cbe230f976877ec5e0df08169ab5b9 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Fri, 20 Jun 2014 01:31:50 +0200 Subject: [PATCH] Add a gradient pet health value to player --- oUF_P3lim.lua | 2 +- tags.lua | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index c9148fa..9a391f2 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -279,7 +279,7 @@ local UnitSpecific = { self.Buffs.PostUpdateIcon = PostUpdateBuff self.Buffs.CustomFilter = FilterPlayerBuffs - self:Tag(self.HealthValue, '[p3lim:status][p3lim:player]') + self:Tag(self.HealthValue, '[p3lim:pet< : ][p3lim:status][p3lim:player]') self:SetWidth(230) end, target = function(self) diff --git a/tags.lua b/tags.lua index 919087e..446627d 100644 --- a/tags.lua +++ b/tags.lua @@ -144,3 +144,11 @@ tags.Methods['p3lim:shards'] = function(unit) return cur end end + +tags.Methods['p3lim:pet'] = function() + local cur = UnitHealth('pet') + if(cur > 0) then + local max = UnitHealthMax('pet') + return ('%s%d%%|r'):format(Hex(ColorGradient(cur, max, 1, 0, 0, 1, 1, 0, 1, 1, 1)), cur / max * 100) + end +end -- 1.7.9.5