TourGuide - Cleanup of submitted Dun Morough guide
[WoW-TourGuide.git] / Mapping.lua
blob32a1edd50ec53449231f8af4ed819cb5ea847085
3 local zonei, zonec = {}, {}
4 for ci,c in pairs{GetMapContinents()} do
5 for zi,z in pairs{GetMapZones(ci)} do
6 zonei[z], zonec[z] = zi, ci
7 end
8 end
11 local function MapPoint(zone, x, y, desc)
12 local zi, zc = zone and zonei[zone], zone and zonec[zone]
13 if not zi then
14 if zone then TourGuide:PrintF("Cannot find zone %q, using current zone.", zone)
15 else TourGuide:Print("No zone provided, using current zone.") end
17 zi, zc = GetCurrentMapZone(), GetCurrentMapContinent()
18 end
20 if TomTom then TomTom:AddZWaypoint(zc, zi, x, y, desc) --AddZWaypoint(c,z,x,y,desc) select(z, GetMapZones(c))
21 elseif Cartographer_Waypoints then Cartographer_Waypoints:AddLHWaypoint(zc, zi, x, y, desc) end -- continent, zone, x, y desc
22 end
25 function TourGuide:ParseAndMapCoords(note, desc, zone)
26 for x,y in note:gmatch("%(([%d.]+),%s?([%d.]+)%)") do MapPoint(zone, tonumber(x), tonumber(y), desc) end
27 end
30 --~ TODO: function TourGuide:PurgeWaypoints(desc)
31 --~ end