Mercurial > wow > worldplan
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 56:0749e38081e7 | 57:54aa7f8ebca8 |
|---|---|
| 168 if questID and db.QuestsByID[questID] then | 168 if questID and db.QuestsByID[questID] then |
| 169 self:ReleasePin(db.QuestsByID[questID]) | 169 self:ReleasePin(db.QuestsByID[questID]) |
| 170 rprint('|cFFFF4400release|r', questID) | 170 rprint('|cFFFF4400release|r', questID) |
| 171 end | 171 end |
| 172 elseif event == 'SKILL_LINES_CHANGED' then | 172 elseif event == 'SKILL_LINES_CHANGED' then |
| 173 self:SetFilteredPins() | 173 self:Refresh(true) |
| 174 end | 174 end |
| 175 end | 175 end |
| 176 | 176 |
| 177 local totalPins = 0 | 177 local totalPins = 0 |
| 178 local TQ_GetQuestLocation = C_TaskQuest.GetQuestLocation | 178 local TQ_GetQuestLocation = C_TaskQuest.GetQuestLocation |
| 229 | 229 |
| 230 if not pin.dataLoaded then | 230 if not pin.dataLoaded then |
| 231 pin:GetData() | 231 pin:GetData() |
| 232 end | 232 end |
| 233 | 233 |
| 234 | 234 pin:CheckFilterRules() |
| 235 | |
| 236 pin:IsFiltered() | |
| 237 pin:IsShowable() | |
| 238 pin.isStale = true | 235 pin.isStale = true |
| 239 rprint(pin:GetID(), pin.filtered, pin.used) | 236 rprint(pin:GetID(), pin.filtered, pin.used) |
| 240 | 237 |
| 241 return pin | 238 return pin |
| 242 end | 239 end |
| 432 rprint('|cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal') | 429 rprint('|cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal') |
| 433 print('|cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal') | 430 print('|cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal') |
| 434 if not self:IsVisible() then | 431 if not self:IsVisible() then |
| 435 print(' not visible, flag for later') | 432 print(' not visible, flag for later') |
| 436 self.isStale = true | 433 self.isStale = true |
| 437 return | 434 return self:MarkAllPins() |
| 438 end | 435 end |
| 439 wprint(' |cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal') | 436 wprint(' |cFF00FF88'..self:GetName()..':Refresh()|r', fromUser or '|cFFFFFF00internal') |
| 440 | 437 |
| 441 for index, pin in pairs(db.QuestsByID) do | 438 for index, pin in pairs(db.QuestsByID) do |
| 442 pin.used = nil | 439 pin.used = nil |
| 447 self.isStale = nil | 444 self.isStale = nil |
| 448 self.sizesDirty = nil | 445 self.sizesDirty = nil |
| 449 end | 446 end |
| 450 | 447 |
| 451 -- update visibility states of all pins | 448 -- update visibility states of all pins |
| 452 function Module:SetFilteredPins(pins) | 449 function Module:MarkAllPins(pins) |
| 453 print(' |cFFFFFF00'..self:GetName()..':SetFilteredPins()|r', pins) | 450 print(' |cFFFFFF00'..self:GetName()..':MarkAllPins()|r', pins) |
| 454 pins = pins or db.QuestsByID | 451 pins = pins or db.QuestsByID |
| 455 for questID, pin in pairs(pins) do | 452 for questID, pin in pairs(pins) do |
| 456 pin.isStale = true | 453 pin.isStale = true |
| 457 rprint('|cFF00FF00filter', pin.questID, pin.filtered, 'used:', pin.used) | 454 rprint('|cFF00FF00filter', pin.questID, pin.filtered, 'used:', pin.used) |
| 458 end | 455 end |
| 465 if not pin then | 462 if not pin then |
| 466 return | 463 return |
| 467 end | 464 end |
| 468 | 465 |
| 469 | 466 |
| 470 --print('~ ', pin.mapID, pin.questID, pin.title) | 467 print('~ ', pin.mapID, pin.questID, pin.title) |
| 471 rprint('|cFF00FF00update|r', x, y, pin.mapID, pin.questID, pin.title) | 468 rprint('|cFF00FF00update|r', pin.questID, pin.title) |
| 472 | 469 |
| 473 if x and y then | 470 if x and y then |
| 474 pin.x = x | 471 pin.x = x |
| 475 pin.y = y | 472 pin.y = y |
| 476 pin:SetFrameLevel(PinBaseIndex+pin:GetID()) | 473 pin:SetFrameLevel(PinBaseIndex+pin:GetID()) |
| 477 pin.owningFrame = self.hostFrame | 474 pin.owningFrame = WorldMapFrame |
| 478 pin:SetAnchor(self.hostFrame, pin.x, pin.y, self.hostWidth, self.hostHeight) | 475 pin:SetAnchor(WorldMapPOIFrame, pin.x, pin.y, self.hostWidth, self.hostHeight) |
| 479 --tinsert(self.UsedPositions, pin) | 476 --tinsert(self.UsedPositions, pin) |
| 480 end | 477 end |
| 481 if self.sizesDirty then | 478 if self:IsVisible() then |
| 482 if self:IsVisible() then | 479 pin:Refresh() |
| 483 pin:Refresh() | 480 else |
| 484 else | 481 pin.isStale = true |
| 485 pin.isStale = true | |
| 486 end | |
| 487 end | 482 end |
| 488 if mapID then | 483 if mapID then |
| 489 if not db.QuestsByZone[mapID] then | 484 if not db.QuestsByZone[mapID] then |
| 490 db.QuestsByZone[mapID] = {} | 485 db.QuestsByZone[mapID] = {} |
| 491 end | 486 end |
| 501 end | 496 end |
| 502 | 497 |
| 503 function Module:UpdateAnchors (fromUser) | 498 function Module:UpdateAnchors (fromUser) |
| 504 wipe(self.UsedPositions) | 499 wipe(self.UsedPositions) |
| 505 print(' |cFF00FF00'..self:GetName()..':UpdateAnchors()', fromUser) | 500 print(' |cFF00FF00'..self:GetName()..':UpdateAnchors()', fromUser) |
| 506 self.hostFrame = WorldMapPOIFrame | 501 self.hostWidth, self.hostHeight = WorldMapPOIFrame:GetSize() |
| 507 self.hostWidth, self.hostHeight = self.hostFrame:GetSize() | |
| 508 self.nudgeThrescholdX = 16/self.hostWidth | 502 self.nudgeThrescholdX = 16/self.hostWidth |
| 509 self.nudgeThrescholdY = 16/self.hostHeight | 503 self.nudgeThrescholdY = 16/self.hostHeight |
| 510 local print = rprint | 504 local print = rprint |
| 511 print('|cFF00FF00'..self:GetName()..':UpdateAnchors()', fromUser) | 505 print('|cFF00FF00'..self:GetName()..':UpdateAnchors()', fromUser) |
| 512 local mapFileName, textureHeight, textureWidth, isMicroDungeon, microDungeonMapName = GetMapInfo() | 506 local mapFileName, textureHeight, textureWidth, isMicroDungeon, microDungeonMapName = GetMapInfo() |
