changeset 85:1196b8175674

missing "else" control
author Nenue
date Tue, 18 Oct 2016 13:16:57 -0400
parents 16b300d96724
children 48182978d1c6
files Modules/WorldState.lua Modules/WorldState.xml
diffstat 2 files changed, 13 insertions(+), 12 deletions(-) [+]
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()
--- a/Modules/WorldState.xml	Tue Oct 18 13:07:21 2016 -0400
+++ b/Modules/WorldState.xml	Tue Oct 18 13:16:57 2016 -0400
@@ -64,7 +64,7 @@
           <Layer level="BORDER">
             <Texture parentKey="ProgressBG">
               <Anchors>
-                <Anchor point="TOPRIGHT"  relativePoint="TOPRIGHT" />
+                <Anchor point="TOPRIGHT" />
                 <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="12" />
               </Anchors>
               <Color r="0" g="0" b="0" a="0.5" />