cleaned up stepEditor()
This commit is contained in:
parent
9c070e161f
commit
5f48756e2e
@ -1,13 +1,13 @@
|
|||||||
assert(editor == nil)
|
assert(editor == nil)
|
||||||
editor = {
|
editor = {
|
||||||
room_mode = false,
|
room_mode = false,
|
||||||
palette_mode = false
|
palette_mode = false,
|
||||||
|
pan = { fixed = false, speed = 3 },
|
||||||
}
|
}
|
||||||
|
|
||||||
function stepEditor()
|
function stepEditor()
|
||||||
editor.palette_mode = editor.palette_mode or false
|
editor.palette_mode = editor.palette_mode or false
|
||||||
animateTiles()
|
animateTiles()
|
||||||
if Prompt.active_prompt == nil then
|
|
||||||
if Keybind:checkPressed(Keybind.editor.room_mode) then
|
if Keybind:checkPressed(Keybind.editor.room_mode) then
|
||||||
if love.keyboard.isDown("lshift") then
|
if love.keyboard.isDown("lshift") then
|
||||||
editor.room_mode = "delete"
|
editor.room_mode = "delete"
|
||||||
@ -16,7 +16,6 @@ function stepEditor()
|
|||||||
end
|
end
|
||||||
editor.room_points = {}
|
editor.room_points = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
if Keybind:checkPressed(Keybind.editor.palette_mode) then
|
if Keybind:checkPressed(Keybind.editor.palette_mode) then
|
||||||
if editor.palette_mode then
|
if editor.palette_mode then
|
||||||
editor.palette_mode = false
|
editor.palette_mode = false
|
||||||
@ -29,47 +28,28 @@ function stepEditor()
|
|||||||
end
|
end
|
||||||
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
|
local cvel = Point:new(0, 0)
|
||||||
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
|
|
||||||
if Keybind:checkDown(Keybind.editor.left) then
|
if Keybind:checkDown(Keybind.editor.left) then
|
||||||
Camera.pos.x = Camera.pos.x - 3
|
cvel.x = -1
|
||||||
end
|
end
|
||||||
if Keybind:checkDown(Keybind.editor.right) then
|
if Keybind:checkDown(Keybind.editor.right) then
|
||||||
Camera.pos.x = Camera.pos.x + 3
|
cvel.x = 1
|
||||||
end
|
end
|
||||||
if Keybind:checkDown(Keybind.editor.up) then
|
if Keybind:checkDown(Keybind.editor.up) then
|
||||||
Camera.pos.y = Camera.pos.y - 3
|
cvel.y = -1
|
||||||
end
|
end
|
||||||
if Keybind:checkDown(Keybind.editor.down) then
|
if Keybind:checkDown(Keybind.editor.down) then
|
||||||
Camera.pos.y = Camera.pos.y + 3
|
cvel.y = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cvel = cvel * editor.pan.speed
|
||||||
|
if not editor.pan.fixed then
|
||||||
|
cvel = cvel / game.scale
|
||||||
|
end
|
||||||
|
|
||||||
|
Camera.pos = Camera.pos + cvel
|
||||||
|
|
||||||
if editor.palette_mode then
|
if editor.palette_mode then
|
||||||
if Keybind:checkPressed(Keybind.editor.palette_change) then
|
if Keybind:checkPressed(Keybind.editor.palette_change) then
|
||||||
local next = false
|
local next = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user