From 6db54f77d87703e495f177b9ebb02177807ca0d6 Mon Sep 17 00:00:00 2001 From: SinnamonLat Date: Mon, 11 Apr 2022 14:50:51 +0200 Subject: [PATCH] Force menus to use default controls for now. Update device in realtime in control setup menu --- src/g_game.c | 5 +++++ src/g_input.c | 2 +- src/k_menufunc.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index ed2998f25..0dc3fb8ef 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -669,6 +669,11 @@ INT32 G_PlayerInputAnalog(UINT8 p, INT32 gc, UINT8 menuPlayers) boolean tryingotherID = false; INT32 *controltable = &(gamecontrol[p][gc][0]); + // Due to issues currently, force menus to use default controls regardless. + // @FIXME ? + if (gamestate == GS_MENU || menuactive == true) + controltable = &(gamecontroldefault[gc][0]); + if (p >= MAXSPLITSCREENPLAYERS) { #ifdef PARANOIA diff --git a/src/g_input.c b/src/g_input.c index 2ab595912..c9486eb35 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -35,7 +35,7 @@ consvar_t cv_controlperkey = CVAR_INIT ("controlperkey", "One", CV_SAVE, onecont // current state of the keys // FRACUNIT for fully pressed, 0 for not pressed INT32 gamekeydown[MAXDEVICES][NUMINPUTS]; -boolean deviceResponding[MAXDEVICES]; +boolean deviceResponding[MAXDEVICES]; // two key codes (or virtual key) per game control INT32 gamecontrol[MAXSPLITSCREENPLAYERS][num_gamecontrols][MAXINPUTMAPPING]; diff --git a/src/k_menufunc.c b/src/k_menufunc.c index bb0915fd8..c90abed0f 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -4040,6 +4040,8 @@ boolean M_ProfileControlsInputs(INT32 ch) if (optionsmenu.bindcontrol) return true; // Eat all inputs there. We'll use a stupid hack in M_Responder instead. + SetDeviceOnPress(); // Update device constantly so that we don't stay stuck with otpions saying a device is unavailable just because we're mapping multiple devices... + if (M_MenuButtonPressed(pid, MBT_C) || M_MenuButtonPressed(pid, MBT_Z)) { // check if we're on a valid menu option...