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_zone.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 do return end -- we really don't need this anymore
46 if not QHCData
.zone
then QHCData
.zone
= {} end
49 QH_Event("ZONE_CHANGED", OnEvent
)
50 QH_Event("ZONE_CHANGED_INDOORS", OnEvent
)
51 QH_Event("ZONE_CHANGED_NEW_AREA", OnEvent
)
53 API
.Registrar_OnUpdateHook(OnUpdate
)
55 GetLoc
= API
.Callback_LocationBolusCurrent
56 QuestHelper
: Assert(GetLoc
)
58 Merger
= API
.Utility_Merger
59 QuestHelper
: Assert(Merger
)