1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

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.
This commit is contained in:
Dav999-v 2023-04-15 19:01:49 +02:00 committed by Misa Elizabeth Kai
parent c6ebf5aeda
commit 4f2fe163bc

View file

@ -2210,6 +2210,18 @@ void titleinput(void)
game.jumpheld = true; 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 if (game.menustart
&& game.menucountdown <= 0 && game.menucountdown <= 0
&& (key.isDown(27) || key.isDown(game.controllerButton_esc))) && (key.isDown(27) || key.isDown(game.controllerButton_esc)))
@ -2363,17 +2375,6 @@ void titleinput(void)
menuactionpress(); 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) if (fadetomode)