From 76e5d78aa2955f796d29f274893ea946191c9a8e Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sun, 9 May 2010 20:31:47 +0200 Subject: [PATCH] Clean up PostUpdateDebuff a bit --- oUF_P3lim.lua | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index 2e4d594..3f099e1 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -52,24 +52,16 @@ local function PostCreateAura(element, button) button.icon:SetDrawLayer('ARTWORK') end -local PostUpdateDebuff -do - local units = { - vehicle = true, - player = true, - } - - function PostUpdateDebuff(element, unit, button, index) - local _, _, _, _, type, _, _, owner = UnitAura(unit, index, button.filter) - - if(UnitIsFriend('player', unit) or units[owner]) then - local color = DebuffTypeColor[type] or DebuffTypeColor.none - button:SetBackdropColor(color.r * 3/5, color.g * 3/5, color.b * 3/5) - button.icon:SetDesaturated(false) - else - button:SetBackdropColor(0, 0, 0) - button.icon:SetDesaturated(true) - end +local PostUpdateDebuff(element, unit, button, index) + if(UnitIsFriend('player', unit) or button.isPlayer) then + local _, _, _, _, type = UnitAura(unit, index, button.filter) + local color = DebuffTypeColor[type] or DebuffTypeColor.none + + button:SetBackdropColor(color.r * 3/5, color.g * 3/5, color.b * 3/5) + button.icon:SetDesaturated(false) + else + button:SetBackdropColor(0, 0, 0) + button.icon:SetDesaturated(true) end end -- 1.7.9.5