From 9c91dd03da5492c2ec4a8eab2aecdd0b8f2fbca9 Mon Sep 17 00:00:00 2001 From: luigi budd <4997-luigi-budd@users.noreply.git.do.srb2.org> Date: Fri, 27 Jun 2025 21:16:11 +0000 Subject: [PATCH] port from github ringracers-edit lul --- src/k_menu.h | 2 ++ src/k_menufunc.c | 8 ++++++++ src/menus/options-profiles-edit-1.c | 12 +++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/k_menu.h b/src/k_menu.h index 9fec6b6ba..5567d3825 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1167,6 +1167,8 @@ void M_MapProfileControl(event_t *ev); void M_ProfileTryController(INT32 choice); void M_ProfileControlsConfirm(INT32 choice); +boolean M_ProfileQuitHandle(void); + // video modes menu (resolution) void M_HandleVideoModes(INT32 ch); diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 0e3b1385d..9545b79a3 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -932,6 +932,14 @@ void M_ClearMenus(boolean callexitmenufunc) D_StartTitle(); } + // this is not a good place to put this i thinkMore actions + if (optionsmenu.profile) + { + M_ResetOptions(); + optionsmenu.profile = NULL; + } + + M_AbortVirtualKeyboard(); menumessage.active = false; diff --git a/src/menus/options-profiles-edit-1.c b/src/menus/options-profiles-edit-1.c index be805aa36..96d167dcf 100644 --- a/src/menus/options-profiles-edit-1.c +++ b/src/menus/options-profiles-edit-1.c @@ -52,7 +52,7 @@ menu_t OPTIONS_EditProfileDef = { M_DrawOptionsCogs, M_HandleProfileEdit, NULL, - NULL, + M_ProfileQuitHandle, M_ProfileEditInputs, }; @@ -238,3 +238,13 @@ void M_ProfileDeviceSelect(INT32 choice) M_SetupNextMenu(&OPTIONS_ProfileControlsDef, false); // Don't set device here anymore. } + +boolean M_ProfileQuitHandle(void) +{ + if (optionsmenu.profile != NULL) + { + M_ResetOptions(); // Reset all options variables otherwise things are gonna go reaaal bad lol. + optionsmenu.profile = NULL; // Make sure to get rid of that, too. + } + return false; +} \ No newline at end of file