View Single Post
03-21-09, 02:46 AM   #933
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Caellian View Post
Haste could you plz take a look at this when you have a second ?
1. You can't nest color tags afaik.
2. PostUpdateAuraIcon is executed on every aura update, so using that is just a bad idea.

There are a couple of things you should do. The first is to move the function outside the general layout code:
Code:
local cancelAura = function(self, button)
    if(button == 'RightButton' and not self.debuff) then
        CancelUnitBuff('player', self:GetID())
    end
end
The next thing is to only apply this to the player frame with PostCreateAuraIcon(). I don't know how the rest of your layout looks, so I'm assuming you have other stuff in that function already. What you have to add to your function is then:
Code:
if(self.unit == 'player') then
    button:SetScript('OnMouseUp', cancelAura)
end
I'm also assuming that you are using self.Auras. This solution will work fine for self.Buffs also however .