# HG changeset patch # User Nenue # Date 1483224505 18000 # Node ID 6a2e8583621900cd36831e790f9536be0268f146 # Parent b289eb3e6a32223f1d6637a3e01d90ee62b4e5de - 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 diff -r b289eb3e6a32 -r 6a2e85836219 QuestPOI.lua --- a/QuestPOI.lua Sat Dec 31 17:31:39 2016 -0500 +++ b/QuestPOI.lua Sat Dec 31 17:48:25 2016 -0500 @@ -502,12 +502,15 @@ end end + self:UpdateStatus() +end +-- Called at static intervals and with Refresh +function QuestPOI:UpdateStatus() -- update time elements if TQ_IsActive(self.questID) then - local tl = self.alertLevel - local timeLeft = TQ_GetQuestTimeLeftMinutes(questID) + local timeLeft = TQ_GetQuestTimeLeftMinutes(self.questID) if timeLeft > 0 then local text, timeState = WorldPlan:GetTimeInfo(timeLeft, self.maxAlertLevel) @@ -520,13 +523,19 @@ self:SetShown(false) end end + + if timeLeft and (timeLeft < 120) then + self.HighlightBorder:SetVertexColor(1,0,0,0.7) + elseif self.isBounty then + self.HighlightBorder:SetVertexColor(.25,.5,1,1) + else + self.HighlightBorder:SetVertexColor(0,0,0,0.7) + end self.alertLevel = tl end self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1)) end - - function QuestPOI:Refresh (fromUser) --rprint('|c'..(fromUser and 'FF0088FF' or 'FF00FF88' )..self:GetID()..'|r:Refresh() type =', self.rewardType, 'title =', self.title) @@ -553,7 +562,7 @@ local trackingBorder = self.HighlightBorder local icon = self.icon local count = self.count - local isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID) + self.isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID) if self.itemName then @@ -574,7 +583,10 @@ end end - self.Description:SetText(self.title .. "\n" .. floor(self.x*100+.5) .. "," .. floor(self.y*100+.5)) + if db.Config.ShowVerboseInfo then + self.Description:SetText(self.title .. "\n" .. floor(self.x*100+.5) .. "," .. floor(self.y*100+.5)) + end + icon:SetMask("Interface\\Minimap\\UI-Minimap-Background") if self.itemTexture then @@ -606,19 +618,14 @@ trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") trackingBorder:SetTexture(PENDING_BORDER) - if isBounty then - trackingBorder:SetVertexColor(.25,.5,1) - else - trackingBorder:SetVertexColor(0,0,0,1) - end self.tagIcon:SetShown((not self.filtered) and true or false) self.tagIcon:SetAtlas(self.tagAtlas) self.EliteBorder:SetShown(self.isElite and not self.filtered) - self:UpdateSize() + self:UpdateStatus() self.isStale = nil end diff -r b289eb3e6a32 -r 6a2e85836219 WorldQuests.lua --- a/WorldQuests.lua Sat Dec 31 17:31:39 2016 -0500 +++ b/WorldQuests.lua Sat Dec 31 17:48:25 2016 -0500 @@ -129,6 +129,7 @@ -- WORLD_MAP_UPDATE and PLAYER_ENTERING_WORLD are passed down from a higher level self:RegisterEvent('WORLD_QUEST_COMPLETED_BY_SPELL') + self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED') self:RegisterEvent('SKILL_LINES_CHANGED') end @@ -148,7 +149,7 @@ function Module:OnEvent (event, ...) print('|cFFFFFF00'..self:GetName()..':OnEvent() '..event..'|r', GetTime(), ...) - if event == 'QUEST_LOG_UPDATE' then + if (event == 'QUEST_LOG_UPDATE') or (event == 'SUPER_TRACKED_QUEST_CHANGED') then local questID, added = ... if questID and added then local questPOI = self:AcquirePin(questID)