My code for desaturating debuffs that are not applied by my character is no longer working. All debuffs now show the same. I have attached the code in the hopes that some one can point out my error. Prior to MoP my debuffs would show in full color and all others would be gray scale. I would like to get this behaviour back. Thanks.
Code:
-- Desaturate non-Player Debuffs
if(icon.debuff) then
if(unit == "target") then
if (unitCaster == 'player' or unitCaster == 'vehicle') then
icon.icon:SetDesaturated(false)
elseif(not UnitPlayerControlled(unit)) then -- If Unit is Player Controlled don't desaturate debuffs
icon:SetBackdropColor(0, 0, 0)
icon.overlay:SetVertexColor(0.3, 0.3, 0.3)
icon.icon:SetDesaturated(true)
end
end
end