From 4f2fe163bc99629d75a3e6bd1bb640588602c791 Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Sat, 15 Apr 2023 19:01:49 +0200 Subject: [PATCH] Fix rebinding "menu" (esc) bindings to different actions Ever since 2.3, if you bind a controller button to the "menu" action (i.e. back/escape) you won't be able to change that button to any other action, because pressing it anywhere in the binding menu will exit to the previous menu, without applying the binding. I know action sets will overhaul everything, but 2.4 may (probably "should") come out before we have action sets. This part is very broken, and the fix is very easy: just move the bind-assigning code to above the menu-return-on-esc code, and add a return. --- desktop_version/src/Input.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index b08d65d8..0bf4b045 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -2210,6 +2210,18 @@ void titleinput(void) game.jumpheld = true; } + if ( game.currentmenuname == Menu::controller && + game.currentmenuoption > 0 && + game.currentmenuoption < 6 && + (game.separate_interact || game.currentmenuoption < 5) && + key.controllerButtonDown() ) + { + updatebuttonmappings(game.currentmenuoption); + music.playef(11); + game.savestatsandsettings_menu(); + return; + } + if (game.menustart && game.menucountdown <= 0 && (key.isDown(27) || key.isDown(game.controllerButton_esc))) @@ -2363,17 +2375,6 @@ void titleinput(void) menuactionpress(); } } - if ( game.currentmenuname == Menu::controller && - game.currentmenuoption > 0 && - game.currentmenuoption < 6 && - (game.separate_interact || game.currentmenuoption < 5) && - key.controllerButtonDown() ) - { - updatebuttonmappings(game.currentmenuoption); - music.playef(11); - game.savestatsandsettings_menu(); - } - } if (fadetomode)