From 16431e9f0ac004914c912fe27db18e41c9e868ad Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Oct 2020 22:21:11 +0200 Subject: [PATCH] - SetupMenuColors restored. --- source/common/menu/menudef.cpp | 3 ++- source/core/gamecontrol.cpp | 1 + source/core/menu/razemenu.cpp | 44 +++++++++++++++++++++++++++------- source/core/menu/razemenu.h | 1 + 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/source/common/menu/menudef.cpp b/source/common/menu/menudef.cpp index 6a27b0038..56e2a8dda 100644 --- a/source/common/menu/menudef.cpp +++ b/source/common/menu/menudef.cpp @@ -49,6 +49,7 @@ #include #include "texturemanager.h" #include "printf.h" +#include "i_interface.h" bool CheckSkipGameOptionBlock(FScanner& sc); @@ -189,7 +190,7 @@ static bool CheckSkipGameBlock(FScanner &sc, bool yes = true) do { sc.MustGetString(); - filter |= CheckGame(sc.String, false); + if (sysCallbacks.CheckGame) filter |= sysCallbacks.CheckGame(sc.String); } while (sc.CheckString(",")); sc.MustGetStringName(")"); diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 21f89786a..77ef5979e 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -867,6 +867,7 @@ int RunGame() SetupGameButtons(); gi->app_init(); + SetDefaultMenuColors(); M_Init(); if (!(paletteloaded & PALETTE_MAIN)) I_FatalError("No palette found."); diff --git a/source/core/menu/razemenu.cpp b/source/core/menu/razemenu.cpp index 340cee62c..691d268e8 100644 --- a/source/core/menu/razemenu.cpp +++ b/source/core/menu/razemenu.cpp @@ -55,6 +55,7 @@ #include "st_start.h" #include "i_system.h" #include "gameconfigfile.h" +#include "gamecontrol.h" EXTERN_CVAR(Int, cl_gfxlocalization) EXTERN_CVAR(Bool, m_quickexit) @@ -1107,15 +1108,40 @@ bool CheckSkipGameOptionBlock(FScanner &sc) else if (sc.Compare("Swapmenu")) filter |= gameinfo.swapmenu; return filter; } - +#endif void SetDefaultMenuColors() { - OptionSettings.mTitleColor = V_FindFontColor(gameinfo.mTitleColor); - OptionSettings.mFontColor = V_FindFontColor(gameinfo.mFontColor); - OptionSettings.mFontColorValue = V_FindFontColor(gameinfo.mFontColorValue); - OptionSettings.mFontColorMore = V_FindFontColor(gameinfo.mFontColorMore); - OptionSettings.mFontColorHeader = V_FindFontColor(gameinfo.mFontColorHeader); - OptionSettings.mFontColorHighlight = V_FindFontColor(gameinfo.mFontColorHighlight); - OptionSettings.mFontColorSelection = V_FindFontColor(gameinfo.mFontColorSelection); + //OptionSettings.mTitleColor = CR_RED;// V_FindFontColor(gameinfo.mTitleColor); + OptionSettings.mFontColor = CR_RED; + OptionSettings.mFontColorValue = CR_GRAY; + OptionSettings.mFontColorMore = CR_GRAY; + OptionSettings.mFontColorHeader = CR_GOLD; + OptionSettings.mFontColorHighlight = CR_YELLOW; + OptionSettings.mFontColorSelection = CR_BRICK; + + if (g_gameType & (GAMEFLAG_NAM | GAMEFLAG_NAPALM | GAMEFLAG_WW2GI)) + { + OptionSettings.mFontColor = CR_DARKGREEN; + OptionSettings.mFontColorHeader = CR_DARKGRAY; + OptionSettings.mFontColorHighlight = CR_WHITE; + OptionSettings.mFontColorSelection = CR_DARKGREEN; + } + else if (g_gameType & GAMEFLAG_BLOOD) + { + OptionSettings.mFontColorHeader = CR_DARKGRAY; + OptionSettings.mFontColorHighlight = CR_WHITE; + OptionSettings.mFontColorSelection = CR_DARKRED; + } + else if (g_gameType & GAMEFLAG_RRALL) + { + OptionSettings.mFontColor = CR_BROWN; + OptionSettings.mFontColorHeader = CR_DARKBROWN; + OptionSettings.mFontColorHighlight = CR_ORANGE; + OptionSettings.mFontColorSelection = CR_TAN; + } + else if (g_gameType & GAMEFLAG_SW) + { + OptionSettings.mFontColorHeader = CR_DARKRED; + OptionSettings.mFontColorHighlight = CR_WHITE; + } } -#endif diff --git a/source/core/menu/razemenu.h b/source/core/menu/razemenu.h index c211cc69a..5dd125405 100644 --- a/source/core/menu/razemenu.h +++ b/source/core/menu/razemenu.h @@ -10,6 +10,7 @@ extern FNewGameStartup NewGameStartupInfo; void M_StartupEpisodeMenu(FNewGameStartup *gs); void M_StartupSkillMenu(FNewGameStartup *gs); void M_CreateGameMenus(); +void SetDefaultMenuColors(); // The savegame manager contains too much code that is game specific. Parts are shareable but need more work first.