COnfirm box now respects rebindable accelerate and brake on keyboards

This commit is contained in:
Ashnal 2020-08-19 18:01:56 -04:00
parent eb81bea943
commit 7c5740d98f

View file

@ -1980,9 +1980,11 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
#endif // ifndef NONET #endif // ifndef NONET
static void M_ConfirmConnect(INT32 ch) static void M_ConfirmConnect(event_t *ev)
{ {
if (ch == ' ' || ch == 'y' || ch == KEY_ENTER) if (ev->type == ev_keydown)
{
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[gc_accelerate][0] || ev->data1 == gamecontrol[gc_accelerate][1])
{ {
if (totalfilesrequestednum > 0) if (totalfilesrequestednum > 0)
{ {
@ -2005,11 +2007,12 @@ static void M_ConfirmConnect(INT32 ch)
M_ClearMenus(true); M_ClearMenus(true);
} }
else if (ch == 'n' || ch == KEY_ESCAPE) else if (ev->data1 == 'n' || ev->data1 == KEY_ESCAPE|| ev->data1 == gamecontrol[gc_brake][0] || ev->data1 == gamecontrol[gc_brake][1])
{ {
cl_mode = CL_ABORTED; cl_mode = CL_ABORTED;
M_ClearMenus(true); M_ClearMenus(true);
} }
}
} }
static boolean CL_FinishedFileList(void) static boolean CL_FinishedFileList(void)
@ -2060,7 +2063,7 @@ static boolean CL_FinishedFileList(void)
"You may load server addons (if any), and wait for a slot.\n" "You may load server addons (if any), and wait for a slot.\n"
"\n" "\n"
"Press ACCEL to continue or BRAKE to cancel.\n\n" "Press ACCEL to continue or BRAKE to cancel.\n\n"
), M_ConfirmConnect, MM_YESNO); ), M_ConfirmConnect, MM_EVENTHANDLER);
cl_mode = CL_CONFIRMCONNECT; cl_mode = CL_CONFIRMCONNECT;
} }
else else
@ -2120,13 +2123,13 @@ static boolean CL_FinishedFileList(void)
"You may download, load server addons, and wait for a slot.\n" "You may download, load server addons, and wait for a slot.\n"
"\n" "\n"
"Press ACCEL to continue or BRAKE to cancel.\n\n" "Press ACCEL to continue or BRAKE to cancel.\n\n"
), downloadsize), M_ConfirmConnect, MM_YESNO); ), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
else else
M_StartMessage(va(M_GetText( M_StartMessage(va(M_GetText(
"Download of %s additional content is required to join.\n" "Download of %s additional content is required to join.\n"
"\n" "\n"
"Press ACCEL to continue or BRAKE to cancel.\n\n" "Press ACCEL to continue or BRAKE to cancel.\n\n"
), downloadsize), M_ConfirmConnect, MM_YESNO); ), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
Z_Free(downloadsize); Z_Free(downloadsize);
cl_mode = CL_CONFIRMCONNECT; cl_mode = CL_CONFIRMCONNECT;