changeset 84:a12f782571c5 v1.4.5

- Fixed more filter bar issues
author Nenue
date Mon, 10 Apr 2017 17:50:06 -0400
parents a611cf505278
children d3f36db572e5
files FilterBar.lua QuestPOI.lua WorldQuests.lua
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/FilterBar.lua	Mon Apr 10 17:29:46 2017 -0400
+++ b/FilterBar.lua	Mon Apr 10 17:50:06 2017 -0400
@@ -107,6 +107,7 @@
 function Module:Setup()
   print('|cFF00FF88'..self:GetName()..':Setup()')
   self.isStale = true
+  self:SetShown(true)
 end
 
 
@@ -117,12 +118,15 @@
   end
 end
 
-function Module:OnMapInfo(isBrokenIsle, mapAreaID)
+function Module:OnMapInfo(isBrokenIsle, isZoomedOut, mapAreaID, isNewMap, isMapOpen)
+  print('|cFFFFFF00OnMapInfo()', isBrokenIsle, isZoomedOut, mapAreaID, isNewMap, isMapOpen)
   if not isBrokenIsle then
     self:SetShown(false)
   else
+    if self:IsShown() then
+      self:Refresh()
+    end
     self:SetShown(true)
-    self:Refresh()
   end
 end
 
@@ -191,17 +195,25 @@
   local borderWidth = layout.iconWidth + (layout.borderWidth * 2)
   local highlightWidth = borderWidth + (layout.highlightWidth * 2)
   local mapQuests = db.QuestsByZone[db.currentMapID] or db.QuestsByID
+  local n = 0
+  for _ in pairs(mapQuests) do
+    n = n + 1
+  end
+  print(n, 'pins to work with')
+
   local firstCvar, lastCvar
   for index, info in ipairs(self.filterList) do
     local numQuestsHere = 0
     local numQuestsTotal = 0
     info.questList = info.questList or {}
     wipe(info.questList)
+    print(info.filterKey, info.filterValue)
 
     for questID, pin in pairs(db.QuestsByID) do
       --print(pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION, (db.Config.ShowAllProfessionQuests or pin.isKnownProfession))
       if pin.used then
 
+        print(pin.title, mapQuests[questID])
         if (pin.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION) or (db.Config.ShowAllProfessionQuests or pin.isKnownProfession) then
 
           if not info.filterKey then
@@ -210,7 +222,6 @@
             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 17:29:46 2017 -0400
+++ b/QuestPOI.lua	Mon Apr 10 17:50:06 2017 -0400
@@ -705,7 +705,6 @@
   self.Overlay:SetShown(false)
   self.count:SetShown(false)
   self.timeLabel:SetShown(false)
-  self.used = nil
 end
 
 function QuestPOI:OnLoad()
--- a/WorldQuests.lua	Mon Apr 10 17:29:46 2017 -0400
+++ b/WorldQuests.lua	Mon Apr 10 17:50:06 2017 -0400
@@ -573,7 +573,7 @@
 
 -- Updates quest markers in taskInfo while associating them with the given map
 function Module:UpdateQuestsForMap(taskInfo, mapID)
-  print('UpdateQuestsForMap()', GetMapNameByID(mapID), GetMapNameByID(db.currentMapID), layoutDirty)
+  print('|cFF00FF00UpdateQuestsForMap()|r', GetMapNameByID(mapID), GetMapNameByID(db.currentMapID), layoutDirty)
   if db.QuestsByZone[mapID] then
     wipe(db.QuestsByZone[mapID])
   end
@@ -585,6 +585,7 @@
     local pin = self:AcquirePin(info)
 
     if pin then
+      pin.used = true
       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]