adjusted hook to be toggle; renamed HasPressed to CheckPressed (keybind)

This commit is contained in:
lustlion
2022-02-12 20:03:48 +01:00
parent 6566e6fbab
commit 9d1e59b46a
6 changed files with 107 additions and 26 deletions

View File

@@ -1,7 +1,8 @@
function EditorStep()
palette = palette or false
AnimateTiles()
if Keybind:HasPressed(Keybind.editor.palette) then
if Keybind:CheckPressed(Keybind.editor.palette) then
if palette then
palette = false
palette_scroll_x = nil
@@ -26,7 +27,7 @@ function EditorStep()
end
if palette then
if Keybind:HasPressed(Keybind.debug.debug) then
if Keybind:CheckPressed(Keybind.debug.debug) then
local next = false
local export = nil
for k, v in pairs(tileset) do
@@ -51,11 +52,11 @@ function EditorStep()
end
end
if Keybind:HasPressed(Keybind.debug.reload) then
if Keybind:CheckPressed(Keybind.debug.reload) then
ExportLevel("test")
end
if Keybind:HasPressed(Keybind.debug.editor) then
if Keybind:CheckPressed(Keybind.debug.editor) then
editor_mode = false
TileCreateObjects()
end
@@ -126,10 +127,10 @@ function EditorDoEdit()
end
LevelReloadTiles()
elseif Keybind:HasPressed(Keybind.generic.lshift) then
elseif Keybind:CheckPressed(Keybind.generic.lshift) then
LevelExpandCanvas(math.sign(expand_h),math.sign(expand_v))
LevelReloadTiles()
elseif Keybind:HasPressed(Keybind.generic.lctrl) then
elseif Keybind:CheckPressed(Keybind.generic.lctrl) then
LevelReduceCanvas(math.sign(expand_h),math.sign(expand_v))
LevelReloadTiles()
end