diff Modules/ArtifactPower.lua @ 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 3f4794dca91b
children 15a7f27b11e6
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