mirror of
https://github.com/glest/glest-source.git
synced 2025-10-01 01:46:42 +02:00
- scenario description patch applied from Muwuum
This commit is contained in:
@@ -621,11 +621,14 @@ void Commander::updateNetwork(Game *game) {
|
|||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) perfTimer.start();
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) perfTimer.start();
|
||||||
//give pending commands
|
//give pending commands
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("START process: %d network commands in frame: %d\n",gameNetworkInterface->getPendingCommandCount(),this->world->getFrameCount());
|
||||||
for(int i= 0; i < gameNetworkInterface->getPendingCommandCount(); ++i){
|
for(int i= 0; i < gameNetworkInterface->getPendingCommandCount(); ++i){
|
||||||
giveNetworkCommand(gameNetworkInterface->getPendingCommand(i));
|
giveNetworkCommand(gameNetworkInterface->getPendingCommand(i));
|
||||||
}
|
}
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("END process: %d network commands in frame: %d\n",gameNetworkInterface->getPendingCommandCount(),this->world->getFrameCount());
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && perfTimer.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] giveNetworkCommand took %lld msecs, PendingCommandCount = %d\n",__FILE__,__FUNCTION__,__LINE__,perfTimer.getMillis(),gameNetworkInterface->getPendingCommandCount());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && perfTimer.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] giveNetworkCommand took %lld msecs, PendingCommandCount = %d\n",__FILE__,__FUNCTION__,__LINE__,perfTimer.getMillis(),gameNetworkInterface->getPendingCommandCount());
|
||||||
gameNetworkInterface->clearPendingCommands();
|
gameNetworkInterface->clearPendingCommands();
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Cleared network commands in frame: %d\n",this->world->getFrameCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -72,7 +72,7 @@ MenuStateScenario::MenuStateScenario(Program *program, MainMenu *mainMenu,
|
|||||||
int startX=350;
|
int startX=350;
|
||||||
|
|
||||||
labelInfo.registerGraphicComponent(containerName,"labelInfo");
|
labelInfo.registerGraphicComponent(containerName,"labelInfo");
|
||||||
labelInfo.init(startX, startY+130);
|
labelInfo.init(startX, startY+330);
|
||||||
labelInfo.setFont(CoreData::getInstance().getMenuFontNormal());
|
labelInfo.setFont(CoreData::getInstance().getMenuFontNormal());
|
||||||
labelInfo.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
|
labelInfo.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
|
||||||
|
|
||||||
@@ -83,10 +83,10 @@ MenuStateScenario::MenuStateScenario(Program *program, MainMenu *mainMenu,
|
|||||||
buttonPlayNow.init(startX+175, startY, 125);
|
buttonPlayNow.init(startX+175, startY, 125);
|
||||||
|
|
||||||
listBoxScenario.registerGraphicComponent(containerName,"listBoxScenario");
|
listBoxScenario.registerGraphicComponent(containerName,"listBoxScenario");
|
||||||
listBoxScenario.init(startX, startY+160, 190);
|
listBoxScenario.init(startX, startY+360, 190);
|
||||||
|
|
||||||
labelScenario.registerGraphicComponent(containerName,"labelScenario");
|
labelScenario.registerGraphicComponent(containerName,"labelScenario");
|
||||||
labelScenario.init(startX, startY+190);
|
labelScenario.init(startX, startY+390);
|
||||||
|
|
||||||
buttonReturn.setText(lang.get("Return"));
|
buttonReturn.setText(lang.get("Return"));
|
||||||
buttonPlayNow.setText(lang.get("PlayNow"));
|
buttonPlayNow.setText(lang.get("PlayNow"));
|
||||||
@@ -233,8 +233,8 @@ void MenuStateScenario::render(){
|
|||||||
Renderer &renderer= Renderer::getInstance();
|
Renderer &renderer= Renderer::getInstance();
|
||||||
|
|
||||||
if(scenarioLogoTexture != NULL) {
|
if(scenarioLogoTexture != NULL) {
|
||||||
renderer.renderTextureQuad(300,350,400,300,scenarioLogoTexture,1.0f);
|
//renderer.renderTextureQuad(300,350,400,300,scenarioLogoTexture,1.0f);
|
||||||
//renderer.renderBackground(scenarioLogoTexture);
|
renderer.renderBackground(scenarioLogoTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mainMessageBox.getEnabled()) {
|
if(mainMessageBox.getEnabled()) {
|
||||||
|
@@ -159,6 +159,9 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo) {
|
|||||||
//printf("In [%s::%s Line: %d] file [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,file.c_str());
|
//printf("In [%s::%s Line: %d] file [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,file.c_str());
|
||||||
|
|
||||||
Lang &lang= Lang::getInstance();
|
Lang &lang= Lang::getInstance();
|
||||||
|
string scenarioDir = cutLastFile(formatPath(file));
|
||||||
|
string scenarioName = extractLastDirectoryFromPath(scenarioDir);
|
||||||
|
scenarioDir = cutLastFile(scenarioDir);
|
||||||
|
|
||||||
XmlTree xmlTree;
|
XmlTree xmlTree;
|
||||||
xmlTree.load(file,Properties::getTagReplacementValues());
|
xmlTree.load(file,Properties::getTagReplacementValues());
|
||||||
@@ -287,7 +290,7 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//add player info
|
//add player info
|
||||||
scenarioInfo->desc= lang.get("Player") + ": ";
|
scenarioInfo->desc= lang.get("PlayerFaction") + ": ";
|
||||||
for(int i=0; i<GameConstants::maxPlayers; ++i) {
|
for(int i=0; i<GameConstants::maxPlayers; ++i) {
|
||||||
if(scenarioInfo->factionControls[i] == ctHuman) {
|
if(scenarioInfo->factionControls[i] == ctHuman) {
|
||||||
scenarioInfo->desc+= formatString(scenarioInfo->factionTypeNames[i]);
|
scenarioInfo->desc+= formatString(scenarioInfo->factionTypeNames[i]);
|
||||||
@@ -304,6 +307,14 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo) {
|
|||||||
scenarioInfo->desc+= lang.get("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n";
|
scenarioInfo->desc+= lang.get("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n";
|
||||||
scenarioInfo->desc+= lang.get("TechTree") + ": " + formatString(scenarioInfo->techTreeName) + "\n";
|
scenarioInfo->desc+= lang.get("TechTree") + ": " + formatString(scenarioInfo->techTreeName) + "\n";
|
||||||
|
|
||||||
|
|
||||||
|
//look for description and append it
|
||||||
|
lang.loadScenarioStrings(scenarioDir,scenarioName.c_str());
|
||||||
|
string tmp_description = lang.getScenarioString("DESCRIPTION");
|
||||||
|
if( tmp_description != "???DESCRIPTION???"){
|
||||||
|
scenarioInfo->desc+= lang.get("Description") + ": \n" + tmp_description + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
if(scenarioNode->hasChild("fog-of-war") == true) {
|
if(scenarioNode->hasChild("fog-of-war") == true) {
|
||||||
if(scenarioNode->getChild("fog-of-war")->getAttribute("value")->getValue() == "explored") {
|
if(scenarioNode->getChild("fog-of-war")->getAttribute("value")->getValue() == "explored") {
|
||||||
scenarioInfo->fogOfWar = true;
|
scenarioInfo->fogOfWar = true;
|
||||||
|
Reference in New Issue
Block a user