diff QuestPOI.lua @ 53:44baf4f35c7c

- Fix missing pin numerals in the flight map. - Make use of nudge factors in flight map overlays.
author Nenue
date Fri, 30 Dec 2016 20:43:58 -0500
parents 6439015d74b1
children b289eb3e6a32
line wrap: on
line diff
--- a/QuestPOI.lua	Fri Dec 30 18:31:32 2016 -0500
+++ b/QuestPOI.lua	Fri Dec 30 20:43:58 2016 -0500
@@ -426,37 +426,23 @@
 
 local overlayBaseIndex = 1300
 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)
-    if not dX or dX == 0 then
-      local _, x, y = QuestPOIGetIconInfo(self.questID)
-      if x and floor(x) ~= 0 then
-        dX, dY = x, y
-      else
-        dX, dY = self.x, self.y
-      end
-    end
-  end
-  if not (mapHeight and mapWidth) then
-    mapWidth, mapHeight = owner:GetSize()
-  end
-  local pX = (dX * mapWidth)
-  local pY = (-dY * mapHeight)
-
-
-  self.x = dX
-  self.y = dY
   self:SetParent(owner)
   self:ClearAllPoints()
-  self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY)
+  self.Overlay:SetParent(owner)
+  self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID())
+  if (dX and dY) then
+    if not (mapHeight and mapWidth) then
+      mapWidth, mapHeight = owner:GetSize()
+      end
+    local pX = (dX * mapWidth)
+    local pY = (-dY * mapHeight)
+    self.x = dX
+    self.y = dY
+    self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY)
+  else
+    self:SetPoint('CENTER')
+  end
   self:SetShown(self.used)
-
-  self.Overlay:SetParent(owner)
-  self.Overlay:ClearAllPoints()
-  self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4)
-  self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4)
-  self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID())
 end
 
 function QuestPOI:OnLoad()
@@ -471,6 +457,9 @@
   self.itemName = '|cFF0088FF' .. RETRIEVING_DATA..'|r'
 
   self:SetScript('OnMouseDown', TaskPOI_OnClick)
+
+  self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4)
+  self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4)
 end
 
 function QuestPOI:OnEvent(event, ...)