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
This commit is contained in:
alexey.lysiuk 2017-02-23 10:20:02 +02:00
parent d295186378
commit 91f8f5b556
3 changed files with 22 additions and 11 deletions

View file

@ -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

View file

@ -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();
}
//=============================================================================
//
//

View file

@ -671,6 +671,7 @@ xx(Optionsmenu)
xx(Quitmenu)
xx(Savemenu)
xx(Playermenu)
xx(EndGameMenu)
xx(Playerbox)
xx(Team)