WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   need help about debuff desaturated (https://www.wowinterface.com/forums/showthread.php?t=52679)

devilArt 09-01-15 05:01 PM

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


All times are GMT -6. The time now is 11:19 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI