changeset 59:bc09961d5a98

fix attempts for lingering quest text and filter bar data
author Nenue
date Wed, 01 Feb 2017 17:44:20 -0500
parents 68a695d725ed
children 3d8e83ddf603
files FilterBar.lua QuestPOI.lua WorldQuests.lua
diffstat 3 files changed, 44 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/FilterBar.lua	Fri Jan 20 19:57:42 2017 -0500
+++ b/FilterBar.lua	Wed Feb 01 17:44:20 2017 -0500
@@ -200,24 +200,28 @@
 
     for questID, pin in pairs(db.QuestsByID) do
       --print(pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION, (db.Config.ShowAllProfessionQuests or pin.isKnownProfession))
-      if (pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION) or (db.Config.ShowAllProfessionQuests or pin.isKnownProfession) then
-        --print(pin.title)
-        if not info.filterKey then
-          if mapQuests[questID] then
+      if pin.used then
+
+        if (pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION) or (db.Config.ShowAllProfessionQuests or pin.isKnownProfession) then
+          --print(pin.title)
+          if not info.filterKey then
+            if mapQuests[questID] then
+                numQuestsHere = numQuestsHere + 1
+            end
+            numQuestsTotal = numQuestsTotal + 1
+          elseif pin[info.filterKey] == info.filterValue then
+            if mapQuests[questID] then
               numQuestsHere = numQuestsHere + 1
+              tinsert(info.questList, pin)
+            end
+            numQuestsTotal = numQuestsTotal + 1
           end
-          numQuestsTotal = numQuestsTotal + 1
-        elseif pin[info.filterKey] == info.filterValue then
-          if mapQuests[questID] then
-            numQuestsHere = numQuestsHere + 1
-            tinsert(info.questList, pin)
-          end
-          numQuestsTotal = numQuestsTotal + 1
         end
       end
+
     end
     --print('num here', numQuestsHere, numQuestsTotal)
-    info.totalQuests = maxQuests
+    info.totalQuests = numQuestsTotal
 
     --print(tostring(index).. ' ("'..tostring(info.label)..'" f('.. tostring(info.filterKey).. '='..tostring(info.filterValue) .. '), '..tostring(numQuests)..')')
 
--- a/QuestPOI.lua	Fri Jan 20 19:57:42 2017 -0500
+++ b/QuestPOI.lua	Wed Feb 01 17:44:20 2017 -0500
@@ -429,13 +429,19 @@
   if not self.isAnimating then
     self:SetAlpha(db.PinAlpha) -- fix stuck alpha
   end
-  self.Overlay:SetShown(true)
+  if self.used then
+    self.Overlay:Show()
+  end
+
 end
 function QuestPOI:OnHide()
   qprint('|cFFFFFF00'..self:GetID()..'r:OnHide()')
+
+  -- reset flags
+  self:SetAlpha(db.PinAlpha)
   self.isAnimating = nil
-  self:SetAlpha(db.PinAlpha)
-  self.Overlay:SetShown(false)
+  self.isStale = true
+  self.Overlay:Hide()
 end
 
 -- different from owningFrame
@@ -501,10 +507,10 @@
     return
   end
   if self.isNew then
-    print('|cFFFFFF00push new poi stuff')
+    --print('|cFFFFFF00push new poi stuff')
     self:OnNew()
   elseif (self.isStale or (not self.title)) and not self.isAnimating then
-    wprint('|cFFFFFF00push poi update')
+    --wprint('|cFFFFFF00push poi update')
     self:Refresh()
     return
   end
@@ -512,7 +518,7 @@
   -- query for reward data if it wasn't found in the original scan
   local questID = self.questID
   if self.isPending then
-    print('|cFFFF4400'..self:GetID()..':|r polling reward info')
+    --print('|cFFFF4400'..self:GetID()..':|r polling reward info')
     if not (self.isAnimating) then
       self.PendingFade:Play()
     end
@@ -554,6 +560,9 @@
       self.HighlightBorder:SetVertexColor(0,0,0,0.7)
     end
     self.alertLevel = tl
+  else
+    WorldPlan:print('|cFFFFFF00'..tostring(self.title).. '|r is no longer active.')
+    self:Hide()
   end
   self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1))
 end
--- a/WorldQuests.lua	Fri Jan 20 19:57:42 2017 -0500
+++ b/WorldQuests.lua	Wed Feb 01 17:44:20 2017 -0500
@@ -171,6 +171,14 @@
     end
   elseif event == 'SKILL_LINES_CHANGED' then
     self:Refresh(true)
+  elseif event == 'ARTIFACT_UPDATE' then
+    local ak = C_ArtifactUI.GetArtifactKnowledgeMultiplier()
+    if ak and (ak ~= self.akLevel) then
+      self.akLevel = ak
+      self.ArtifactPowerDirty = true
+      -- artifact knowledge changed
+      self:Refresh(true)
+    end
   end
 end
 
@@ -227,7 +235,7 @@
     end
   end
 
-  if not pin.dataLoaded then
+  if (not pin.dataLoaded) or self.ArtifactPowerDirty then
     pin:GetData()
   end
 
@@ -443,6 +451,8 @@
   self:Cleanup (fromUser)
   self.isStale = nil
   self.sizesDirty = nil
+
+  self.ArtifactPowerDirty = nil
 end
 
 -- update visibility states of all pins
@@ -539,12 +549,12 @@
       if oV == false then
         print('|cFF00FF00cleanup +|r', questID, pin.title)
       end
+      pin:Show()
     else
       if oV == true then
         print('|cFFFF4400 -|r', questID, pin.title)
       end
-      pin.isStale = true
-      pin:SetShown(false)
+      pin:Hide()
     end
   end
 end