diff QuestPOI.lua @ 52:6439015d74b1

- Set and use callbacks for the BountyBoard and ActionButton elements. - Check BountyBoard selections when updating pin visual - Check SpellCanTargetQuest() when determining pin visibility states
author Nenue
date Fri, 30 Dec 2016 18:31:32 -0500
parents 3066f3ef1258
children 44baf4f35c7c
line wrap: on
line diff
--- a/QuestPOI.lua	Thu Dec 29 13:36:40 2016 -0500
+++ b/QuestPOI.lua	Fri Dec 30 18:31:32 2016 -0500
@@ -189,7 +189,6 @@
 
 function QuestPOI:OnEnter()
   if not WorldMapFrame:IsVisible() then
-    WorldMap_HijackTooltip(self.owningFrame)
   end
   if self.filtered then
     return
@@ -426,7 +425,7 @@
 end
 
 local overlayBaseIndex = 1300
-function QuestPOI:SetAnchor(dX, dY, mapWidth, mapHeight)
+function QuestPOI:SetAnchor(owner, dX, dY, mapWidth, mapHeight)
   local oX, oY = self.x, self.y
   if not (dX and dY) then
     local dX, dY = TQ_GetQuestLocation(self.questID)
@@ -440,7 +439,7 @@
     end
   end
   if not (mapHeight and mapWidth) then
-    mapWidth, mapHeight = self:GetParent():GetSize()
+    mapWidth, mapHeight = owner:GetSize()
   end
   local pX = (dX * mapWidth)
   local pY = (-dY * mapHeight)
@@ -448,11 +447,12 @@
 
   self.x = dX
   self.y = dY
+  self:SetParent(owner)
   self:ClearAllPoints()
-  self:SetPoint('CENTER', self:GetParent(), 'TOPLEFT', pX, pY)
+  self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY)
   self:SetShown(self.used)
 
-  self.Overlay:SetParent(self.owningFrame)
+  self.Overlay:SetParent(owner)
   self.Overlay:ClearAllPoints()
   self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4)
   self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4)
@@ -545,7 +545,7 @@
 
   local styleType = (self.isPending and STYLE_TYPE_PENDING) or self.rewardType
   local style,subStyle =  self:GetTypeInfo(self.rewardType)
-  if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then
+  if (self.filtered or (not self.dataLoaded)) and (self.questID ~= GetSuperTrackedQuestID()) then
     subStyle = style.minimized
   end
   self.style = style
@@ -563,6 +563,7 @@
   local trackingBorder = self.HighlightBorder
   local icon = self.icon
   local count = self.count
+  local isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID)
 
   if self.itemName then
 
@@ -604,7 +605,12 @@
 
   iconBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background")
   iconBorder:SetTexture(PENDING_BORDER)
-  iconBorder:SetVertexColor(style.r, style.g, style.b, 1)
+  if isBounty then
+    iconBorder:SetVertexColor(0,.4,.9)
+  else
+    iconBorder:SetVertexColor(style.r, style.g, style.b, 1)
+  end
+
   iconBorder:SetDesaturated(true)
   iconBorder:SetAlpha(subStyle.alpha or 1)
 
@@ -658,7 +664,10 @@
     return self.used, self.filtered
   end
   self.used = TQ_IsActive(self.questID)
-  if qType == LE_QUEST_TAG_TYPE_PROFESSION then
+  if SpellCanTargetQuest() then
+    -- hiding so player can click a valid target
+    self.used = nil
+  elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then
     if (not self.isKnownProfession) and  (db.Config.ShowAllProfessionQuests == false) then
       self.used = nil
     end