거리가 멀어 사용 불가 버튼을 적색으로 표시하는 스크립트는 전에 있었지만 작동이 안 되는데요.

여기저기 찾아봐도 딱히 괜찮은 스크립트가 안 보였고 tullaRange는 클래식용이 없어서 만들어야 했습니다.




위의 링크를 참고로 하였고 아직은 문제가 안 보여서 공유하며 많은 지적 바랍니다.


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);
normalTexture:SetVertexColor(1.0, 1.0, 1.0);
elseif ( notEnoughMana ) then
icon:SetVertexColor(0.5, 0.5, 1.0);
normalTexture:SetVertexColor(0.5, 0.5, 1.0);
else
icon:SetVertexColor(0.4, 0.4, 0.4);
normalTexture:SetVertexColor(1.0, 1.0, 1.0);
end;
end

hooksecurefunc("ActionButton_UpdateRangeIndicator", function(self, checksRange, inRange)
local icon = self.icon;
if ( self.HotKey:GetText() == RANGE_INDICATOR ) then
if ( checksRange ) then
if ( inRange ) then
iconColor(self)
else
icon:SetVertexColor(RED_FONT_COLOR:GetRGB());
end
else
iconColor(self)
end
else
if ( checksRange and not inRange ) then
icon:SetVertexColor(RED_FONT_COLOR:GetRGB());
else
iconColor(self)
end
end
end)