changeset 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
files QuestPOI.lua WorldQuests.lua
diffstat 2 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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)