From 0a5bc1476d9deaf10c4d59bb28b7e5243fd6464e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Qu=E1=BB=91c=20H=C6=B0ng?= <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Fri, 9 Aug 2024 10:45:48 +0700 Subject: [PATCH] Attempt to fix soft lock in stick conf. screen --- scene/stick_config.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scene/stick_config.lua b/scene/stick_config.lua index d39ba48..47362d7 100644 --- a/scene/stick_config.lua +++ b/scene/stick_config.lua @@ -72,14 +72,12 @@ function StickConfigScene:onInputPress(e) if e.type == "key" then -- function keys, escape, and tab are reserved and can't be remapped if e.scancode == "escape" or (self.input_state > #configurable_inputs and e.input == "menu_back") then - SCENE = InputConfigScene() + SCENE = InputConfigScene(SETTINGS.firstTime) elseif self.input_state > #configurable_inputs then - if e.scancode == "return" or e.input == "" then - -- save new input, then load next scene - local had_config = SETTINGS.input ~= nil - if not SETTINGS.input then SETTINGS.input = {} end - SETTINGS.input.joysticks = self.new_input - SCENE = had_config and InputConfigScene() or TitleScene() + if e.scancode == "return" or e.input == "menu_decide" then + SETTINGS.input.keys = self.new_input + SCENE = SETTINGS.firstTime and TitleScene() or InputConfigScene() + SETTINGS.firstTime = false elseif e.scancode == "delete" or e.scancode == "backspace" then -- retry self.input_state = 1