From 91f8f5b55665f3a1639e5ba075abfd52150c53f8 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 23 Feb 2017 10:20:02 +0200 Subject: [PATCH] Restored EndGameMenu as a pseudo-class Fixes the following error: Attempting to open menu of unknown type 'EndGameMenu' At least Adventures of Square is using this class in main menu --- src/menu/menu.cpp | 5 +++++ src/menu/messagebox.cpp | 27 ++++++++++++++++----------- src/namedef.h | 1 + 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index fe5af6268..e4920ef55 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -411,6 +411,11 @@ void M_SetMenu(FName menu, int param) C_DoCommand("menu_quit"); return; + case NAME_EndGameMenu: + // The separate menu class no longer exists but the name still needs support for existing mods. + void ActivateEndGameMenu(); + ActivateEndGameMenu(); + return; } // End of special checks diff --git a/src/menu/messagebox.cpp b/src/menu/messagebox.cpp index 795bb60e4..b3b0e1fe7 100644 --- a/src/menu/messagebox.cpp +++ b/src/menu/messagebox.cpp @@ -125,17 +125,8 @@ CCMD (menu_quit) // //============================================================================= -CCMD (menu_endgame) -{ // F7 - if (!usergame) - { - S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", snd_menuvolume, ATTN_NONE); - return; - } - - //M_StartControlPanel (true); - S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE); - +void ActivateEndGameMenu() +{ FString tempstring = GStrings(netgame ? "NETEND" : "ENDGAME"); DMenu *newmenu = CreateMessageBoxMenu(CurrentMenu, tempstring, 0, false, NAME_None, []() { @@ -149,6 +140,20 @@ CCMD (menu_endgame) M_ActivateMenu(newmenu); } +CCMD (menu_endgame) +{ // F7 + if (!usergame) + { + S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", snd_menuvolume, ATTN_NONE); + return; + } + + //M_StartControlPanel (true); + S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE); + + ActivateEndGameMenu(); +} + //============================================================================= // // diff --git a/src/namedef.h b/src/namedef.h index efc70273f..105d29cdd 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -671,6 +671,7 @@ xx(Optionsmenu) xx(Quitmenu) xx(Savemenu) xx(Playermenu) +xx(EndGameMenu) xx(Playerbox) xx(Team)