Quantcast

Allow precise placement of coord text on world map.

Ludovicus [07-05-19 - 18:25]
Allow precise placement of coord text on world map.
Filename
TomTom.lua
TomTom_Config.lua
diff --git a/TomTom.lua b/TomTom.lua
index f6a72a9..cf723ec 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -47,8 +47,10 @@ function TomTom:Initialize(event, addon)
             mapcoords = {
                 playerenable = true,
                 playeraccuracy = 2,
+                playeroffset = 0,
                 cursorenable = true,
                 cursoraccuracy = 2,
+                cursoroffset = 0,
 				throttle = 0.1,
             },
             arrow = {
@@ -324,11 +326,15 @@ function TomTom:ShowHideWorldCoords()
         TomTomWorldFrame.Cursor:ClearAllPoints()

         if WorldMapMixin.isMaximized then
-            TomTomWorldFrame.Player:SetPoint("TOPLEFT", WorldMapFrame.BorderFrame, "TOPLEFT",   30, -6)
-            TomTomWorldFrame.Cursor:SetPoint("TOPLEFT",  WorldMapFrame.BorderFrame, "TOPRIGHT",  -170, -6)
+            TomTomWorldFrame.Player:SetPoint("TOPLEFT", WorldMapFrame.BorderFrame, "TOPLEFT",
+                                             self.db.profile.mapcoords.playeroffset, -6)
+            TomTomWorldFrame.Cursor:SetPoint("TOPLEFT",  WorldMapFrame.BorderFrame, "TOPRIGHT",
+                                             - self.db.profile.mapcoords.cursoroffset + -170, -6)
         else
-            TomTomWorldFrame.Player:SetPoint("TOPLEFT", WorldMapFrame.BorderFrame, "TOPLEFT", 100, -6)
-            TomTomWorldFrame.Cursor:SetPoint("TOPLEFT",  WorldMapFrame.BorderFrame, "TOPRIGHT", -170, -6)
+            TomTomWorldFrame.Player:SetPoint("TOPLEFT", WorldMapFrame.BorderFrame, "TOPLEFT",
+                                                        self.db.profile.mapcoords.playeroffset + 100, -6)
+            TomTomWorldFrame.Cursor:SetPoint("TOPLEFT",  WorldMapFrame.BorderFrame, "TOPRIGHT",
+                                                         - self.db.profile.mapcoords.cursoroffset + -170, -6)
         end

         TomTomWorldFrame.Player:Hide()
diff --git a/TomTom_Config.lua b/TomTom_Config.lua
index a60a05e..380043f 100755
--- a/TomTom_Config.lua
+++ b/TomTom_Config.lua
@@ -521,6 +521,14 @@ local function createconfig()
 						min = 0, max = 2, step = 1,
 						arg = "mapcoords.playeraccuracy",
 					},
+					playeroffset = {
+						order = 8,
+						type = "range",
+						name = L["Player coordinate offset"],
+						desc = L["Coordinates can be slid from the default location, to accomodate other addons.  This setting allows you to control that offset"],
+						min = -16, max = 48, step = 1,
+						arg = "mapcoords.playeroffset",
+					},
 				},
 			},
 			cursor = {
@@ -536,7 +544,6 @@ local function createconfig()
 						width = "double",
 						arg = "mapcoords.cursorenable",
 					},
-
 					cursoraccuracy = {
 						order = 5,
 						type = "range",
@@ -545,6 +552,15 @@ local function createconfig()
 						min = 0, max = 2, step = 1,
 						arg = "mapcoords.cursoraccuracy",
 					},
+					cursoroffset = {
+						order = 7,
+						type = "range",
+						name = L["Cursor coordinate offset"],
+						desc = L["Coordinates can be slid from the default location, to accomodate other addons.  This setting allows you to control that offset"],
+						min = -32, max = 64, step = 1,
+						arg = "mapcoords.cursoroffset",
+					},
+
 				},
 			},
 		},