mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-12-01 15:35:47 +00:00
8f565c6171
This makes sure engine-internal strings are always present.
20 lines
577 B
Lua
20 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!")
|