1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 12:03:51 +00:00
Aquaria/tools/stringbank_gen.lua

21 lines
577 B
Lua
Raw Normal View History

local out = { "// Generated by tools/stringbank_gen.lua" }
for line in io.lines"../files/data/stringbank.txt" do
if #line > 0 then
local id, str = line:match"^%s*(%d+)%s*(.*)$"
if not id then
error("Parse error: " .. line)
end
str = str:gsub("|", "\\n")
str = "BANKSTRING(" .. id .. ", \"" .. str .. "\")"
print(str)
table.insert(out, str)
end
end
table.insert(out, "\n")
local fh = assert(io.open("../Aquaria/StringBank_gen.h", "w"))
fh:write(table.concat(out, "\n"))
fh:close()
print("All done!")