Combine rune texture/color set into one method

This enables a simpler method of making sure the appropriate texture is set and using the appropriate color (for after a rune was modified to darkened/hidden).
This commit is contained in:
Parnic
2023-01-15 12:43:56 -06:00
parent 059808c980
commit f8e7cf06d6

View File

@ -542,7 +542,7 @@ function IceClassPowerCounter.prototype:UpdateRunePower(event, arg1, arg2)
for i=1, self.numRunes do
if i <= self.round(percentReady) then
if self:GetRuneMode() == "Graphical" then
self.frame.graphical[i].rune:SetVertexColor(1, 1, 1)
self:SetRuneGraphicalTexture(i)
else
self:SetCustomColor(i)
end
@ -826,12 +826,7 @@ function IceClassPowerCounter.prototype:SetupRuneTexture(rune)
end
if self:GetRuneMode() == "Graphical" then
local tex = self:GetRuneTexture(rune)
if tex then
self.frame.graphical[rune].rune:SetTexture(tex)
else
self.frame.graphical[rune].rune:SetAtlas(self:GetRuneAtlas(rune), self:UseAtlasSize(rune))
end
self:SetRuneGraphicalTexture(rune)
elseif self:GetRuneMode() == "Graphical Bar" then
self.frame.graphical[rune].rune:SetTexture(IceElement.TexturePath .. "Combo")
elseif self:GetRuneMode() == "Graphical Circle" then
@ -843,6 +838,17 @@ function IceClassPowerCounter.prototype:SetupRuneTexture(rune)
end
end
function IceClassPowerCounter.prototype:SetRuneGraphicalTexture(rune)
self.frame.graphical[rune].rune:SetVertexColor(1, 1, 1)
local tex = self:GetRuneTexture(rune)
if tex then
self.frame.graphical[rune].rune:SetTexture(tex)
else
self.frame.graphical[rune].rune:SetAtlas(self:GetRuneAtlas(rune), self:UseAtlasSize(rune))
end
end
function IceClassPowerCounter.prototype:GetAlphaAdd()
return 0.15
end