ReadThisMenu / MenuDelegate overriding.

This commit is contained in:
Marisa Kirisame 2021-10-19 11:31:49 +02:00 committed by Christoph Oelckers
parent 047c0c9537
commit 58e66f4805
9 changed files with 21 additions and 1 deletions

View file

@ -404,6 +404,8 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_MUSIC(intermissionMusic, intermissionOrder, "intermissionMusic")
GAMEINFOKEY_STRING(CursorPic, "CursorPic")
GAMEINFOKEY_STRING(MessageBoxClass, "MessageBoxClass")
GAMEINFOKEY_STRING(HelpMenuClass, "HelpMenuClass")
GAMEINFOKEY_STRING(MenuDelegateClass, "MenuDelegateClass")
GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic")
GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis")
GAMEINFOKEY_BOOL(swapmenu, "swapmenu")

View file

@ -162,6 +162,8 @@ struct gameinfo_t
FName althudclass;
int statusbarclassfile = -1;
FName MessageBoxClass;
FName HelpMenuClass;
FName MenuDelegateClass;
FName backpacktype;
FString intermissionMusic;
int intermissionOrder;

View file

@ -202,6 +202,10 @@ bool M_SetSpecialMenu(FName& menu, int param)
menu = NAME_Optionsmenu;
break;
case NAME_Readthismenu:
// [MK] allow us to override the ReadThisMenu class
menu = gameinfo.HelpMenuClass;
break;
}
DMenuDescriptor** desc = MenuDescriptors.CheckKey(menu);
@ -1300,7 +1304,7 @@ void SetDefaultMenuColors()
OptionSettings.mFontColorHighlight = V_FindFontColor(gameinfo.mFontColorHighlight);
OptionSettings.mFontColorSelection = V_FindFontColor(gameinfo.mFontColorSelection);
auto cls = PClass::FindClass("DoomMenuDelegate");
auto cls = PClass::FindClass(gameinfo.MenuDelegateClass);
menuDelegate = cls->CreateNew();
}

View file

@ -74,6 +74,8 @@ gameinfo
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "DoomStatusScreen"
messageboxclass = "MessageBoxMenu"
helpmenuclass = "ReadThisMenu"
menudelegateclass = "DoomMenuDelegate"
normforwardmove = 0x19, 0x32
normsidemove = 0x18, 0x28
}

View file

@ -75,6 +75,8 @@ gameinfo
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "DoomStatusScreen"
messageboxclass = "MessageBoxMenu"
helpmenuclass = "ReadThisMenu"
menudelegateclass = "DoomMenuDelegate"
normforwardmove = 0x19, 0x32
normsidemove = 0x18, 0x28
}

View file

@ -73,6 +73,8 @@ gameinfo
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "RavenStatusScreen"
messageboxclass = "MessageBoxMenu"
helpmenuclass = "ReadThisMenu"
menudelegateclass = "DoomMenuDelegate"
normforwardmove = 0x19, 0x32
normsidemove = 0x18, 0x28
}

View file

@ -71,6 +71,8 @@ gameinfo
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "RavenStatusScreen"
messageboxclass = "MessageBoxMenu"
helpmenuclass = "ReadThisMenu"
menudelegateclass = "DoomMenuDelegate"
normforwardmove = 0x19, 0x32
normsidemove = 0x18, 0x28
}

View file

@ -61,6 +61,8 @@ gameinfo
statscreen_contentfont = "*BigFont"
statscreen_authorFont = "*SmallFont"
messageboxclass = "MessageBoxMenu"
helpmenuclass = "ReadThisMenu"
menudelegateclass = "DoomMenuDelegate"
}
gamedefaults

View file

@ -73,6 +73,8 @@ gameinfo
statscreen_single = "RavenStatusScreen"
statusbarclass = "StrifeStatusBar"
messageboxclass = "MessageBoxMenu"
helpmenuclass = "ReadThisMenu"
menudelegateclass = "DoomMenuDelegate"
normforwardmove = 0x19, 0x32
normsidemove = 0x18, 0x28
}