1 QuestHelper_File
["collect_zone.lua"] = "Development Version"
3 local debug_output
= false
4 if QuestHelper_File
["collect_traveled.lua"] == "Development Version" then debug_output
= true end
11 local function DoZoneUpdate(label
, debugverbose
)
12 local zname
= string.format("%s@@%s@@%s", GetZoneText(), GetRealZoneText(), GetSubZoneText()) -- I don't *think* any zones will have a @@ in them :D
13 if zname
== "@@@@" then return end -- denied
14 if not QHCZ
[zname
] then QHCZ
[zname
] = {} end
15 if not QHCZ
[zname
][label
] then QHCZ
[zname
][label
] = {} end
16 local znl
= QHCZ
[zname
][label
]
18 if debugverbose
and debug_output
then
19 --QuestHelper:TextOut("zoneupdate " .. zname .. " type " .. label)
22 QHCZ
[zname
].mapname
= GetMapInfo()
24 if #znl
> 0 and string.sub(znl
[#znl
], -#loc
) == loc
then return end -- stop repeating things, a purse is not food
28 local function OnEvent()
29 DoZoneUpdate("border", true)
33 local function OnUpdate()
34 if lastupdate
+ 15 <= GetTime() then
35 DoZoneUpdate("update")
36 lastupdate
= GetTime()
40 function QH_Collect_Zone_Init(QHCData
, API
)
41 if not QHCData
.zone
then QHCData
.zone
= {} end
44 API
.Registrar_EventHook("ZONE_CHANGED", OnEvent
)
45 API
.Registrar_EventHook("ZONE_CHANGED_INDOORS", OnEvent
)
46 API
.Registrar_EventHook("ZONE_CHANGED_NEW_AREA", OnEvent
)
48 API
.Registrar_OnUpdateHook(OnUpdate
)
50 GetLoc
= API
.Callback_LocationBolusCurrent
51 QuestHelper
: Assert(GetLoc
)
53 Merger
= API
.Utility_Merger
54 QuestHelper
: Assert(Merger
)