fix state thigns and port to love11

This commit is contained in:
Your Name 2026-08-07 20:56:42 -04:00
parent ff5abf6bcd
commit c92c0f6ff7
11 changed files with 130 additions and 96 deletions

View file

@ -136,14 +136,14 @@ local function drawWorldSidebar()
love.graphics.rectangle("line", worldSearchBox.x, worldSearchBox.y, worldSearchBox.w, worldSearchBox.h)
love.graphics.printf("SEARCH: " .. worldSearchText, worldSearchBox.x + 6, worldSearchBox.y + 7, worldSearchBox.w - 12, "left")
for _, button in ipairs(worldRoomButtons) do
love.graphics.setColor(button.name == selectedRoom and 255 or 100, button.name == selectedRoom and 255 or 100, button.name == selectedRoom and 255 or 100, 255)
love.graphics.setColor(button.name == selectedRoom and 1 or 100 / 255, button.name == selectedRoom and 1 or 100 / 255, button.name == selectedRoom and 1 or 100 / 255, 1)
love.graphics.rectangle("line", button.x, button.y, button.w, button.h)
gameWorld:drawRoomPreview(button.name, button.x + 4, button.y + 4, button.h - 8)
love.graphics.setColor(gColor.white:set())
love.graphics.printf(button.name, button.x + button.h + 4, button.y + 21, button.w - button.h - 8, "left")
end
for _, control in ipairs(worldControls) do
love.graphics.setColor(255, 255, 255, 255)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.rectangle("line", control.x, control.y, control.w, control.h)
love.graphics.printf(control.text, control.x, control.y + 9, control.w, "center")
end

View file

@ -1,6 +1,6 @@
GUI = class("level_editor/gui")
GUI.static.pressSound = love.audio.newSource("sounds/ui/button.wav")
GUI.static.pressSound = love.audio.newSource("sounds/ui/button.wav", "static")
GUI.static.defaultCallbac = function() print("this button has not been configured") end

View file

@ -34,7 +34,7 @@ function getAllAssets()
-- 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
if love.filesystem.getInfo(metaPath, "file") then
globalAssetProperties[name].class = TSerial.unpack(love.filesystem.read(metaPath)).class
elseif not globalAssetProperties[name].class then
globalAssetProperties[name].class = "immoveable"
@ -45,7 +45,7 @@ function getAllAssets()
if not globalAssetProperties[name].cells or reanalyzeCells then
globalAssetProperties[name].cells = {}
globalAssetProperties[name].cells[color] = getCellsFromSprite(love.graphics.newImage(sprite))
globalAssetProperties[name].cells[color] = getCellsFromSprite(sprite)
end
end
end
@ -54,4 +54,4 @@ function getAllAssets()
end
return globalAssetProperties
end
end