change editor_mode to editor.active, minor refactor, and start work on multiselect
This commit is contained in:
18
main.lua
18
main.lua
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user