Mercurial > wow > buffalo2
diff Modules/WorldState.lua @ 85:1196b8175674
missing "else" control
author | Nenue |
---|---|
date | Tue, 18 Oct 2016 13:16:57 -0400 |
parents | 16b300d96724 |
children | 27db212af783 |
line wrap: on
line diff
--- a/Modules/WorldState.lua Tue Oct 18 13:07:21 2016 -0400 +++ b/Modules/WorldState.lua Tue Oct 18 13:16:57 2016 -0400 @@ -296,37 +296,33 @@ if xp then self.progressPercent = xp / xpMax end - self.progressText = '|cFFFFCC00' .. UnitLevel('player') .. '|r ' .. xp .. '/' .. xpMax - if bonusXP then self.ProgressBar:SetColorTexture(0, 0.5,1) self.OverflowBar:Show() self.OverflowBar:ClearAllPoints() self.OverflowBar:SetPoint('BOTTOMLEFT', self.ProgressBar, 'BOTTOMRIGHT', 0, 0) - else self.ProgressBar:SetColorTexture(0.5,0,1) end hasNewInfo = (self.progressAmount ~= xp) - progressChange = (hasNewInfo and not self.modeChanged) and ((xp - self.progressAmount) / xpMax) - - self.progressOverFlow = bonusXP + self.progressOverflow = bonusXP self.progressAmount = xp self.progressMax = xpMax + elseif self.mode == 'artifact' then - local itemID, altItemID, name, icon, totalXP, pointsSpent = GetEquippedArtifactInfo() - print(' C_AUI:', itemID, altItemID, name, icon, totalXP, pointsSpent) if itemID then local nextRankCost = GetCostForPointAtRank(pointsSpent) or 0 + print(' C_AUI:', itemID, name, 'XP:', totalXP, 'Points:', pointsSpent, 'Next:', nextRankCost) hasNewInfo = (self.progressAmount ~= totalXP) progressChange = (hasNewInfo and not self.modeChanged) and (((totalXP - self.progressAmount) / nextRankCost)) if totalXP > nextRankCost then self.progressPercent = 1 + else self.progressPercent = totalXP / nextRankCost end @@ -335,7 +331,7 @@ self.ProgressBar:SetColorTexture(1,0.5,0,1) self.OverflowBar:Hide() - self.progressOverFlow = 0 + self.progressOverflow = 0 self.progressAmount = totalXP self.progressMax = nextRankCost else @@ -362,7 +358,9 @@ end - --print(self.ProgressBG:GetWidth()) + print(self:IsVisible()) + print(self:GetWidth()) + print(self.ProgressBG:GetWidth()) print(' Percent:', floor(self.progressPercent*100)/100, 'BarLength:', floor(self:GetWidth()* self.progressPercent), 'NewInfo:', hasNewInfo, 'IsShown:', self:IsShown()) @@ -392,7 +390,7 @@ self.ProgressBar:Hide() end else - --self:HidePanel() + self:HidePanel() end self.modeChanged = nil @@ -410,6 +408,9 @@ if self.mode == 'xp' then self.mode = 'artifact' else + if not self.canGainXP then + return + end self.mode = 'xp' end self:AnimateMode()