Add confirmation and removal to bindings menu

This makes the following improvements to the gamepad bindings menu:

- The menu now shows a hint that you can press a button while any of
  the bind options are selected (or that you can navigate away from
  those options)
- Instead of button presses immediately setting a binding, they now
  ask for confirmation: press the same button a second time to confirm
- You can now remove a binding, the same way you add it (this has the
  same type of confirmation)
- This menu used to be inconsistent with pretty much every other menu
  in the game by showing a permanent title and description for the menu
  itself ("Game Pad", "Change controller options.") rather than showing
  a title and description for the currently selected option.
  This inconsistency is now fixed.
This commit is contained in:
Dav999
2025-04-16 05:44:13 +02:00
committed by Ethan Lee
parent 75035047ad
commit d730528118
7 changed files with 182 additions and 44 deletions

View File

@@ -254,6 +254,10 @@ void Game::init(void)
levelpage=0;
playcustomlevel=0;
gpmenu_lastbutton = SDL_CONTROLLER_BUTTON_INVALID;
gpmenu_confirming = false;
gpmenu_showremove = false;
silence_settings_error = false;
deathcounts = 0;
@@ -7009,7 +7013,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
option(loc::gettext("bind restart"));
option(loc::gettext("bind interact"), separate_interact);
option(loc::gettext("return"));
menuyoff = 0;
menuyoff = 12;
maxspacing = 10;
break;
case Menu::language: