- added console object to base menustate and added a way to disable console output when taking a screenshot (on be default). To Disable:
DisableScreenshotConsoleText=true
This commit is contained in:
parent
5d10312ead
commit
6e8157b9de
|
@ -832,7 +832,12 @@ void MainWindow::eventKeyDown(char key){
|
||||||
else {
|
else {
|
||||||
sprintf(szBuf,"Screenshot will be saved to: %s",path.c_str());
|
sprintf(szBuf,"Screenshot will be saved to: %s",path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
program->consoleAddLine(szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
Renderer::getInstance().saveScreen(path);
|
Renderer::getInstance().saveScreen(path);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -194,6 +194,12 @@ bool MainMenu::isInSpecialKeyCaptureEvent() {
|
||||||
return state->isInSpecialKeyCaptureEvent();
|
return state->isInSpecialKeyCaptureEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainMenu::consoleAddLine(string line) {
|
||||||
|
if(state != NULL) {
|
||||||
|
state->consoleAddLine(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
// class MenuState
|
// 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__);
|
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
|
}}//end namespace
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
int getMouseX() const {return mouseX;}
|
int getMouseX() const {return mouseX;}
|
||||||
int getMouseY() const {return mouseY;}
|
int getMouseY() const {return mouseY;}
|
||||||
int getMouse2dAnim() const {return mouse2dAnim;}
|
int getMouse2dAnim() const {return mouse2dAnim;}
|
||||||
|
virtual void consoleAddLine(string line);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -127,6 +128,7 @@ protected:
|
||||||
Camera camera;
|
Camera camera;
|
||||||
|
|
||||||
const char *containerName;
|
const char *containerName;
|
||||||
|
Console console;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MenuState(Program *program, MainMenu *mainMenu, const string &stateName);
|
MenuState(Program *program, MainMenu *mainMenu, const string &stateName);
|
||||||
|
@ -142,6 +144,7 @@ public:
|
||||||
const Camera *getCamera() const {return &camera;}
|
const Camera *getCamera() const {return &camera;}
|
||||||
|
|
||||||
virtual bool isInSpecialKeyCaptureEvent() { return false; }
|
virtual bool isInSpecialKeyCaptureEvent() { return false; }
|
||||||
|
virtual void consoleAddLine(string line);
|
||||||
};
|
};
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
|
|
@ -104,7 +104,7 @@ private:
|
||||||
time_t lastSetChangedGameSettings;
|
time_t lastSetChangedGameSettings;
|
||||||
bool updateDataSynchDetailText;
|
bool updateDataSynchDetailText;
|
||||||
|
|
||||||
Console console;
|
//Console console;
|
||||||
ChatManager chatManager;
|
ChatManager chatManager;
|
||||||
bool showFullConsole;
|
bool showFullConsole;
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ private:
|
||||||
string generalErrorToShow;
|
string generalErrorToShow;
|
||||||
bool serverInitError;
|
bool serverInitError;
|
||||||
|
|
||||||
Console console;
|
//Console console;
|
||||||
ChatManager chatManager;
|
ChatManager chatManager;
|
||||||
bool showFullConsole;
|
bool showFullConsole;
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,8 @@ void MenuStateGraphicInfo::render(){
|
||||||
renderer.renderButton(&buttonReturn);
|
renderer.renderButton(&buttonReturn);
|
||||||
renderer.renderLabel(&labelInfo);
|
renderer.renderLabel(&labelInfo);
|
||||||
renderer.renderLabel(&labelMoreInfo);
|
renderer.renderLabel(&labelMoreInfo);
|
||||||
|
|
||||||
|
renderer.renderConsole(&console,false,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuStateGraphicInfo::keyDown(char key) {
|
void MenuStateGraphicInfo::keyDown(char key) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ private:
|
||||||
int playerIndex;
|
int playerIndex;
|
||||||
Properties servers;
|
Properties servers;
|
||||||
|
|
||||||
Console console;
|
//Console console;
|
||||||
ChatManager chatManager;
|
ChatManager chatManager;
|
||||||
|
|
||||||
string serversSavedFile;
|
string serversSavedFile;
|
||||||
|
|
|
@ -299,6 +299,8 @@ void MenuStateKeysetup::render(){
|
||||||
}
|
}
|
||||||
renderer.renderScrollBar(&keyScrollBar);
|
renderer.renderScrollBar(&keyScrollBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderer.renderConsole(&console,false,true);
|
||||||
if(program != NULL) program->renderProgramMsgBox();
|
if(program != NULL) program->renderProgramMsgBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,6 +314,8 @@ void MenuStateKeysetup::update() {
|
||||||
- keyScrollBar.getVisibleStart()));
|
- keyScrollBar.getVisibleStart()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ private:
|
||||||
int keyButtonsHeight;
|
int keyButtonsHeight;
|
||||||
int keyButtonsWidth;
|
int keyButtonsWidth;
|
||||||
|
|
||||||
Console console;
|
//Console console;
|
||||||
bool showFullConsole;
|
bool showFullConsole;
|
||||||
|
|
||||||
string selectedTechName;
|
string selectedTechName;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// ==============================================================
|
// ==============================================================
|
||||||
// This file is part of Glest (www.glest.org)
|
// This file is part of Glest (www.glest.org)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2005 Martiño Figueroa
|
// Copyright (C) 2001-2005 Marti<EFBFBD>o Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// the terms of the GNU General Public License as published
|
||||||
|
@ -122,6 +122,7 @@ void MenuStateNewGame::render(){
|
||||||
renderer.renderButton(&buttonTutorial);
|
renderer.renderButton(&buttonTutorial);
|
||||||
renderer.renderButton(&buttonReturn);
|
renderer.renderButton(&buttonReturn);
|
||||||
|
|
||||||
|
renderer.renderConsole(&console,false,true);
|
||||||
if(program != NULL) program->renderProgramMsgBox();
|
if(program != NULL) program->renderProgramMsgBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +130,7 @@ void MenuStateNewGame::update(){
|
||||||
if(Config::getInstance().getBool("AutoTest")){
|
if(Config::getInstance().getBool("AutoTest")){
|
||||||
AutoTest::getInstance().updateNewGame(program, mainMenu);
|
AutoTest::getInstance().updateNewGame(program, mainMenu);
|
||||||
}
|
}
|
||||||
|
console.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuStateNewGame::keyDown(char key) {
|
void MenuStateNewGame::keyDown(char key) {
|
||||||
|
|
|
@ -771,6 +771,7 @@ void MenuStateOptions::render(){
|
||||||
renderer.renderListBox(&listBoxScreenShotType);
|
renderer.renderListBox(&listBoxScreenShotType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderer.renderConsole(&console,false,true);
|
||||||
if(program != NULL) program->renderProgramMsgBox();
|
if(program != NULL) program->renderProgramMsgBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,8 @@ void MenuStateRoot::render() {
|
||||||
renderer.renderButton(&buttonExit);
|
renderer.renderButton(&buttonExit);
|
||||||
renderer.renderLabel(&labelVersion);
|
renderer.renderLabel(&labelVersion);
|
||||||
|
|
||||||
|
renderer.renderConsole(&console,false,true);
|
||||||
|
|
||||||
//exit message box
|
//exit message box
|
||||||
if(mainMessageBox.getEnabled()){
|
if(mainMessageBox.getEnabled()){
|
||||||
renderer.renderMessageBox(&mainMessageBox);
|
renderer.renderMessageBox(&mainMessageBox);
|
||||||
|
@ -205,6 +207,7 @@ void MenuStateRoot::update(){
|
||||||
if(Config::getInstance().getBool("AutoTest")){
|
if(Config::getInstance().getBool("AutoTest")){
|
||||||
AutoTest::getInstance().updateRoot(program, mainMenu);
|
AutoTest::getInstance().updateRoot(program, mainMenu);
|
||||||
}
|
}
|
||||||
|
console.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuStateRoot::keyDown(char key) {
|
void MenuStateRoot::keyDown(char key) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// ==============================================================
|
// ==============================================================
|
||||||
// This file is part of Glest (www.glest.org)
|
// This file is part of Glest (www.glest.org)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2005 Martiño Figueroa
|
// Copyright (C) 2001-2005 Marti<EFBFBD>o Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// the terms of the GNU General Public License as published
|
||||||
|
@ -23,7 +23,7 @@ namespace Glest{ namespace Game{
|
||||||
|
|
||||||
class GraphicMessageBox;
|
class GraphicMessageBox;
|
||||||
|
|
||||||
class MenuStateRoot: public MenuState{
|
class MenuStateRoot: public MenuState {
|
||||||
private:
|
private:
|
||||||
GraphicButton buttonNewGame;
|
GraphicButton buttonNewGame;
|
||||||
GraphicButton buttonMods;
|
GraphicButton buttonMods;
|
||||||
|
|
|
@ -192,6 +192,7 @@ void MenuStateScenario::render(){
|
||||||
renderer.renderButton(&buttonReturn);
|
renderer.renderButton(&buttonReturn);
|
||||||
renderer.renderButton(&buttonPlayNow);
|
renderer.renderButton(&buttonPlayNow);
|
||||||
}
|
}
|
||||||
|
renderer.renderConsole(&console,false,true);
|
||||||
if(program != NULL) program->renderProgramMsgBox();
|
if(program != NULL) program->renderProgramMsgBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,6 +227,7 @@ void MenuStateScenario::update() {
|
||||||
needToLoadTextures= false;
|
needToLoadTextures= false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuStateScenario::launchGame() {
|
void MenuStateScenario::launchGame() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user