1 QuestHelper_File
["collect_zone.lua"] = "Development Version"
2 QuestHelper_Loadtime
["collect_zone.lua"] = GetTime()
4 local debug_output
= false
5 if QuestHelper_File
["collect_traveled.lua"] == "Development Version" then debug_output
= true end
12 local function DoZoneUpdate(label
, debugverbose
)
13 local zname
= string.format("%s@@%s@@%s", GetZoneText(), GetRealZoneText(), GetSubZoneText()) -- I don't *think* any zones will have a @@ in them :D
14 if zname
== "@@@@" then return end -- denied
15 if not QHCZ
[zname
] then QHCZ
[zname
] = {} end
16 if not QHCZ
[zname
][label
] then QHCZ
[zname
][label
] = {} end
17 local znl
= QHCZ
[zname
][label
]
19 if debugverbose
and debug_output
then
20 --QuestHelper:TextOut("zoneupdate " .. zname .. " type " .. label)
23 QHCZ
[zname
].mapname
= GetMapInfo()
26 if loc
== "€\000\000\000€\000\000\000€€€" then return end -- this is kind of the "null value"
28 Merger
.Add(znl
, loc
, true)
31 local function OnEvent()
32 DoZoneUpdate("border", true)
36 local function OnUpdate()
37 if lastupdate
+ 15 <= GetTime() then
38 DoZoneUpdate("update")
39 lastupdate
= GetTime()
43 function QH_Collect_Zone_Init(QHCData
, API
)
44 if not QHCData
.zone
then QHCData
.zone
= {} end
47 API
.Registrar_EventHook("ZONE_CHANGED", OnEvent
)
48 API
.Registrar_EventHook("ZONE_CHANGED_INDOORS", OnEvent
)
49 API
.Registrar_EventHook("ZONE_CHANGED_NEW_AREA", OnEvent
)
51 API
.Registrar_OnUpdateHook(OnUpdate
)
53 GetLoc
= API
.Callback_LocationBolusCurrent
54 QuestHelper
: Assert(GetLoc
)
56 Merger
= API
.Utility_Merger
57 QuestHelper
: Assert(Merger
)