diff WorldQuests.lua @ 56:0749e38081e7

- More fixes for map updates from non-Legion zones.
author Nenue
date Tue, 03 Jan 2017 20:04:16 -0500
parents 6a2e85836219
children 54aa7f8ebca8
line wrap: on
line diff
--- a/WorldQuests.lua	Sat Dec 31 17:48:25 2016 -0500
+++ b/WorldQuests.lua	Tue Jan 03 20:04:16 2017 -0500
@@ -59,10 +59,9 @@
   end
 
   hooksecurefunc("ClickWorldMapActionButton", function () self:OnClickWorldMapActionButton() end)
-  hooksecurefunc("WorldMapScrollFrame_ReanchorQuestPOIs", function () self:Refresh() end)
+  hooksecurefunc("WorldMapScrollFrame_ReanchorQuestPOIs", InternalDoRefresh)
   hooksecurefunc("WorldMap_UpdateQuestBonusObjectives", function () self:OnUpdateQuestBonusObjectives() end)
-
-
+  hooksecurefunc("WorldMapFrame_UpdateMap", InternalDoRefresh)
   WorldMapFrame.UIElementsFrame.BountyBoard:SetSelectedBountyChangedCallback(InternalDoRefresh);
   WorldMapFrame.UIElementsFrame.ActionButton:SetOnCastChangedCallback(InternalDoRefresh);
 end
@@ -133,12 +132,16 @@
   self:RegisterEvent('SKILL_LINES_CHANGED')
 end
 
-function Module:OnMapInfo(isBrokenIsle, isContinent, mapAreaID)
+function Module:OnMapInfo(isBrokenIsle, isZoomedOut, mapAreaID)
   print('|cFFFFFF00'..self:GetName()..':OnMapInfo()|r visible =', self:IsVisible())
-  if self.isContinent ~= isContinent then
+  if self.isZoomedOut ~= isZoomedOut then
     self.sizesDirty = true
   end
-  self.isContinent = isContinent
+
+  self.isZoomedOut = isZoomedOut
+  self.isWorldQuestMap = isBrokenIsle
+  self.currentMapID = mapAreaID
+
   if self:IsVisible() then
     self:Refresh(true)
   else
@@ -471,6 +474,7 @@
     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)
     --tinsert(self.UsedPositions, pin)
   end
@@ -511,15 +515,15 @@
   end
 
   numPins = 0
-  local taskInfo = TQ_GetQuestsForPlayerByMapID(db.currentMapID)
+  local taskInfo = TQ_GetQuestsForPlayerByMapID(self.currentMapID)
   if taskInfo then
-    self:UpdateMap(taskInfo, db.currentMapID)
+    self:UpdateMap(taskInfo, self.currentMapID)
   end
-  local numZones = MC_GetNumZones(db.currentMapID)
+  local numZones = MC_GetNumZones(self.currentMapID)
   if numZones then
     for i = 1, numZones do
       local mapAreaID = MC_GetZoneInfo(self.currentMapID, i)
-      local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, db.currentMapID)
+      local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, self.currentMapID)
       if taskInfo then
         self:UpdateMap(taskInfo, mapAreaID)
       end