added function to cancel active prompt added function to add new spawns from editor added keybind for that

This commit is contained in:
lustlion
2022-03-11 18:39:27 +01:00
parent 3d41699d8f
commit 61b8aa883b
4 changed files with 117 additions and 50 deletions

View File

@@ -7,39 +7,15 @@ editor = {
function stepEditor()
editor.palette_mode = editor.palette_mode or false
animateTiles()
if Keybind:checkPressed(Keybind.editor.room_mode) then
if love.keyboard.isDown("lshift") then
editor.room_mode = "delete"
else
editor.room_mode = not editor.room_mode
if Prompt.active_prompt == nil then
if Keybind:checkPressed(Keybind.editor.room_mode) then
if love.keyboard.isDown("lshift") then
editor.room_mode = "delete"
else
editor.room_mode = not editor.room_mode
end
editor.room_points = {}
end
editor.room_points = {}
end
if Keybind:checkPressed(Keybind.editor.palette_mode) then
if editor.palette_mode then
editor.palette_mode = false
palette_scroll_x = nil
palette_scroll_y = nil
else
editor.palette_mode = true
palette_scroll_x = 0
palette_scroll_y = 0
end
end
if Keybind:checkPressed(Keybind.editor.palette_mode) then
if editor.palette_mode then
editor.palette_mode = false
palette_scroll_x = nil
palette_scroll_y = nil
else
editor.palette_mode = true
palette_scroll_x = 0
palette_scroll_y = 0
end
end
if Keybind:checkPressed(Keybind.editor.palette_mode) then
if editor.palette_mode then
@@ -53,6 +29,31 @@ function stepEditor()
end
end
if Keybind:checkPressed(Keybind.editor.palette_mode) then
if editor.palette_mode then
editor.palette_mode = false
palette_scroll_x = nil
palette_scroll_y = nil
else
editor.palette_mode = true
palette_scroll_x = 0
palette_scroll_y = 0
end
end
if Keybind:checkPressed(Keybind.editor.palette_mode) then
if editor.palette_mode then
editor.palette_mode = false
palette_scroll_x = nil
palette_scroll_y = nil
else
editor.palette_mode = true
palette_scroll_x = 0
palette_scroll_y = 0
end
end
end
-- TODO:
-- i changed this but i dont know what was to do here.
-- - made specific action keybinds
@@ -237,6 +238,10 @@ function doEditorEdit()
promptSpawnArchetype()
elseif Keybind:checkDown(Keybind.editor.entity_modify_data) then
promptSpawnArgs()
elseif Keybind:checkDown(Keybind.editor.entity_remove) then
deleteSpawn()
elseif Keybind:checkDown(Keybind.editor.entity_new) then
promptSpawnNew()
end
end
end