Fixed error generated when gaining a max combo point

When loading into the game as an Outlaw, the mod was creating 5 slots for combo points. Switching to Assassination increases the max to 6, but the module was failing to compensate for this and causing an error instead.
This commit is contained in:
Parnic
2016-05-28 23:58:23 -05:00
parent b487aaf351
commit c75ffcc6fc

View File

@ -290,11 +290,11 @@ function ComboPoints.prototype:CreateFrame()
self.frame:SetFrameStrata("BACKGROUND")
if self.moduleSettings.graphicalLayout == "Horizontal" then
self.frame:SetWidth((self.comboSize - 5)*self.GetMaxComboPoints())
self.frame:SetWidth((self.comboSize - 5)*self:GetMaxComboPoints())
self.frame:SetHeight(1)
else
self.frame:SetWidth(1)
self.frame:SetHeight(self.comboSize*self.GetMaxComboPoints())
self.frame:SetHeight(self.comboSize*self:GetMaxComboPoints())
end
self.frame:ClearAllPoints()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", self.moduleSettings.hpos, self.moduleSettings.vpos)
@ -323,7 +323,7 @@ function ComboPoints.prototype:CreateComboFrame(forceTextureUpdate)
end
local i
local maxComboPoints = self.GetMaxComboPoints()
local maxComboPoints = self:GetMaxComboPoints()
-- create backgrounds
for i = 1, maxComboPoints do
@ -463,6 +463,10 @@ function ComboPoints.prototype:UpdateComboPoints(...)
points = points or 0
anticipate = self.moduleSettings.showAnticipation and anticipate or 0
if self:GetMaxComboPoints() > #self.frame.graphical then
self:CreateFrame()
end
if (self.moduleSettings.comboMode == "Numeric") then
local r, g, b = self:GetColor("ComboPoints")
if (self.moduleSettings.gradient and points) then