View Single Post
09-01-15, 05:01 PM   #1
devilArt
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 51
Angry need help about debuff desaturated

I use these code to make debuff (not casted by me) desaturated, but sometimes some buff desaturated too, any idea?



Lua Code:
  1. local PostUpdateIcon = function(_, unit, icon, index, _, filter)
  2.     local _, _, _, _, dtype = UnitAura(unit, index, icon.filter)
  3.     local texture = icon.icon
  4.  
  5.     if icon.isDebuff and dtype and UnitIsFriend("player", unit) then
  6.         local color = DebuffTypeColor[dtype]
  7.         icon.bg:SetVertexColor(color.r, color.g, color.b)
  8.     else
  9.         icon.bg:SetVertexColor(0, 0, 0)
  10.     end
  11.  
  12.     if icon.isDebuff and not icon.isPlayer then
  13.         texture:SetDesaturated(true)
  14.     else
  15.         texture:SetDesaturated(false)
  16.     end
  17. end
  Reply With Quote