test desaturate
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user