From f317f697766dc415d9a2c81e41d9fa6c6a743324 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 16 Aug 2019 10:45:19 +0300 Subject: [PATCH] - added ability to enter main menu from credits screen via controller There was only one way to enter main menu (by pressing Escape button) from the last intermission screen after episode's end Controller's buttons that are usually assigned to this action, Start and Back by default, now open main menu as well https://forum.zdoom.org/viewtopic.php?t=65632 --- src/intermission/intermission.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 22226b563..290dae96e 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -860,6 +860,15 @@ bool DIntermissionController::Responder (event_t *ev) { return false; } + + // The following is needed to be able to enter main menu with a controller, + // by pressing buttons that are usually assigned to this action, Start and Back by default + if (!stricmp(cmd, "menu_main") || !stricmp(cmd, "pause")) + { + M_StartControlPanel(true); + M_SetMenu(NAME_Mainmenu, -1); + return true; + } } if (mScreen->mTicker < 2) return false; // prevent some leftover events from auto-advancing