From 476ee08960382ad86b9f3f6964a22304ac2d96d2 Mon Sep 17 00:00:00 2001 From: Ludovicus Date: Mon, 11 Mar 2019 20:02:08 -0400 Subject: [PATCH] Add zone/continent/world to '/tway list'. Resolves #3. --- TomTom.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index afabcf0..04be7f9 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -1012,8 +1012,8 @@ end function TomTom:DebugListLocalWaypoints() local m,x,y = self:GetCurrentPlayerPosition() local ctxt = RoundCoords(x, y, 2) - local czone = hbd:GetLocalizedMap(m) - self:Printf(L["You are at (%s) in '%s' (map: %d)"], ctxt, czone or "UNKNOWN", m) + local czone = hbd:GetLocalizedMap(m) or "UNKNOWN" + self:Printf(L["You are at (%s) in '%s' (map: %s)"], ctxt, czone , tostring(m)) if waypoints[m] then for key, wp in pairs(waypoints[m]) do local ctxt = RoundCoords(wp[2], wp[3], 2) @@ -1030,11 +1030,12 @@ end function TomTom:DebugListAllWaypoints() local m,x,y = self:GetCurrentPlayerPosition() local ctxt = RoundCoords(x, y, 2) - local czone = hbd:GetLocalizedMap(m) - self:Printf(L["You are at (%s) in '%s' (map: %d)"], ctxt, czone or "UNKNOWN", m) + local czone = hbd:GetLocalizedMap(m) or "UNKNOWN" + self:Printf(L["You are at (%s) in '%s' (map: %s)"], ctxt, czone, tostring(m)) for m in pairs(waypoints) do + local c,z,w = TomTom:GetCZWFromMapID(m) local zoneName = hbd:GetLocalizedMap(m) - self:Printf("%s:", zoneName) + self:Printf("%s: (map: %d, zone: %s, continent: %s, world: %s)", zoneName, m, tostring(z), tostring(c), tostring(w)) for key, wp in pairs(waypoints[m]) do local ctxt = RoundCoords(wp[2], wp[3], 2) local desc = wp.title and wp.title or L["Unknown waypoint"] @@ -1057,8 +1058,10 @@ end function TomTom:GetCZWFromMapID(m) local zone, continent, world - local mapInfo = nil + + if not m then return nil, nil, nil; end + repeat mapInfo = C_Map.GetMapInfo(m) if not mapInfo then -- 1.7.9.5