comparison QuestPOI.lua @ 55:6a2e85836219

- Re-color the outer border of pins when their quest is bounty-related (blue), or time remaining is under 2 hours (red). - Respond to SUPER_TRACKED_QUEST_CHANGED correctly
author Nenue
date Sat, 31 Dec 2016 17:48:25 -0500
parents b289eb3e6a32
children 0749e38081e7
comparison
equal deleted inserted replaced
54:b289eb3e6a32 55:6a2e85836219
500 if self.PendingFade:IsPlaying() then 500 if self.PendingFade:IsPlaying() then
501 self.PendingFade:Stop() 501 self.PendingFade:Stop()
502 end 502 end
503 end 503 end
504 504
505 505 self:UpdateStatus()
506 end
507
508 -- Called at static intervals and with Refresh
509 function QuestPOI:UpdateStatus()
506 -- update time elements 510 -- update time elements
507 if TQ_IsActive(self.questID) then 511 if TQ_IsActive(self.questID) then
508
509 local tl = self.alertLevel 512 local tl = self.alertLevel
510 local timeLeft = TQ_GetQuestTimeLeftMinutes(questID) 513 local timeLeft = TQ_GetQuestTimeLeftMinutes(self.questID)
511 if timeLeft > 0 then 514 if timeLeft > 0 then
512 515
513 local text, timeState = WorldPlan:GetTimeInfo(timeLeft, self.maxAlertLevel) 516 local text, timeState = WorldPlan:GetTimeInfo(timeLeft, self.maxAlertLevel)
514 if tl ~= timeState then 517 if tl ~= timeState then
515 tl = timeState 518 tl = timeState
518 else 521 else
519 if self.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION then 522 if self.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION then
520 self:SetShown(false) 523 self:SetShown(false)
521 end 524 end
522 end 525 end
526
527 if timeLeft and (timeLeft < 120) then
528 self.HighlightBorder:SetVertexColor(1,0,0,0.7)
529 elseif self.isBounty then
530 self.HighlightBorder:SetVertexColor(.25,.5,1,1)
531 else
532 self.HighlightBorder:SetVertexColor(0,0,0,0.7)
533 end
523 self.alertLevel = tl 534 self.alertLevel = tl
524 end 535 end
525 self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1)) 536 self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1))
526 end 537 end
527
528
529 538
530 function QuestPOI:Refresh (fromUser) 539 function QuestPOI:Refresh (fromUser)
531 540
532 --rprint('|c'..(fromUser and 'FF0088FF' or 'FF00FF88' )..self:GetID()..'|r:Refresh() type =', self.rewardType, 'title =', self.title) 541 --rprint('|c'..(fromUser and 'FF0088FF' or 'FF00FF88' )..self:GetID()..'|r:Refresh() type =', self.rewardType, 'title =', self.title)
533 542
551 local questID = self:GetID() 560 local questID = self:GetID()
552 local iconBorder = self.RewardBorder 561 local iconBorder = self.RewardBorder
553 local trackingBorder = self.HighlightBorder 562 local trackingBorder = self.HighlightBorder
554 local icon = self.icon 563 local icon = self.icon
555 local count = self.count 564 local count = self.count
556 local isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID) 565 self.isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID)
557 566
558 if self.itemName then 567 if self.itemName then
559 568
560 if self.itemNumber then 569 if self.itemNumber then
561 local numberString = self.itemNumber 570 local numberString = self.itemNumber
572 else 581 else
573 self.count:SetText(nil) 582 self.count:SetText(nil)
574 end 583 end
575 end 584 end
576 585
577 self.Description:SetText(self.title .. "\n" .. floor(self.x*100+.5) .. "," .. floor(self.y*100+.5)) 586 if db.Config.ShowVerboseInfo then
587 self.Description:SetText(self.title .. "\n" .. floor(self.x*100+.5) .. "," .. floor(self.y*100+.5))
588 end
589
578 590
579 icon:SetMask("Interface\\Minimap\\UI-Minimap-Background") 591 icon:SetMask("Interface\\Minimap\\UI-Minimap-Background")
580 if self.itemTexture then 592 if self.itemTexture then
581 --iconBorder:SetTexture(WORLD_QUEST_BORDER) 593 --iconBorder:SetTexture(WORLD_QUEST_BORDER)
582 594
604 iconBorder:SetDesaturated(true) 616 iconBorder:SetDesaturated(true)
605 iconBorder:SetAlpha(subStyle.alpha or 1) 617 iconBorder:SetAlpha(subStyle.alpha or 1)
606 618
607 trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") 619 trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background")
608 trackingBorder:SetTexture(PENDING_BORDER) 620 trackingBorder:SetTexture(PENDING_BORDER)
609 if isBounty then
610 trackingBorder:SetVertexColor(.25,.5,1)
611 else
612 trackingBorder:SetVertexColor(0,0,0,1)
613 end
614 621
615 self.tagIcon:SetShown((not self.filtered) and true or false) 622 self.tagIcon:SetShown((not self.filtered) and true or false)
616 self.tagIcon:SetAtlas(self.tagAtlas) 623 self.tagIcon:SetAtlas(self.tagAtlas)
617 624
618 self.EliteBorder:SetShown(self.isElite and not self.filtered) 625 self.EliteBorder:SetShown(self.isElite and not self.filtered)
619 626
620
621 self:UpdateSize() 627 self:UpdateSize()
628 self:UpdateStatus()
622 self.isStale = nil 629 self.isStale = nil
623 end 630 end
624 631
625 local cvar_check = { 632 local cvar_check = {
626 [REWARD_CASH] = 'worldQuestFilterGold', 633 [REWARD_CASH] = 'worldQuestFilterGold',