changeset 82:26d736fbfe67 v1.4.4

- Fixed filter bar issues
author Nenue
date Mon, 10 Apr 2017 17:29:28 -0400
parents 2a86d6584ddd
children a611cf505278
files FilterBar.lua QuestPOI.lua WorldQuests.lua
diffstat 3 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/FilterBar.lua	Mon Apr 10 16:44:45 2017 -0400
+++ b/FilterBar.lua	Mon Apr 10 17:29:28 2017 -0400
@@ -184,7 +184,7 @@
   local relativeFrame = self
 
     local numHeaders = 0
-  print('|cFF00FF88'..self:GetName()..':Update()|r', 'currentMap=',WorldPlan.currentMapID)
+  print('|cFF00FF88'..self:GetName()..':Update()|r', 'currentMap=',db.currentMapID)
 
 
   local layout = db.DefaultFilterType
@@ -203,13 +203,14 @@
       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
+            print(pin.title, mapQuests[questID])
             if mapQuests[questID] then
               numQuestsHere = numQuestsHere + 1
               tinsert(info.questList, pin)
--- a/QuestPOI.lua	Mon Apr 10 16:44:45 2017 -0400
+++ b/QuestPOI.lua	Mon Apr 10 17:29:28 2017 -0400
@@ -523,7 +523,7 @@
             })
             if not foundPrimary then
               --print('  -updating primary')
-              rewardType = REWARD_GEAR
+              rewardType = REWARD_REAGENT
 
               rewardIcon = texture
               rewardName = name
@@ -661,7 +661,7 @@
 
 
   if scaleFactor then
-    --print('scaleFactor')
+    print('scaleFactor')
     self:SetScale(scaleFactor)
     self.Overlay:SetScale(scaleFactor)
     self.scaleFactor = scaleFactor
@@ -1025,9 +1025,11 @@
 
   print('  '..self.questID..':|cFFFFFF00CheckFilterRules()|r', filtered, self.title)
   if self.filtered ~= filtered then
+    wqprint('|cFF00FF00filter changed')
     self.isStale = true
   end
 
+  self.filtered = filtered
   self.used = true
   self:SetShown(true)
 end
--- a/WorldQuests.lua	Mon Apr 10 16:44:45 2017 -0400
+++ b/WorldQuests.lua	Mon Apr 10 17:29:28 2017 -0400
@@ -573,18 +573,19 @@
 
 -- Updates quest markers in taskInfo while associating them with the given map
 function Module:UpdateQuestsForMap(taskInfo, mapID)
-  if mapID then
-    db.QuestsByZone[mapID] = db.QuestsByZone[mapID] or {}
+  print('UpdateQuestsForMap()', GetMapNameByID(mapID), GetMapNameByID(db.currentMapID), layoutDirty)
+  if db.QuestsByZone[mapID] then
     wipe(db.QuestsByZone[mapID])
   end
-  print('UpdateQuestsForMap()', GetMapNameByID(mapID), GetMapNameByID(db.currentMapID), layoutDirty)
+
+
   for index, info in pairs(taskInfo) do
 
     local questID, x, y = info.questId, info.x, info.y
     local pin = self:AcquirePin(info)
 
     if pin then
-      print(pin.title, pin.isStale)
+      print(pin.title, pin.isStale, layoutDirty, (pin.owningFrame ~= WorldMapFrame))
       if pin:IsShown() and (layoutDirty or pin.isStale or (pin.owningFrame ~= WorldMapFrame)) then
         local scaleFactor = SCALE_FACTORS[(pin.dataLoaded and not pin.filtered) and scaleConstant or 1]
         pin.owningFrame = WorldMapFrame
@@ -592,15 +593,15 @@
         if pin.isStale then
           pin:Refresh('WORLDMAP_REFRESH ' .. GetTime())
         end
-        if mapID then
-          db.QuestsByZone[mapID][questID] = pin
-        end
       else
         if layoutDirty then
           pin.isStale = true
         end
       end
 
+      if db.QuestsByZone[mapID] and pin.used then
+        db.QuestsByZone[mapID][questID] = pin
+      end
 
     end
   end
@@ -634,6 +635,9 @@
     for i = 1, numZones do
       local mapAreaID = MC_GetZoneInfo(db.currentMapID, i)
       local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, db.currentMapID)
+
+      db.QuestsByZone[mapAreaID] = db.QuestsByZone[mapAreaID] or {}
+
       if taskInfo then
         self:UpdateQuestsForMap(taskInfo, mapAreaID)
       end