diff --git a/level_editor/object_attributes.lua b/level_editor/object_attributes.lua index a9aeab0..3836e26 100644 --- a/level_editor/object_attributes.lua +++ b/level_editor/object_attributes.lua @@ -1,10 +1,7 @@ require "libs/TSerial" local targetFolder = "art" - -function get(folder) - -end +local reanalyzeCells = true function getAllAssets() local objectnames = {} @@ -34,7 +31,14 @@ function getAllAssets() globalAssetProperties[name].class = "unmoveable" globalAssetProperties[name].preload = false end - globalAssetProperties[name].sprites[color] = topFolder .. "/" .. folder .. "/" .. fileToAnalyze + + local sprite = topFolder .. "/" .. folder .. "/" .. fileToAnalyze + globalAssetProperties[name].sprites[color] = sprite + + if not globalAssetProperties[name].cells or reanalyzeCells then + globalAssetProperties[name].cells = {} + globalAssetProperties[name].cells[color] = getCellsFromSprite(love.graphics.newImage(sprite)) + end end end end