diff --git a/WeakAuras/RegionTypes/AuraBar.lua b/WeakAuras/RegionTypes/AuraBar.lua index 94cb545..9e0a3be 100644 --- a/WeakAuras/RegionTypes/AuraBar.lua +++ b/WeakAuras/RegionTypes/AuraBar.lua @@ -930,7 +930,6 @@ local funcs = { iconPath = iconPath or self.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark" self.icon:SetTexture(iconPath) - self.icon:SetDesaturated(self.desaturateIcon); end, SetOverlayColor = function(self, id, r, g, b, a) self.bar:SetAdditionalBarColor(id, { r, g, b, a}); @@ -1135,6 +1134,7 @@ local function modify(parent, region, data) region.bar.iconHeight = iconsize local texWidth = 0.25 * data.zoom; icon:SetTexCoord(GetTexCoordZoom(texWidth)) + icon:SetDesaturated(data.desaturate); icon:SetVertexColor(data.icon_color[1], data.icon_color[2], data.icon_color[3], data.icon_color[4]); -- Update icon visibility diff --git a/WeakAuras/RegionTypes/Icon.lua b/WeakAuras/RegionTypes/Icon.lua index 9c833cc..2555e82 100644 --- a/WeakAuras/RegionTypes/Icon.lua +++ b/WeakAuras/RegionTypes/Icon.lua @@ -349,6 +349,8 @@ local function modify(parent, region, data) region.zoom = data.zoom; region:UpdateSize() + icon:SetDesaturated(data.desaturate); + local tooltipType = Private.CanHaveTooltip(data); if(tooltipType and data.useTooltip) then if not region.tooltipFrame then @@ -433,7 +435,6 @@ local function modify(parent, region, data) iconPath = iconPath or self.displayIcon or "Interface\\Icons\\INV_Misc_QuestionMark" icon:SetTexture(iconPath) - icon:SetDesaturated(data.desaturate) end function region:Scale(scalex, scaley) diff --git a/WeakAuras/compat.lua b/WeakAuras/compat.lua index 9b389c2..9af1a27 100644 --- a/WeakAuras/compat.lua +++ b/WeakAuras/compat.lua @@ -145,3 +145,21 @@ if not SmoothStatusBarMixin then end end +do + local texture_mt = getmetatable(CreateFrame("Frame"):CreateTexture()).__index + + local setDesaturated = texture_mt.SetDesaturated + texture_mt.SetDesaturated = function(self, desaturated, ...) + self._isDesaturated = desaturated + return setDesaturated(self, desaturated, ...) + end + + local setTexture = texture_mt.SetTexture + texture_mt.SetTexture = function(self, ...) + local isDesaturated = self._isDesaturated + local apply = setTexture(self, ...) + self:SetDesaturated(isDesaturated) + return apply + end +end +