Automated update from: http://smariot.no-ip.org/translate
[QuestHelper.git] / tomtom.lua
blob872c77e1ec30c51c109ec316ea060440ef9a0653
1 QuestHelper_File["tomtom.lua"] = "Development Version"
2 QuestHelper_Loadtime["tomtom.lua"] = GetTime()
4 local tomtom_cb
5 local tomtom_uid
7 local function tomtom_wp_update(c, z, x, y, desc)
8 if tomtom_uid then
9 TomTom:RemoveWaypoint(tomtom_uid)
10 tomtom_uid = nil
11 end
13 if not QuestHelper_Pref.hide and c and c >= 0 and z and x and y then -- so there
14 tomtom_uid = TomTom:AddZWaypoint(c, z, x*100, y*100, desc, false, false, false)
15 end
16 end
18 function QuestHelper:EnableTomTom()
19 if TomTom then
20 if not tomtom_cb then
21 tomtom_cb = QuestHelper:AddWaypointCallback(tomtom_wp_update)
22 end
23 end
24 end
26 function QuestHelper:DisableTomTom()
27 if tomtom_cb then
28 if tomtom_uid then
29 TomTom:RemoveWaypoint(tomtom_uid)
30 end
32 QuestHelper:RemoveWaypointCallback(tomtom_cb)
33 tomtom_cb = nil
34 end
35 end