Misspelled my email address.
[QuestHelper.git] / tomtom.lua
blobe911b478a245ef17ff3cdc45d5fb5065c842cf74
1 QuestHelper_File["tomtom.lua"] = "Development Version"
3 local tomtom_cb
4 local tomtom_uid
6 local function tomtom_wp_update(c, z, x, y, desc)
7 if tomtom_uid then
8 TomTom:RemoveWaypoint(tomtom_uid)
9 tomtom_uid = nil
10 end
12 if c then
13 tomtom_uid = TomTom:AddZWaypoint(c, z, x*100, y*100, desc, false, false, false)
14 end
15 end
17 function QuestHelper:EnableTomTom()
18 if TomTom then
19 if not tomtom_cb then
20 tomtom_cb = QuestHelper:AddWaypointCallback(tomtom_wp_update)
21 end
22 end
23 end
25 function QuestHelper:DisableTomTom()
26 if tomtom_cb then
27 if tomtom_uid then
28 TomTom:RemoveWaypoint(tomtom_uid)
29 end
31 QuestHelper:RemoveWaypointCallback(tomtom_cb)
32 tomtom_cb = nil
33 end
34 end