This commit is contained in:
Your Name 2026-08-21 10:57:32 -04:00
parent 6d41894036
commit ad405ed590
5 changed files with 397 additions and 12 deletions

View file

@ -15,6 +15,7 @@ require "room"
require "world"
require "world_seed"
require "shaders"
require "map_manager"
GameUI = require "game_ui"
require "level_editor/editor"
@ -96,9 +97,10 @@ function love.update(dt)
Input:stopMoveRepeat()
else
local repeatedMove = Input:handler(dt)
if repeatedMove and not Dialogue.isOpen() then gameWorld:movePlayer(currentRoom, repeatedMove) end
if repeatedMove and not Dialogue.isOpen() and not MapManager:isOpen() then gameWorld:movePlayer(currentRoom, repeatedMove) end
end
currentRoom:update(dt)
MapManager:record(currentRoom)
-- if love.keyboard.isDown("w") then worldSha = worldSha + 1 end
-- if love.keyboard.isDown("s") then worldSha = worldSha - 1 end
@ -108,14 +110,16 @@ function love.draw()
love.graphics.setCanvas(gameCanvas)
love.graphics.clear()
love.graphics.setBlendMode("screen")
if DEBUG and editorView == "world" then
if MapManager:isOpen() then
MapManager:draw()
elseif DEBUG and editorView == "world" then
gameWorld:draw()
elseif DEBUG and editorView == "wire" then
gameWorld:drawWireEditor(wireEditorCamera())
else
currentRoom:draw()
end
GameUI.drawColorVenn(currentRoom)
if MapManager:isOpen() then MapManager:drawVenn() else GameUI.drawColorVenn(currentRoom) end
love.graphics.setCanvas(finalCanvas)
love.graphics.clear()
@ -211,6 +215,13 @@ function love.keypressed(key)
return
end
-- The map overlay is modal: `m` toggles it, and while open it swallows keys.
-- But not while an editor text field is focused, or typing "m" in a search /
-- name box would open the map instead of entering the character.
if not (DEBUG and editorTextFieldActive()) then
if MapManager:keypressed(key) then return end
end
-- The focused note text field owns the keyboard entirely: arrows navigate the
-- text instead of moving the player, Return inserts a newline, etc.
if DEBUG and noteEditorActive() then