changeset 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
files FlightMap.lua QuestPOI.lua
diffstat 2 files changed, 20 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/FlightMap.lua	Fri Dec 30 18:31:32 2016 -0500
+++ b/FlightMap.lua	Fri Dec 30 20:43:58 2016 -0500
@@ -39,8 +39,8 @@
 function WorldPlanDataProvider:OnLoad()
 
   self:SetNudgeTargetFactor(0.015);
-  self:SetNudgeZoomedOutFactor(1.0);
-  self:SetNudgeZoomedInFactor(0.25);
+  self:SetNudgeZoomedOutFactor(0.5);
+  self:SetNudgeZoomedInFactor(0.15);
 end
 
 function WorldPlanDataProvider:OnShow()
@@ -116,14 +116,7 @@
                 -- sticking it onto the MapCanvas pin
                 pin.throttle = 1
                 pin.isStale = true
-                pin:SetParent(frame)
-                pin:ClearAllPoints()
-                pin:SetPoint('CENTER')
-                pin.Overlay:SetParent(frame)
-                pin.Overlay:ClearAllPoints()
-                pin.Overlay:SetPoint('TOPLEFT', pin, 'TOPLEFT', 0, 4)
-                pin.Overlay:SetPoint('BOTTOMRIGHT', pin, 'BOTTOMRIGHT', 0, -4)
-                pin.Overlay:SetShown(true)
+                pin:SetAnchor(frame)
                 --print(pin.Overlay:IsShown(), pin.Overlay:GetPoint(1))
               end
               pin:SetShown(pin.used)
--- 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, ...)