- fixed: The order of items in the main menu was wrong. Doom is supposed to have 'Options' in second place. Many vanilla-compatible mods with special one-patch menus would not work correctly due to this. Fortunately the only mod I could find that relied on ZDoom's order was Action Doom 2, which as an IWAD can easily be handled by a simple configuration option.

- added 'else' blocks to MENUDEF parser.



SVN r2854 (trunk)
This commit is contained in:
Christoph Oelckers 2010-09-26 06:53:40 +00:00
parent 79f26d9e5c
commit cf9792ed53
6 changed files with 29 additions and 6 deletions

View file

@ -80,7 +80,7 @@ const IWADInfo IWADInfos[NUM_IWAD_TYPES] =
{ "Blasphemer", "Blasphemer",MAKERGB(115,0,0), MAKERGB(0,0,0), GAME_Heretic, "mapinfo/heretic.txt" },
{ "Chex(R) Quest", "Chex1", MAKERGB(255,255,0), MAKERGB(0,192,0), GAME_Chex, "mapinfo/chex.txt" },
{ "Chex(R) Quest 3", "Chex3", MAKERGB(255,255,0), MAKERGB(0,192,0), GAME_Chex, "mapinfo/chex3.txt", GI_NOTEXTCOLOR },
{ "Action Doom 2: Urban Brawl", "UrbanBrawl",MAKERGB(168,168,0), MAKERGB(168,0,0), GAME_Doom, "mapinfo/doom2.txt", GI_MAPxx },
{ "Action Doom 2: Urban Brawl", "UrbanBrawl",MAKERGB(168,168,0), MAKERGB(168,0,0), GAME_Doom, "mapinfo/urbanbrawl.txt", GI_MAPxx },
{ "Harmony", "Harmony", MAKERGB(110,180,230), MAKERGB(69,79,126), GAME_Doom, "mapinfo/doom2.txt", GI_MAPxx },
//{ "ZDoom Engine", NULL, MAKERGB(168,0,0), MAKERGB(168,168,168) },
};

View file

@ -277,6 +277,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRING(CursorPic, "CursorPic")
GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic")
GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis")
GAMEINFOKEY_BOOL(swapmenu, "swapmenu")
GAMEINFOKEY_BOOL(intermissioncounter, "intermissioncounter")
GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast")
GAMEINFOKEY_COLOR(dimcolor, "dimcolor")

View file

@ -76,6 +76,7 @@ struct gameinfo_t
bool noloopfinalemusic;
bool intermissioncounter;
bool nightmarefast;
bool swapmenu;
TArray<FName> creditPages;
TArray<FName> finalePages;
TArray<FName> infoPages;

View file

@ -147,6 +147,7 @@ static bool CheckSkipOptionBlock(FScanner &sc)
{
sc.MustGetString();
if (sc.Compare("ReadThis")) filter |= gameinfo.drawreadthis;
else if (sc.Compare("Swapmenu")) filter |= gameinfo.swapmenu;
else if (sc.Compare("Windows"))
{
#ifdef _WIN32
@ -171,7 +172,7 @@ static bool CheckSkipOptionBlock(FScanner &sc)
if (!filter)
{
SkipSubBlock(sc);
return true;
return !sc.CheckString("else");
}
return false;
}
@ -188,7 +189,11 @@ static void ParseListMenuBody(FScanner &sc, FListMenuDescriptor *desc)
while (!sc.CheckString("}"))
{
sc.MustGetString();
if (sc.Compare("ifgame"))
if (sc.Compare("else"))
{
SkipSubBlock(sc);
}
else if (sc.Compare("ifgame"))
{
if (!CheckSkipGameBlock(sc))
{

View file

@ -0,0 +1,7 @@
include "mapinfo/doom2.txt"
gameinfo
{
swapmenu = true
}

View file

@ -69,9 +69,18 @@ LISTMENU "MainMenu"
IfGame(Doom, Strife, Chex)
{
PatchItem "M_NGAME", "n", "PlayerclassMenu"
PatchItem "M_LOADG", "l", "LoadGameMenu"
PatchItem "M_SAVEG", "s", "SaveGameMenu"
PatchItem "M_OPTION","o", "OptionsMenu"
ifOption(SwapMenu)
{
PatchItem "M_LOADG", "l", "LoadGameMenu"
PatchItem "M_SAVEG", "s", "SaveGameMenu"
PatchItem "M_OPTION","o", "OptionsMenu"
}
else
{
PatchItem "M_OPTION","o", "OptionsMenu"
PatchItem "M_LOADG", "l", "LoadGameMenu"
PatchItem "M_SAVEG", "s", "SaveGameMenu"
}
ifOption(ReadThis)
{
PatchItem "M_RDTHIS","r", "ReadThisMenu"