comparison 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
comparison
equal deleted inserted replaced
55:6a2e85836219 56:0749e38081e7
57 for mapID, mapName in pairs(WORLD_QUEST_MAPS) do 57 for mapID, mapName in pairs(WORLD_QUEST_MAPS) do
58 db.QuestsByZone[mapID] = {} 58 db.QuestsByZone[mapID] = {}
59 end 59 end
60 60
61 hooksecurefunc("ClickWorldMapActionButton", function () self:OnClickWorldMapActionButton() end) 61 hooksecurefunc("ClickWorldMapActionButton", function () self:OnClickWorldMapActionButton() end)
62 hooksecurefunc("WorldMapScrollFrame_ReanchorQuestPOIs", function () self:Refresh() end) 62 hooksecurefunc("WorldMapScrollFrame_ReanchorQuestPOIs", InternalDoRefresh)
63 hooksecurefunc("WorldMap_UpdateQuestBonusObjectives", function () self:OnUpdateQuestBonusObjectives() end) 63 hooksecurefunc("WorldMap_UpdateQuestBonusObjectives", function () self:OnUpdateQuestBonusObjectives() end)
64 64 hooksecurefunc("WorldMapFrame_UpdateMap", InternalDoRefresh)
65
66 WorldMapFrame.UIElementsFrame.BountyBoard:SetSelectedBountyChangedCallback(InternalDoRefresh); 65 WorldMapFrame.UIElementsFrame.BountyBoard:SetSelectedBountyChangedCallback(InternalDoRefresh);
67 WorldMapFrame.UIElementsFrame.ActionButton:SetOnCastChangedCallback(InternalDoRefresh); 66 WorldMapFrame.UIElementsFrame.ActionButton:SetOnCastChangedCallback(InternalDoRefresh);
68 end 67 end
69 68
70 function Module:OnConfigUpdate() 69 function Module:OnConfigUpdate()
131 self:RegisterEvent('WORLD_QUEST_COMPLETED_BY_SPELL') 130 self:RegisterEvent('WORLD_QUEST_COMPLETED_BY_SPELL')
132 self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED') 131 self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED')
133 self:RegisterEvent('SKILL_LINES_CHANGED') 132 self:RegisterEvent('SKILL_LINES_CHANGED')
134 end 133 end
135 134
136 function Module:OnMapInfo(isBrokenIsle, isContinent, mapAreaID) 135 function Module:OnMapInfo(isBrokenIsle, isZoomedOut, mapAreaID)
137 print('|cFFFFFF00'..self:GetName()..':OnMapInfo()|r visible =', self:IsVisible()) 136 print('|cFFFFFF00'..self:GetName()..':OnMapInfo()|r visible =', self:IsVisible())
138 if self.isContinent ~= isContinent then 137 if self.isZoomedOut ~= isZoomedOut then
139 self.sizesDirty = true 138 self.sizesDirty = true
140 end 139 end
141 self.isContinent = isContinent 140
141 self.isZoomedOut = isZoomedOut
142 self.isWorldQuestMap = isBrokenIsle
143 self.currentMapID = mapAreaID
144
142 if self:IsVisible() then 145 if self:IsVisible() then
143 self:Refresh(true) 146 self:Refresh(true)
144 else 147 else
145 self.isStale = true 148 self.isStale = true
146 end 149 end
469 472
470 if x and y then 473 if x and y then
471 pin.x = x 474 pin.x = x
472 pin.y = y 475 pin.y = y
473 pin:SetFrameLevel(PinBaseIndex+pin:GetID()) 476 pin:SetFrameLevel(PinBaseIndex+pin:GetID())
477 pin.owningFrame = self.hostFrame
474 pin:SetAnchor(self.hostFrame, pin.x, pin.y, self.hostWidth, self.hostHeight) 478 pin:SetAnchor(self.hostFrame, pin.x, pin.y, self.hostWidth, self.hostHeight)
475 --tinsert(self.UsedPositions, pin) 479 --tinsert(self.UsedPositions, pin)
476 end 480 end
477 if self.sizesDirty then 481 if self.sizesDirty then
478 if self:IsVisible() then 482 if self:IsVisible() then
509 if isMicroDungeon then 513 if isMicroDungeon then
510 return 514 return
511 end 515 end
512 516
513 numPins = 0 517 numPins = 0
514 local taskInfo = TQ_GetQuestsForPlayerByMapID(db.currentMapID) 518 local taskInfo = TQ_GetQuestsForPlayerByMapID(self.currentMapID)
515 if taskInfo then 519 if taskInfo then
516 self:UpdateMap(taskInfo, db.currentMapID) 520 self:UpdateMap(taskInfo, self.currentMapID)
517 end 521 end
518 local numZones = MC_GetNumZones(db.currentMapID) 522 local numZones = MC_GetNumZones(self.currentMapID)
519 if numZones then 523 if numZones then
520 for i = 1, numZones do 524 for i = 1, numZones do
521 local mapAreaID = MC_GetZoneInfo(self.currentMapID, i) 525 local mapAreaID = MC_GetZoneInfo(self.currentMapID, i)
522 local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, db.currentMapID) 526 local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, self.currentMapID)
523 if taskInfo then 527 if taskInfo then
524 self:UpdateMap(taskInfo, mapAreaID) 528 self:UpdateMap(taskInfo, mapAreaID)
525 end 529 end
526 end 530 end
527 end 531 end