From e96346ff2837aa540206b18a6b956f59c38d0085 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 1 Jun 2012 19:14:55 +0000 Subject: [PATCH] - special text color override setting will only apply to non in-game text (useful when videos clash with menu text colors) --- source/glest_game/main/main.cpp | 6 ------ source/glest_game/menu/main_menu.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 0f842ebc..6a244a85 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -3361,12 +3361,6 @@ int glestMain(int argc, char** argv) { UPNP_Tools::isUPNP = !config.getBool("DisableUPNP","false"); Texture::useTextureCompression = config.getBool("EnableTextureCompression","false"); - if(config.getString("CustomMenuTextColor","") != "") { - string customMenuTextColor = config.getString("CustomMenuTextColor"); - Vec3f customTextColor = Vec3f::strToVec3(customMenuTextColor); - GraphicComponent::setCustomTextColor(customTextColor); - } - // 256 for English // 30000 for Chinese Font::charCount = config.getInt("FONT_CHARCOUNT",intToStr(Font::charCount).c_str()); diff --git a/source/glest_game/menu/main_menu.cpp b/source/glest_game/menu/main_menu.cpp index ec880849..d08f7c9c 100644 --- a/source/glest_game/menu/main_menu.cpp +++ b/source/glest_game/menu/main_menu.cpp @@ -56,6 +56,13 @@ MainMenu::MainMenu(Program *program) : ProgramState(program), menuBackgroundVide if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); + Config &config = Config::getInstance(); + if(config.getString("CustomMenuTextColor","") != "") { + string customMenuTextColor = config.getString("CustomMenuTextColor"); + Vec3f customTextColor = Vec3f::strToVec3(customMenuTextColor); + GraphicComponent::setCustomTextColor(customTextColor); + } + setState(new MenuStateRoot(program, this)); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); @@ -88,6 +95,7 @@ MainMenu::~MainMenu() { //SoundRenderer &soundRenderer= SoundRenderer::getInstance(); //soundRenderer.stopAllSounds(); + GraphicComponent::setCustomTextColor(Vec3f(1.0f,1.0f,1.0f)); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); }