mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-25 17:53:47 +00:00
21 lines
577 B
Lua
21 lines
577 B
Lua
|
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!")
|