level editor improvements

This commit is contained in:
Your Name 2026-08-07 00:56:33 -04:00
parent 886679816b
commit a8b469876d
41 changed files with 8367 additions and 8312 deletions

View file

@ -24,14 +24,22 @@ function getAllAssets()
local name = fileToAnalyze:sub(1, fileToAnalyze:len() - 6)
if not globalAssetProperties[name] then
if not globalAssetProperties[name] then
globalAssetProperties[name] = {}
globalAssetProperties[name].directory = folder
globalAssetProperties[name].sprites = {}
globalAssetProperties[name].class = "unmoveable"
globalAssetProperties[name].preload = false
end
-- class comes from a <name>.meta sitting next to the art
-- (authoritative); default to immoveable if none exists
local metaPath = topFolder .. "/" .. folder .. "/" .. name .. ".meta"
if love.filesystem.exists(metaPath) then
globalAssetProperties[name].class = TSerial.unpack(love.filesystem.read(metaPath)).class
elseif not globalAssetProperties[name].class then
globalAssetProperties[name].class = "immoveable"
end
local sprite = topFolder .. "/" .. folder .. "/" .. fileToAnalyze
globalAssetProperties[name].sprites[color] = sprite
@ -45,7 +53,5 @@ function getAllAssets()
end
end
str = TSerial.pack(globalAssetProperties, nil, true)
love.filesystem.write("assets.prop", str)
return globalAssetProperties
end