change editor_mode to editor.active, minor refactor, and start work on multiselect

This commit is contained in:
binarycat
2022-03-12 11:46:45 -05:00
parent 27f1dc71c0
commit f091fba9f7
3 changed files with 19 additions and 16 deletions

View File

@@ -6,9 +6,10 @@ function love.load()
secs = 0
menu_type = "no"
-- FIXME: this overrides a standard library!
debug = false
debug_collision = false
editor_mode = false
--editor_mode = false
text_size = 1
@@ -103,6 +104,15 @@ function love.update(dt)
return
end
if Keybind:checkPressed(Keybind.debug.editor) then
if editor.active then
deselectSpawns()
createTileObjects()
restartGame()
end
editor.active = not editor.active
end
if love.keyboard.isDown("f7") then
local test_prompt = Prompt:new({
name = "test prompt",
@@ -127,7 +137,7 @@ function love.update(dt)
if menu_type ~= nil then stepMenu(menu_type) end
--editor
if editor_mode then
if editor.active then
stepEditor()
else
stepGame()
@@ -136,7 +146,7 @@ end
function love.wheelmoved(_, y)
if editor_mode then
if editor.active then
scrollEditor(y)
end
end
@@ -150,7 +160,7 @@ function love.draw()
game_resize = false
end
if editor_mode then
if editor.active then
drawEditor()
else
drawGame()