Support multiple anima-charged combo points

#16
This commit is contained in:
Parnic
2021-10-12 21:11:39 -05:00
parent 8868b16785
commit a08c2455c6

View File

@ -330,8 +330,7 @@ function ComboPoints.prototype:UpdateMaxComboPoints(event, unit, powerType)
end
function ComboPoints.prototype:UpdateChargedComboPoints()
local chargedPowerPoints = GetUnitChargedPowerPoints("player")
self.chargedPowerPointIndex = chargedPowerPoints and chargedPowerPoints[1]
self.chargedPowerPoints = GetUnitChargedPowerPoints("player")
self:CreateComboFrame()
self:UpdateComboPoints()
end
@ -445,7 +444,7 @@ function ComboPoints.prototype:CreateComboFrame(forceTextureUpdate)
g = g - ((1 / maxComboPoints)*i)
end
if i == self.chargedPowerPointIndex and self.moduleSettings.bShowAnimaCharged then
if self.moduleSettings.bShowAnimaCharged and self:IsAnimaChargedPoint(i) then
self.frame.graphical[i].texture:SetVertexColor(self:GetColor("KyrianAnimaComboPoint"))
else
self.frame.graphical[i].texture:SetVertexColor(r, g, b)
@ -494,6 +493,20 @@ function ComboPoints.prototype:CreateComboFrame(forceTextureUpdate)
end
end
function ComboPoints.prototype:IsAnimaChargedPoint(point)
if not self.chargedPowerPoints then
return false
end
for i=1, #self.chargedPowerPoints do
if self.chargedPowerPoints[i] == point then
return true
end
end
return false
end
function ComboPoints.prototype:UpdateComboPoints(...)
if select('#', ...) >= 3 and select(1, ...) == IceHUD.UnitPowerEvent and select(3, ...) ~= "COMBO_POINTS" then
return