diff WorldQuests.lua @ 57:54aa7f8ebca8 v1.0-release

- fix profession quests showing when not enabled - fix profession quest time borders always coloring as urgent
author Nenue
date Fri, 20 Jan 2017 19:57:13 -0500
parents 0749e38081e7
children bc09961d5a98
line wrap: on
line diff
--- a/WorldQuests.lua	Tue Jan 03 20:04:16 2017 -0500
+++ b/WorldQuests.lua	Fri Jan 20 19:57:13 2017 -0500
@@ -170,7 +170,7 @@
       rprint('|cFFFF4400release|r', questID)
     end
   elseif event == 'SKILL_LINES_CHANGED' then
-    self:SetFilteredPins()
+    self:Refresh(true)
   end
 end
 
@@ -231,10 +231,7 @@
     pin:GetData()
   end
 
-
-
-  pin:IsFiltered()
-  pin:IsShowable()
+  pin:CheckFilterRules()
   pin.isStale = true
   rprint(pin:GetID(), pin.filtered, pin.used)
 
@@ -434,7 +431,7 @@
   if not self:IsVisible() then
     print('  not visible, flag for later')
     self.isStale = true
-    return
+    return self:MarkAllPins()
   end
   wprint('  |cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal')
 
@@ -449,8 +446,8 @@
 end
 
 -- update visibility states of all pins
-function Module:SetFilteredPins(pins)
-  print('  |cFFFFFF00'..self:GetName()..':SetFilteredPins()|r', pins)
+function Module:MarkAllPins(pins)
+  print('  |cFFFFFF00'..self:GetName()..':MarkAllPins()|r', pins)
   pins = pins or db.QuestsByID
   for questID, pin in pairs(pins) do
     pin.isStale =  true
@@ -467,23 +464,21 @@
   end
 
 
-  --print('~ ', pin.mapID, pin.questID, pin.title)
-  rprint('|cFF00FF00update|r', x, y, pin.mapID, pin.questID, pin.title)
+  print('~ ', pin.mapID, pin.questID, pin.title)
+  rprint('|cFF00FF00update|r', pin.questID, pin.title)
 
   if x and y then
     pin.x = x
     pin.y = y
     pin:SetFrameLevel(PinBaseIndex+pin:GetID())
-    pin.owningFrame = self.hostFrame
-    pin:SetAnchor(self.hostFrame, pin.x, pin.y, self.hostWidth, self.hostHeight)
+    pin.owningFrame = WorldMapFrame
+    pin:SetAnchor(WorldMapPOIFrame, pin.x, pin.y, self.hostWidth, self.hostHeight)
     --tinsert(self.UsedPositions, pin)
   end
-  if self.sizesDirty then
-    if self:IsVisible() then
-      pin:Refresh()
-    else
-      pin.isStale = true
-    end
+  if self:IsVisible() then
+    pin:Refresh()
+  else
+    pin.isStale = true
   end
   if mapID then
     if not db.QuestsByZone[mapID] then
@@ -503,8 +498,7 @@
 function Module:UpdateAnchors (fromUser)
   wipe(self.UsedPositions)
   print('  |cFF00FF00'..self:GetName()..':UpdateAnchors()', fromUser)
-  self.hostFrame = WorldMapPOIFrame
-  self.hostWidth, self.hostHeight = self.hostFrame:GetSize()
+  self.hostWidth, self.hostHeight = WorldMapPOIFrame:GetSize()
   self.nudgeThrescholdX = 16/self.hostWidth
   self.nudgeThrescholdY = 16/self.hostHeight
   local print = rprint