Menus: Disable the gamepad axes and buttons menus if opening them would cause an abort due to having no items

git-svn-id: https://svn.eduke32.com/eduke32@8012 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-08-15 04:39:31 +00:00 committed by Christoph Oelckers
parent 0855428a0c
commit fafc8f1583

View file

@ -2141,6 +2141,8 @@ static void Menu_Pre(MenuID_t cm)
break; break;
case MENU_JOYSTICKSETUP: case MENU_JOYSTICKSETUP:
MenuEntry_DisableOnCondition(&ME_JOYSTICK_EDITBUTTONS, !CONTROL_JoyPresent || (joystick.numButtons == 0 && joystick.numHats == 0));
MenuEntry_DisableOnCondition(&ME_JOYSTICK_EDITAXES, !CONTROL_JoyPresent || joystick.numAxes == 0);
MenuEntry_DisableOnCondition(&ME_JOYSTICK_DEFAULTS_STANDARD, !joystick.isGameController); MenuEntry_DisableOnCondition(&ME_JOYSTICK_DEFAULTS_STANDARD, !joystick.isGameController);
MenuEntry_DisableOnCondition(&ME_JOYSTICK_DEFAULTS_PRO, !joystick.isGameController); MenuEntry_DisableOnCondition(&ME_JOYSTICK_DEFAULTS_PRO, !joystick.isGameController);
break; break;