From 58e66f48053936f27642d17256ff7fa0c68d41cc Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Tue, 19 Oct 2021 11:31:49 +0200 Subject: [PATCH] ReadThisMenu / MenuDelegate overriding. --- src/gamedata/gi.cpp | 2 ++ src/gamedata/gi.h | 2 ++ src/menu/doommenu.cpp | 6 +++++- wadsrc/static/mapinfo/chex.txt | 2 ++ wadsrc/static/mapinfo/doomcommon.txt | 2 ++ wadsrc/static/mapinfo/heretic.txt | 2 ++ wadsrc/static/mapinfo/hexen.txt | 2 ++ wadsrc/static/mapinfo/mindefaults.txt | 2 ++ wadsrc/static/mapinfo/strife.txt | 2 ++ 9 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/gamedata/gi.cpp b/src/gamedata/gi.cpp index eaff1cf350..1f5eec9ca6 100644 --- a/src/gamedata/gi.cpp +++ b/src/gamedata/gi.cpp @@ -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") diff --git a/src/gamedata/gi.h b/src/gamedata/gi.h index 466c323d54..ce811ea3eb 100644 --- a/src/gamedata/gi.h +++ b/src/gamedata/gi.h @@ -162,6 +162,8 @@ struct gameinfo_t FName althudclass; int statusbarclassfile = -1; FName MessageBoxClass; + FName HelpMenuClass; + FName MenuDelegateClass; FName backpacktype; FString intermissionMusic; int intermissionOrder; diff --git a/src/menu/doommenu.cpp b/src/menu/doommenu.cpp index 652530a64a..7fec2e5fd9 100644 --- a/src/menu/doommenu.cpp +++ b/src/menu/doommenu.cpp @@ -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(); } diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 48a49dd0da..14f6a78b03 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -74,6 +74,8 @@ gameinfo statscreen_dm = "DeathmatchStatusScreen" statscreen_single = "DoomStatusScreen" messageboxclass = "MessageBoxMenu" + helpmenuclass = "ReadThisMenu" + menudelegateclass = "DoomMenuDelegate" normforwardmove = 0x19, 0x32 normsidemove = 0x18, 0x28 } diff --git a/wadsrc/static/mapinfo/doomcommon.txt b/wadsrc/static/mapinfo/doomcommon.txt index 5b468c1b67..89d4c44a8a 100644 --- a/wadsrc/static/mapinfo/doomcommon.txt +++ b/wadsrc/static/mapinfo/doomcommon.txt @@ -75,6 +75,8 @@ gameinfo statscreen_dm = "DeathmatchStatusScreen" statscreen_single = "DoomStatusScreen" messageboxclass = "MessageBoxMenu" + helpmenuclass = "ReadThisMenu" + menudelegateclass = "DoomMenuDelegate" normforwardmove = 0x19, 0x32 normsidemove = 0x18, 0x28 } diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index f889a97185..8e8594345e 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -73,6 +73,8 @@ gameinfo statscreen_dm = "DeathmatchStatusScreen" statscreen_single = "RavenStatusScreen" messageboxclass = "MessageBoxMenu" + helpmenuclass = "ReadThisMenu" + menudelegateclass = "DoomMenuDelegate" normforwardmove = 0x19, 0x32 normsidemove = 0x18, 0x28 } diff --git a/wadsrc/static/mapinfo/hexen.txt b/wadsrc/static/mapinfo/hexen.txt index da727a6fc9..adb52f1356 100644 --- a/wadsrc/static/mapinfo/hexen.txt +++ b/wadsrc/static/mapinfo/hexen.txt @@ -71,6 +71,8 @@ gameinfo statscreen_dm = "DeathmatchStatusScreen" statscreen_single = "RavenStatusScreen" messageboxclass = "MessageBoxMenu" + helpmenuclass = "ReadThisMenu" + menudelegateclass = "DoomMenuDelegate" normforwardmove = 0x19, 0x32 normsidemove = 0x18, 0x28 } diff --git a/wadsrc/static/mapinfo/mindefaults.txt b/wadsrc/static/mapinfo/mindefaults.txt index 2b6c4182eb..9f26688106 100644 --- a/wadsrc/static/mapinfo/mindefaults.txt +++ b/wadsrc/static/mapinfo/mindefaults.txt @@ -61,6 +61,8 @@ gameinfo statscreen_contentfont = "*BigFont" statscreen_authorFont = "*SmallFont" messageboxclass = "MessageBoxMenu" + helpmenuclass = "ReadThisMenu" + menudelegateclass = "DoomMenuDelegate" } gamedefaults diff --git a/wadsrc/static/mapinfo/strife.txt b/wadsrc/static/mapinfo/strife.txt index 32634e4173..b39e950cdc 100644 --- a/wadsrc/static/mapinfo/strife.txt +++ b/wadsrc/static/mapinfo/strife.txt @@ -73,6 +73,8 @@ gameinfo statscreen_single = "RavenStatusScreen" statusbarclass = "StrifeStatusBar" messageboxclass = "MessageBoxMenu" + helpmenuclass = "ReadThisMenu" + menudelegateclass = "DoomMenuDelegate" normforwardmove = 0x19, 0x32 normsidemove = 0x18, 0x28 }