Added TomTom to menu button. If both TomTom and Cartographer are available, the names...
[QuestHelper.git] / tomtom.lua
bloba53cd14c629b368979284d610c772b72633948bb
1 local tomtom_cb
2 local tomtom_uid
4 local function tomtom_wp_update(c, z, x, y, desc)
5 if tomtom_uid then
6 TomTom:RemoveWaypoint(tomtom_uid)
7 tomtom_uid = nil
8 end
10 if c then
11 tomtom_uid = TomTom:AddZWaypoint(c, z, x*100, y*100, desc, false, false, false)
12 end
13 end
15 function QuestHelper:EnableTomTom()
16 if TomTom then
17 if not tomtom_cb then
18 tomtom_cb = QuestHelper:AddWaypointCallback(tomtom_wp_update)
19 end
20 end
21 end
23 function QuestHelper:DisableTomTom()
24 if tomtom_cb then
25 if tomtom_uid then
26 TomTom:RemoveWaypoint(tomtom_uid)
27 end
29 QuestHelper:RemoveWaypointCallback(tomtom_cb)
30 tomtom_cb = nil
31 end
32 end