Logged level export
This commit is contained in:
parent
1f7d967f77
commit
e7aa34d5c2
|
@ -3,15 +3,21 @@ function ExportLevel(levelname)
|
|||
local success, message = love.filesystem.write(filename, "")
|
||||
if success then
|
||||
love.filesystem.append(filename, "return {")
|
||||
logPrint("Exporting level \"".. filename .. "\"...")
|
||||
love.filesystem.append(filename, "\n name = \"" .. levelname .. "\",")
|
||||
logPrint("- level name")
|
||||
for k, v in pairs(tileset) do
|
||||
if v == LevelData.tileset then
|
||||
love.filesystem.append(filename, "\n tileset = tileset." .. k .. ",")
|
||||
logPrint("- tileset")
|
||||
end
|
||||
end
|
||||
love.filesystem.append(filename, "\n tiles = {")
|
||||
logPrint("- tiles")
|
||||
local rows = #LevelTiles
|
||||
for i = 1, #LevelTiles do
|
||||
love.filesystem.append(filename, "\n { ")
|
||||
logPrint(" - Row "..i.."/"..rows.." "..math.floor(100*((i-1)*100/rows))/100 .."%")
|
||||
for j = 1, #LevelTiles[i] do
|
||||
if j ~= 1 then
|
||||
love.filesystem.append(filename, ", ")
|
||||
|
@ -23,9 +29,12 @@ function ExportLevel(levelname)
|
|||
love.filesystem.append(filename, ", ")
|
||||
end
|
||||
end
|
||||
logPrint(" - All rows 100%")
|
||||
love.filesystem.append(filename, "\n },")
|
||||
love.filesystem.append(filename, "\n objects = {}")
|
||||
logPrint("- objects")
|
||||
love.filesystem.append(filename, "\n}")
|
||||
logPrint("Exporting complete.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue