changeset 129:9f2cf5609420 v7.3.0-20171022

- fix Argus world quests not being counted - add "Argus WQ" header in the summary box
author Nenue
date Sun, 22 Oct 2017 18:28:43 -0400
parents 799ec6dce9c3
children 67b90544a7b7
files Modules/ArtifactPower.lua Modules/ArtifactPower.xml Veneer.toc
diffstat 3 files changed, 38 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/Modules/ArtifactPower.lua	Thu Oct 19 10:39:04 2017 -0400
+++ b/Modules/ArtifactPower.lua	Sun Oct 22 18:28:43 2017 -0400
@@ -41,7 +41,9 @@
 local BUTTON_SIZE = 48
 local FRAME_LIST = {'ContainerFrame1', 'BankFrame'}
 local BAG_FRAMES = {'ContainerFrame1'}
-local BANK_FRAMES = {'BankFrame'}
+local BANK_FRAMES = {'BankFrame' }
+local ZONE_ID_ARGUS = 1184
+local ZONE_ID_BROKEN_ISLE = 1007
 
 function Module:OnLoad()
   self:RegisterEvent('BAG_UPDATE') -- use to obtain bag IDs to scan
@@ -468,6 +470,11 @@
     bankText = (bankText and (bankText .. '\n') or '') .. '|cFFFFBB00World Quests:|r |cFFFFFFFF' .. ShortNumberString(self.worldQuestAP) .. ''
   end
 
+  if self.argusAP then
+    bankText = (bankText and (bankText .. '\n') or '') .. '|cFF88FF00Argus WQ:|r |cFFFFFFFF' .. ShortNumberString(self.argusAP) .. ''
+  end
+
+
 
   self.SummaryHeader:SetText(bankText)
   if not self.lastButton then
@@ -485,18 +492,13 @@
   self:Reanchor()
 end
 
-local BROKEN_ISLE_ID = 1007
+function Module:GetContinentAP(mapAreaID)
 
-function Module:UpdateWorldQuestsAP()
-  self.waitingForQuestRewardData = false
-  self.worldQuestAP = 0
-  wipe(self.worldQuestItems)
-
-  for zoneIndex = 1, C_MapCanvas.GetNumZones(BROKEN_ISLE_ID) do
-    local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo(BROKEN_ISLE_ID, zoneIndex);
+  for zoneIndex = 1, C_MapCanvas.GetNumZones(mapAreaID) do
+    local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo(mapAreaID, zoneIndex);
     --print(zoneMapID, zoneName)
     if zoneDepth <= 1 then -- Exclude subzones
-      local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(zoneMapID, BROKEN_ISLE_ID);
+      local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(zoneMapID, mapAreaID, (mapAreaID == 1184) and 1 or nil);
 
       if taskInfo then
         for i, info in ipairs(taskInfo) do
@@ -519,6 +521,9 @@
                     --print('ap =', ap)
                     if ap then
                       self.worldQuestAP = self.worldQuestAP + ap
+                      if mapAreaID == ZONE_ID_ARGUS then
+                        self.argusAP = self.argusAP + ap
+                      end
 
                     end
 
@@ -541,6 +546,18 @@
       end
     end
   end
+
+end
+
+function Module:UpdateWorldQuestsAP()
+  self.waitingForQuestRewardData = false
+  self.worldQuestAP = 0
+  self.argusAP = 0
+  wipe(self.worldQuestItems)
+
+  self:GetContinentAP(ZONE_ID_BROKEN_ISLE)
+  self:GetContinentAP(ZONE_ID_ARGUS)
+
 end
 
 function Module:UpdateArtifactButtons()
@@ -760,6 +777,8 @@
                 -- tokens > 1M are described as '%f million'
                 if text:match("million") then
                   itemAP = tonumber(itemAP) * 1000000
+                  elseif text:match("billion") then
+                  itemAP = tonumber(itemAP) * 1000000000
                 end
 
                 itemAP = itemAP
@@ -1043,7 +1062,7 @@
   local offHeight = self.AdjustedProgress:GetHeight() or 1
 
 
-  self.CurrentProgress:SetPoint('BOTTOM', self, 'BOTTOM', 0, XP_INSET)
+  self.CurrentProgress:SetPoint('BOTTOM', self.XPBackground, 'BOTTOM', 0, 0)
   local currentProgress = (self.currentXP < self.currentCost) and (self.currentXP / self.currentCost) or 1
   local projectedProgress = (self.totalXP < self.totalCost) and (self.totalXP / self.totalCost) or 1
   if self.actualLevel ~= self.level then
--- a/Modules/ArtifactPower.xml	Thu Oct 19 10:39:04 2017 -0400
+++ b/Modules/ArtifactPower.xml	Sun Oct 22 18:28:43 2017 -0400
@@ -83,17 +83,17 @@
 
         <Texture parentKey="CurrentProgress" alphaMode="ADD">
           <Anchors>
-            <Anchor point="BOTTOM" x="0" y="0" />
-            <Anchor point="LEFT" x="2" y="0" />
-            <Anchor point="RIGHT" relativePoint="LEFT" x="6" />
+            <Anchor point="BOTTOM" relativePoint="BOTTOM" relativeKey="$parent.XPBackground" />
+            <Anchor point="LEFT"  relativePoint="LEFT" relativeKey="$parent.XPBackground" />
+            <Anchor point="RIGHT" relativePoint="RIGHT" relativeKey="$parent.XPBackground" />
           </Anchors>
-            <Color a="1" r="1" g=".25" b="0" />
+          <Color a="1" r="1" g=".25" b="0" />
         </Texture>
         <Texture parentKey="AdjustedProgress" alphaMode="ADD">
           <Anchors>
-            <Anchor point="BOTTOM" x="0" y="0" />
-            <Anchor point="LEFT" x="2" y="0" />
-            <Anchor point="RIGHT" relativePoint="LEFT" x="6" />
+            <Anchor point="BOTTOM" relativePoint="BOTTOM" relativeKey="$parent.XPBackground" />
+            <Anchor point="LEFT"  relativePoint="LEFT" relativeKey="$parent.XPBackground" />
+            <Anchor point="RIGHT" relativePoint="RIGHT" relativeKey="$parent.XPBackground" />
           </Anchors>
           <Color a="1" r="1" g="1" b="1" />
         </Texture>
--- a/Veneer.toc	Thu Oct 19 10:39:04 2017 -0400
+++ b/Veneer.toc	Sun Oct 22 18:28:43 2017 -0400
@@ -7,7 +7,7 @@
 ## X-Category: Interface Enhancements
 ## DefaultState: Enabled
 ## LoadOnDemand: 0
-## OptionalDeps: Devian
+## OptionalDeps: Devian, BagBrother
 
 Init.lua
 Veneer.xml