Separate in-game bindings from menu bindings

Also preemptive version bump
This commit is contained in:
Ishaan Bhardwaj
2021-10-19 18:35:32 -04:00
parent aa56248e34
commit 0fce4b632f
12 changed files with 140 additions and 44 deletions

View File

@@ -5,8 +5,6 @@ KeyConfigScene.title = "Key Config"
require 'load.save'
local configurable_inputs = {
"menu_decide",
"menu_back",
"left",
"right",
"up",
@@ -75,10 +73,15 @@ function KeyConfigScene:onInputPress(e)
if e.scancode == "return" then
-- save new input, then load next scene
local had_config = config.input ~= nil
if not config.input then config.input = {} end
config.input.keys = self.new_input
if not had_config then
config.input = {}
config.input.keys = {}
end
for k, v in pairs(self.new_input) do
config.input.keys[k] = v
end
saveConfig()
scene = had_config and InputConfigScene() or TitleScene()
scene = had_config and InputConfigScene() or MenuConfigScene()
elseif e.scancode == "delete" or e.scancode == "backspace" then
-- retry
self.input_state = 1