Mercurial > wow > worldplan
comparison WorldQuests.lua @ 82:26d736fbfe67 v1.4.4
- Fixed filter bar issues
| author | Nenue |
|---|---|
| date | Mon, 10 Apr 2017 17:29:28 -0400 |
| parents | 5d33e98710a0 |
| children | a12f782571c5 |
comparison
equal
deleted
inserted
replaced
| 81:2a86d6584ddd | 82:26d736fbfe67 |
|---|---|
| 571 end | 571 end |
| 572 end | 572 end |
| 573 | 573 |
| 574 -- Updates quest markers in taskInfo while associating them with the given map | 574 -- Updates quest markers in taskInfo while associating them with the given map |
| 575 function Module:UpdateQuestsForMap(taskInfo, mapID) | 575 function Module:UpdateQuestsForMap(taskInfo, mapID) |
| 576 if mapID then | 576 print('UpdateQuestsForMap()', GetMapNameByID(mapID), GetMapNameByID(db.currentMapID), layoutDirty) |
| 577 db.QuestsByZone[mapID] = db.QuestsByZone[mapID] or {} | 577 if db.QuestsByZone[mapID] then |
| 578 wipe(db.QuestsByZone[mapID]) | 578 wipe(db.QuestsByZone[mapID]) |
| 579 end | 579 end |
| 580 print('UpdateQuestsForMap()', GetMapNameByID(mapID), GetMapNameByID(db.currentMapID), layoutDirty) | 580 |
| 581 | |
| 581 for index, info in pairs(taskInfo) do | 582 for index, info in pairs(taskInfo) do |
| 582 | 583 |
| 583 local questID, x, y = info.questId, info.x, info.y | 584 local questID, x, y = info.questId, info.x, info.y |
| 584 local pin = self:AcquirePin(info) | 585 local pin = self:AcquirePin(info) |
| 585 | 586 |
| 586 if pin then | 587 if pin then |
| 587 print(pin.title, pin.isStale) | 588 print(pin.title, pin.isStale, layoutDirty, (pin.owningFrame ~= WorldMapFrame)) |
| 588 if pin:IsShown() and (layoutDirty or pin.isStale or (pin.owningFrame ~= WorldMapFrame)) then | 589 if pin:IsShown() and (layoutDirty or pin.isStale or (pin.owningFrame ~= WorldMapFrame)) then |
| 589 local scaleFactor = SCALE_FACTORS[(pin.dataLoaded and not pin.filtered) and scaleConstant or 1] | 590 local scaleFactor = SCALE_FACTORS[(pin.dataLoaded and not pin.filtered) and scaleConstant or 1] |
| 590 pin.owningFrame = WorldMapFrame | 591 pin.owningFrame = WorldMapFrame |
| 591 pin:SetAnchor(WorldMapPOIFrame, x, y, self.hostWidth, self.hostHeight, scaleFactor) | 592 pin:SetAnchor(WorldMapPOIFrame, x, y, self.hostWidth, self.hostHeight, scaleFactor) |
| 592 if pin.isStale then | 593 if pin.isStale then |
| 593 pin:Refresh('WORLDMAP_REFRESH ' .. GetTime()) | 594 pin:Refresh('WORLDMAP_REFRESH ' .. GetTime()) |
| 594 end | 595 end |
| 595 if mapID then | |
| 596 db.QuestsByZone[mapID][questID] = pin | |
| 597 end | |
| 598 else | 596 else |
| 599 if layoutDirty then | 597 if layoutDirty then |
| 600 pin.isStale = true | 598 pin.isStale = true |
| 601 end | 599 end |
| 602 end | 600 end |
| 603 | 601 |
| 602 if db.QuestsByZone[mapID] and pin.used then | |
| 603 db.QuestsByZone[mapID][questID] = pin | |
| 604 end | |
| 604 | 605 |
| 605 end | 606 end |
| 606 end | 607 end |
| 607 end | 608 end |
| 608 | 609 |
| 632 local numZones = MC_GetNumZones(db.currentMapID) | 633 local numZones = MC_GetNumZones(db.currentMapID) |
| 633 if numZones then | 634 if numZones then |
| 634 for i = 1, numZones do | 635 for i = 1, numZones do |
| 635 local mapAreaID = MC_GetZoneInfo(db.currentMapID, i) | 636 local mapAreaID = MC_GetZoneInfo(db.currentMapID, i) |
| 636 local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, db.currentMapID) | 637 local taskInfo = TQ_GetQuestsForPlayerByMapID(mapAreaID, db.currentMapID) |
| 638 | |
| 639 db.QuestsByZone[mapAreaID] = db.QuestsByZone[mapAreaID] or {} | |
| 640 | |
| 637 if taskInfo then | 641 if taskInfo then |
| 638 self:UpdateQuestsForMap(taskInfo, mapAreaID) | 642 self:UpdateQuestsForMap(taskInfo, mapAreaID) |
| 639 end | 643 end |
| 640 end | 644 end |
| 641 end | 645 end |
