diff Modules/ArtifactPower.lua @ 133:86621c60512b v7.3.2-20171222

- Fixed AP calc tooltip appearing while hidden - Fixed PaperDoll relic tooltips missing nether crucible info
author Nenue
date Fri, 22 Dec 2017 20:36:40 -0500
parents 15a7f27b11e6
children 4979b5cca6de
line wrap: on
line diff
--- a/Modules/ArtifactPower.lua	Mon Nov 20 12:02:18 2017 -0500
+++ b/Modules/ArtifactPower.lua	Fri Dec 22 20:36:40 2017 -0500
@@ -402,6 +402,7 @@
   end
 end
 
+local hasShownHeaderTip
 function Module:OnUpdate()
   if #self.scanQueue >= 1 then
     local scanInfo = tremove(self.scanQueue, 1)
@@ -412,6 +413,42 @@
     self.Refresh:Hide()
   end
 
+  if self.SummaryHeader:IsMouseOver() and self:IsShown() then
+    if not hasShownHeaderTip then
+      hasShownHeaderTip = true
+      GameTooltip:SetOwner(self, 'ANCHOR_BOTTOM')
+      GameTooltip:AddLine("World Quests")
+
+      for zone, data in pairs(self.apQuests) do
+
+        if #data >= 1 then
+        GameTooltip:AddLine(zone)
+        for i, quest in ipairs(data) do
+
+          if IsQuestComplete(quest[1]) then
+            GameTooltip:AddDoubleLine(quest[2], ShortNumberString(quest[3]), 0.5,0.5,0.5, 0.5,0.5,0.5)
+          else
+            GameTooltip:AddDoubleLine(quest[2], ShortNumberString(quest[3]), 1,1,1, 0,1,0)
+
+          end
+
+        end
+        end
+
+
+      end
+
+      GameTooltip:Show()
+    end
+  else
+    if GameTooltip:IsOwned(self) then
+      hasShownHeaderTip = nil
+      GameTooltip:Hide()
+    end
+
+  end
+
+
 end
 
 function Module:OnMouseDown(button)
@@ -492,6 +529,7 @@
   self:Reanchor()
 end
 
+Module.apQuests = {}
 function Module:GetContinentAP(mapAreaID)
 
   for zoneIndex = 1, C_MapCanvas.GetNumZones(mapAreaID) do
@@ -500,28 +538,39 @@
     if zoneDepth <= 1 then -- Exclude subzones
       local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(zoneMapID, mapAreaID, (mapAreaID == 1184) and 1 or nil);
 
+      self.apQuests[zoneName] = self.apQuests[zoneName] or {}
+      wipe(self.apQuests[zoneName])
+
       if taskInfo then
         for i, info in ipairs(taskInfo) do
           local questID = info.questId
 
           local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(questID)
-          --print(questTitle, HaveQuestRewardData(questID))
-          if HaveQuestRewardData(questID) and not IsQuestComplete(questID) then
+          if HaveQuestRewardData(questID) then
 
 
               for i = 1, GetNumQuestLogRewards(questID) or 0 do
                 local name, texture, numItems, quality, isUsable, itemID = GetQuestLogRewardInfo(i, questID)
                 if IsArtifactPowerItem(itemID) then
+
+                  print(questTitle, HaveQuestRewardData(questID))
                   local _, link = GetItemInfo(itemID)
                   if link then
                     local ap = self:GetItemAP(itemID, link)
                     --print('ap =', ap)
                     if ap then
-                      self.worldQuestAP = self.worldQuestAP + ap
-                      if mapAreaID == ZONE_ID_ARGUS then
-                        self.argusAP = self.argusAP + ap
+
+                      if not IsQuestComplete(questID) then
+                        self.worldQuestAP = self.worldQuestAP + ap
+                        if mapAreaID == ZONE_ID_ARGUS then
+                          self.argusAP = self.argusAP + ap
+                        end
                       end
 
+
+                      tinsert(self.apQuests[zoneName], {questID, questTitle, ap})
+
+
                     end
 
                     self.worldQuestItems[itemID] = (self.worldQuestItems[itemID] or 0) + 1
@@ -549,7 +598,7 @@
   self.worldQuestAP = 0
   self.argusAP = 0
   wipe(self.worldQuestItems)
-
+  wipe(self.apQuests)
   self:GetContinentAP(ZONE_ID_BROKEN_ISLE)
   self:GetContinentAP(ZONE_ID_ARGUS)