diff --git a/load/save.lua b/load/save.lua index ca20cdf..fb5f38b 100644 --- a/load/save.lua +++ b/load/save.lua @@ -31,7 +31,7 @@ function initConfig() end if not config.input then - scene = KeyConfigScene() + scene = InputConfigScene() else if config.current_mode then current_mode = config.current_mode end if config.current_ruleset then current_ruleset = config.current_ruleset end diff --git a/load/version.lua b/load/version.lua index e069d17..2e43ba6 100644 --- a/load/version.lua +++ b/load/version.lua @@ -1 +1 @@ -version = "v0.3-beta5" \ No newline at end of file +version = "v0.3-beta5.1" \ No newline at end of file diff --git a/scene/input_config.lua b/scene/input_config.lua index f61d942..64a91c9 100644 --- a/scene/input_config.lua +++ b/scene/input_config.lua @@ -29,7 +29,7 @@ function ConfigScene:render() love.graphics.print("INPUT CONFIG", 80, 40) love.graphics.setFont(font_3x5_2) - love.graphics.print("Which controls do you want to change?", 80, 90) + love.graphics.print("Which controls do you want to configure?", 80, 90) love.graphics.setColor(1, 1, 1, 0.5) love.graphics.rectangle("fill", 75, 118 + 50 * self.menu_state, 200, 33) @@ -56,7 +56,9 @@ function ConfigScene:onInputPress(e) elseif e.input == "down" or e.scancode == "down" then self:changeOption(1) playSE("cursor") - elseif e.input == "menu_back" or e.scancode == "backspace" or e.scancode == "delete" then + elseif config.input and ( + e.input == "menu_back" or e.scancode == "backspace" or e.scancode == "delete" + ) then scene = SettingsScene() end end diff --git a/scene/key_config.lua b/scene/key_config.lua index adc74f9..68fb8b7 100644 --- a/scene/key_config.lua +++ b/scene/key_config.lua @@ -69,8 +69,7 @@ end function KeyConfigScene:onInputPress(e) if e.type == "key" then -- function keys, escape, and tab are reserved and can't be remapped - if e.scancode == "escape" and config.input then - -- cancel only if there was an input config already + if e.scancode == "escape" then scene = InputConfigScene() elseif self.input_state > table.getn(configurable_inputs) then if e.scancode == "return" then diff --git a/scene/stick_config.lua b/scene/stick_config.lua index b7c420b..3614611 100644 --- a/scene/stick_config.lua +++ b/scene/stick_config.lua @@ -82,9 +82,11 @@ function StickConfigScene:onInputPress(e) elseif self.input_state > table.getn(configurable_inputs) then if e.scancode == "return" then -- save new input, then load next scene - config.input.joysticks = self.new_input + local had_config = config.input ~= nil + if not config.input then config.input = {} end + config.input.joysticks = self.new_input saveConfig() - scene = InputConfigScene() + scene = had_config and InputConfigScene() or TitleScene() elseif e.scancode == "delete" or e.scancode == "backspace" then -- retry self.input_state = 1