From a08d970e9063090172beac91bd9acd01a17ca501 Mon Sep 17 00:00:00 2001 From: Jim Whitehead Date: Thu, 10 Nov 2016 20:38:40 +0100 Subject: [PATCH] Fix issue with non-titled waypoints Thanks to AnrDaemon for the patch, this makes it possible to distinguish between waypoints set by TomTom without a title and those set by another addon. --- TomTom.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index 13adb16..d57bfeb 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -451,7 +451,9 @@ WorldMapButton_OnClick = function(self, ...) return origScript and origScript(self, ...) or true end - local uid = TomTom:AddMFWaypoint(m,f,x,y) + local uid = TomTom:AddMFWaypoint(m, f, x, y, { + title = L["TomTom waypoint"], + }) else return origScript and origScript(self, ...) or true end @@ -705,7 +707,7 @@ end local function _both_tooltip_show(event, tooltip, uid, dist) local data = uid - tooltip:SetText(data.title or L["TomTom waypoint"]) + tooltip:SetText(data.title or L["Unknown waypoint"]) if dist and tonumber(dist) then tooltip:AddLine(string.format(L["%s yards away"], math.floor(dist)), 1, 1, 1) else @@ -1380,7 +1382,7 @@ SlashCmdList["TOMTOM_WAY"] = function(msg) x = tonumber(x) y = tonumber(y) TomTom:AddMFWaypoint(mapId, nil, x/100, y/100, { - title = desc, + title = desc or L["TomTom waypoint"], }) elseif tonumber(tokens[1]) then -- A vanilla set command @@ -1399,7 +1401,7 @@ SlashCmdList["TOMTOM_WAY"] = function(msg) local m, f = TomTom:GetCurrentPlayerPosition() if m and x and y then TomTom:AddMFWaypoint(m, f, x/100, y/100, { - title = desc + title = desc or L["TomTom waypoint"], }) end else -- 1.7.9.5