let's go modify libaboutpanel
[QuestHelper.git] / collect_merger.lua
blob33fc40718ee7dd0574339042e2d0c97f123016da
1 QuestHelper_File["collect_merger.lua"] = "Development Version"
2 QuestHelper_Loadtime["collect_merger.lua"] = GetTime()
5 local function Add(self, data, stoprepeat) -- NOTE: if you're getting errors about adding tables, you probably did Merger:Add instead of Merger.Add
6 if stoprepeat and #self > 0 and string.sub(self[#self], -#data) == data then return end
7 table.insert(self, data)
8 for i = #self - 1, 1, -1 do
9 if string.len(self[i]) > string.len(self[i + 1]) then break end
10 self[i] = self[i] .. table.remove(self, i + 1)
11 end
12 end
13 local function Finish(self, data)
14 for i = #self - 1, 1, -1 do
15 self[i] = self[i] .. table.remove(self)
16 end
17 return self[1] or ""
18 end
20 function QH_Collect_Merger_Init(_, API)
21 API.Utility_Merger = {Add = Add, Finish = Finish}
22 end