From fafc8f1583f3f1a74c39a275d4071f4d3ca9ca23 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 15 Aug 2019 04:39:31 +0000 Subject: [PATCH] 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 --- source/duke3d/src/menus.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index cb5edea28..df0c05bff 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -2141,6 +2141,8 @@ static void Menu_Pre(MenuID_t cm) break; 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_PRO, !joystick.isGameController); break;