diff --git a/src/k_menu.h b/src/k_menu.h index 86d0d2bfe..bf06addd4 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -856,6 +856,7 @@ void M_ProfileSetControl(INT32 ch); void M_MapProfileControl(event_t *ev); void M_ProfileTryController(INT32 choice); +void M_ProfileConfirm(INT32 choice); // video modes menu (resolution) void M_VideoModeMenu(INT32 choice); diff --git a/src/k_menudef.c b/src/k_menudef.c index 45d4b37c2..80af93181 100644 --- a/src/k_menudef.c +++ b/src/k_menudef.c @@ -680,8 +680,8 @@ menuitem_t OPTIONS_ProfileControls[] = { {IT_STRING | IT_CALL, "TRY MAPPINGS", "Test your controls.", NULL, {.routine = M_ProfileTryController}, 0, 0}, - {IT_STRING | IT_CALL, "BACK...", "Go back to profile setup.", - NULL, {.routine = M_GoBack}, 0, 0}, + {IT_STRING | IT_CALL, "CONFIRM", "Go back to profile setup.", + NULL, {.routine = M_ProfileConfirm}, 0, 0}, }; diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 234837032..00e46c956 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -5113,6 +5113,24 @@ static void M_ProfileControlSaveResponse(INT32 choice) } } +void M_ProfileConfirm(INT32 choice) +{ + (void)choice; + + //M_StartMessage(M_GetText("Exiting will save the control changes\nfor this Profile.\nIs this okay?\n\n(Press A to confirm)"), FUNCPTRCAST(M_ProfileControlSaveResponse), MM_YESNO); + // TODO: Add a graphic for controls saving, instead of obnoxious prompt. + + M_ProfileControlSaveResponse(MA_YES); + + optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; // Make sure to save kickstart accel. + + // Reapply player 1's real profile. + if (cv_currprofile.value > -1) + { + PR_ApplyProfile(cv_lastprofile[0].value, 0); + } +} + boolean M_ProfileControlsInputs(INT32 ch) { const UINT8 pid = 0; @@ -5165,16 +5183,7 @@ boolean M_ProfileControlsInputs(INT32 ch) } else if (M_MenuBackPressed(pid)) { - //M_StartMessage(M_GetText("Exiting will save the control changes\nfor this Profile.\nIs this okay?\n\n(Press A to confirm)"), FUNCPTRCAST(M_ProfileControlSaveResponse), MM_YESNO); - // TODO: Add a graphic for controls saving, instead of obnoxious prompt. - M_ProfileControlSaveResponse(MA_YES); - - optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; // Make sure to save kickstart accel. - - // Reapply player 1's real profile. - if (cv_currprofile.value > -1) - PR_ApplyProfile(cv_lastprofile[0].value, 0); - + M_ProfileControlsConfirm(); return true; }