From 720159904c890d6ea412517fd335641c1ffef69b Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sun, 31 Jul 2011 22:42:00 +0200 Subject: [PATCH] Show Glyph of Shred stacks on Rip --- oUF_P3lim.lua | 60 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index 7be577d..4b4a4fc 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -36,19 +36,59 @@ local function PostCreateAura(element, button) button.icon:SetDrawLayer('ARTWORK') end -local function PostUpdateDebuff(element, unit, button, index) - local _, _, _, _, type, _, _, owner = UnitAura(unit, index, button.filter) - local color = DebuffTypeColor[type or 'none'] +local CLEU, PostUpdateDebuff +do + local stack = 0 + function PostUpdateDebuff(element, unit, button, index) + local _, _, _, count, type, _, _, owner, _, _, id = UnitAura(unit, index, button.filter) + local color = DebuffTypeColor[type or 'none'] + + if(owner == 'player') then + 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 - if(owner == 'player') then - 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) + if(id == 1079 and owner == 'player') then + if(stack) then + button.count:SetText(stack > 0 and stack or '') + end + elseif(not count or count < 2) then + button.count:SetText() + end end -end + local player + function CLEU(self, ...) + if(not player) then + player = UnitGUID('player') + end + + local _, _, event, _, source, _, _, _, _, _, _, _, spell = ... + if(source ~= player) then return end + + if(spell == 1079) then + if(event == 'SPELL_AURA_APPLIED' or event == 'SPELL_AURA_REFRESH') then + stack = 0 + self.Debuffs:ForceUpdate() + end + end + + if(event == 'SPELL_DAMAGE') then + if(spell == 5221 and stack < 3) then + stack = stack + 1 + self.Debuffs:ForceUpdate() + elseif(spell == 22568) then + if(UnitHealth('target') / UnitHealthMax('target') <= 0.25) then + stack = 0 + self.Debuffs:ForceUpdate() + end + end + end + end +end local FilterPlayerBuffs do -- 1.7.9.5