local function iconColor(self)
local icon = self.icon;
local normalTexture = self.NormalTexture;
if ( not normalTexture or not self.action) then
return;
end
local isUsable, notEnoughMana = IsUsableAction(self.action);
if ( isUsable ) then
icon:SetVertexColor(1.0, 1.0, 1.0);
elseif ( notEnoughMana ) then
icon:SetVertexColor(0.5, 0.5, 1.0);
else
icon:SetVertexColor(0.4, 0.4, 0.4);
end;
end
hooksecurefunc("ActionButton_UpdateRangeIndicator", function(self, checksRange, inRange)
local icon = self.icon;
local r, g, b = RED_FONT_COLOR:GetRGB()
if ( self.HotKey:GetText() == RANGE_INDICATOR ) then
if ( checksRange ) then
if ( inRange ) then
iconColor(self)
else
icon:SetVertexColor(r, g, b);
end
else
iconColor(self)
end
else
if ( checksRange and not inRange ) then
icon:SetVertexColor(r, g, b);
else
iconColor(self)
end
end
end)