diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 707a6f6f..0169d550 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -832,7 +832,12 @@ void MainWindow::eventKeyDown(char key){ else { sprintf(szBuf,"Screenshot will be saved to: %s",path.c_str()); } - program->consoleAddLine(szBuf); + + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] %s\n",__FILE__,__FUNCTION__,__LINE__,szBuf); + + if(Config::getInstance().getBool("DisableScreenshotConsoleText","false") == false) { + program->consoleAddLine(szBuf); + } Renderer::getInstance().saveScreen(path); break; diff --git a/source/glest_game/menu/main_menu.cpp b/source/glest_game/menu/main_menu.cpp index c2c17bb1..a1c18325 100644 --- a/source/glest_game/menu/main_menu.cpp +++ b/source/glest_game/menu/main_menu.cpp @@ -194,6 +194,12 @@ bool MainMenu::isInSpecialKeyCaptureEvent() { return state->isInSpecialKeyCaptureEvent(); } +void MainMenu::consoleAddLine(string line) { + if(state != NULL) { + state->consoleAddLine(line); + } +} + // ===================================================== // class MenuState // ===================================================== @@ -251,6 +257,8 @@ MenuState::~MenuState() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__); } - +void MenuState::consoleAddLine(string line) { + console.addLine(line); +} }}//end namespace diff --git a/source/glest_game/menu/main_menu.h b/source/glest_game/menu/main_menu.h index c6ce2ac5..75bacdbf 100644 --- a/source/glest_game/menu/main_menu.h +++ b/source/glest_game/menu/main_menu.h @@ -111,6 +111,7 @@ public: int getMouseX() const {return mouseX;} int getMouseY() const {return mouseY;} int getMouse2dAnim() const {return mouse2dAnim;} + virtual void consoleAddLine(string line); }; @@ -127,6 +128,7 @@ protected: Camera camera; const char *containerName; + Console console; public: MenuState(Program *program, MainMenu *mainMenu, const string &stateName); @@ -142,6 +144,7 @@ public: const Camera *getCamera() const {return &camera;} virtual bool isInSpecialKeyCaptureEvent() { return false; } + virtual void consoleAddLine(string line); }; }}//end namespace diff --git a/source/glest_game/menu/menu_state_connected_game.h b/source/glest_game/menu/menu_state_connected_game.h index 4e40b2f6..6bde050e 100644 --- a/source/glest_game/menu/menu_state_connected_game.h +++ b/source/glest_game/menu/menu_state_connected_game.h @@ -104,7 +104,7 @@ private: time_t lastSetChangedGameSettings; bool updateDataSynchDetailText; - Console console; + //Console console; ChatManager chatManager; bool showFullConsole; diff --git a/source/glest_game/menu/menu_state_custom_game.h b/source/glest_game/menu/menu_state_custom_game.h index 7c2b53f9..efa81473 100644 --- a/source/glest_game/menu/menu_state_custom_game.h +++ b/source/glest_game/menu/menu_state_custom_game.h @@ -121,7 +121,7 @@ private: string generalErrorToShow; bool serverInitError; - Console console; + //Console console; ChatManager chatManager; bool showFullConsole; diff --git a/source/glest_game/menu/menu_state_graphic_info.cpp b/source/glest_game/menu/menu_state_graphic_info.cpp index 5555d2c7..ccf4f8a4 100644 --- a/source/glest_game/menu/menu_state_graphic_info.cpp +++ b/source/glest_game/menu/menu_state_graphic_info.cpp @@ -71,6 +71,8 @@ void MenuStateGraphicInfo::render(){ renderer.renderButton(&buttonReturn); renderer.renderLabel(&labelInfo); renderer.renderLabel(&labelMoreInfo); + + renderer.renderConsole(&console,false,true); } void MenuStateGraphicInfo::keyDown(char key) { diff --git a/source/glest_game/menu/menu_state_join_game.h b/source/glest_game/menu/menu_state_join_game.h index 82bb2388..42c3ef92 100644 --- a/source/glest_game/menu/menu_state_join_game.h +++ b/source/glest_game/menu/menu_state_join_game.h @@ -56,7 +56,7 @@ private: int playerIndex; Properties servers; - Console console; + //Console console; ChatManager chatManager; string serversSavedFile; diff --git a/source/glest_game/menu/menu_state_keysetup.cpp b/source/glest_game/menu/menu_state_keysetup.cpp index 5fbc0e32..5e65b776 100644 --- a/source/glest_game/menu/menu_state_keysetup.cpp +++ b/source/glest_game/menu/menu_state_keysetup.cpp @@ -299,6 +299,8 @@ void MenuStateKeysetup::render(){ } renderer.renderScrollBar(&keyScrollBar); } + + renderer.renderConsole(&console,false,true); if(program != NULL) program->renderProgramMsgBox(); } @@ -312,6 +314,8 @@ void MenuStateKeysetup::update() { - keyScrollBar.getVisibleStart())); } } + + console.update(); } diff --git a/source/glest_game/menu/menu_state_mods.h b/source/glest_game/menu/menu_state_mods.h index 8eec1154..d476f06e 100644 --- a/source/glest_game/menu/menu_state_mods.h +++ b/source/glest_game/menu/menu_state_mods.h @@ -128,7 +128,7 @@ private: int keyButtonsHeight; int keyButtonsWidth; - Console console; + //Console console; bool showFullConsole; string selectedTechName; diff --git a/source/glest_game/menu/menu_state_new_game.cpp b/source/glest_game/menu/menu_state_new_game.cpp index 448cb40d..abf2cd2d 100644 --- a/source/glest_game/menu/menu_state_new_game.cpp +++ b/source/glest_game/menu/menu_state_new_game.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2005 Martiño Figueroa +// Copyright (C) 2001-2005 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -122,6 +122,7 @@ void MenuStateNewGame::render(){ renderer.renderButton(&buttonTutorial); renderer.renderButton(&buttonReturn); + renderer.renderConsole(&console,false,true); if(program != NULL) program->renderProgramMsgBox(); } @@ -129,6 +130,7 @@ void MenuStateNewGame::update(){ if(Config::getInstance().getBool("AutoTest")){ AutoTest::getInstance().updateNewGame(program, mainMenu); } + console.update(); } void MenuStateNewGame::keyDown(char key) { diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index b249838b..064c4956 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -771,6 +771,7 @@ void MenuStateOptions::render(){ renderer.renderListBox(&listBoxScreenShotType); } + renderer.renderConsole(&console,false,true); if(program != NULL) program->renderProgramMsgBox(); } diff --git a/source/glest_game/menu/menu_state_root.cpp b/source/glest_game/menu/menu_state_root.cpp index e14d4e1f..0af3d383 100644 --- a/source/glest_game/menu/menu_state_root.cpp +++ b/source/glest_game/menu/menu_state_root.cpp @@ -194,6 +194,8 @@ void MenuStateRoot::render() { renderer.renderButton(&buttonExit); renderer.renderLabel(&labelVersion); + renderer.renderConsole(&console,false,true); + //exit message box if(mainMessageBox.getEnabled()){ renderer.renderMessageBox(&mainMessageBox); @@ -205,6 +207,7 @@ void MenuStateRoot::update(){ if(Config::getInstance().getBool("AutoTest")){ AutoTest::getInstance().updateRoot(program, mainMenu); } + console.update(); } void MenuStateRoot::keyDown(char key) { diff --git a/source/glest_game/menu/menu_state_root.h b/source/glest_game/menu/menu_state_root.h index 57343765..be5d701e 100644 --- a/source/glest_game/menu/menu_state_root.h +++ b/source/glest_game/menu/menu_state_root.h @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2005 Martiño Figueroa +// Copyright (C) 2001-2005 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -23,7 +23,7 @@ namespace Glest{ namespace Game{ class GraphicMessageBox; -class MenuStateRoot: public MenuState{ +class MenuStateRoot: public MenuState { private: GraphicButton buttonNewGame; GraphicButton buttonMods; diff --git a/source/glest_game/menu/menu_state_scenario.cpp b/source/glest_game/menu/menu_state_scenario.cpp index 19d0ba96..2b80b5e0 100644 --- a/source/glest_game/menu/menu_state_scenario.cpp +++ b/source/glest_game/menu/menu_state_scenario.cpp @@ -192,6 +192,7 @@ void MenuStateScenario::render(){ renderer.renderButton(&buttonReturn); renderer.renderButton(&buttonPlayNow); } + renderer.renderConsole(&console,false,true); if(program != NULL) program->renderProgramMsgBox(); } @@ -226,6 +227,7 @@ void MenuStateScenario::update() { needToLoadTextures= false; } } + console.update(); } void MenuStateScenario::launchGame() {