From 075293de0926b9461d0bbbb83c3bf207dde14f41 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 16 Jun 2013 01:14:04 +0000 Subject: [PATCH] fixed names showing in lobby menu to be properly formatted --- source/glest_game/menu/menu_state_connected_game.cpp | 10 +++++----- source/glest_game/menu/menu_state_custom_game.cpp | 4 ++-- source/glest_game/types/faction_type.cpp | 2 +- source/glest_game/types/tech_tree.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 90831dfa..aed17473 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1882,7 +1882,7 @@ void MenuStateConnectedGame::reloadFactions(bool keepExistingSelectedItem, strin for(int i= 0; igetTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i])); + translatedFactionNames.push_back(formatString(techTree->getTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i]))); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"Tech [%s] has faction [%s]\n",techTreeFiles[listBoxTechTree.getSelectedItemIndex()].c_str(),results[i].c_str()); } @@ -3354,7 +3354,7 @@ bool MenuStateConnectedGame::loadFactions(const GameSettings *gameSettings, bool factionFiles = results; vector translatedFactionNames; for(int i= 0; i < factionFiles.size(); ++i) { - translatedFactionNames.push_back(techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i])); + translatedFactionNames.push_back(formatString(techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i]))); } for(int i=0; i translatedFactionNames; for(int i= 0; i < factionFiles.size(); ++i) { - translatedFactionNames.push_back(techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i])); + translatedFactionNames.push_back(formatString(techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i]))); } for(int i= 0; igetTranslatedName(techTreeFiles.at(i), true); - translatedTechs.push_back(txTech); + translatedTechs.push_back(formatString(txTech)); } listBoxTechTree.setItems(techsFormatted,translatedTechs); } @@ -4801,7 +4801,7 @@ int MenuStateConnectedGame::setupTechList(string scenario, bool forceLoad) { vector translatedTechs; for(unsigned int i= 0; i < techTreeFiles.size(); i++) { string txTech = techTree->getTranslatedName(techTreeFiles.at(i), forceLoad); - translatedTechs.push_back(txTech); + translatedTechs.push_back(formatString(txTech)); } listBoxTechTree.setItems(results,translatedTechs); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 191439bc..f42c0de1 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -4498,7 +4498,7 @@ int MenuStateCustomGame::setupTechList(string scenario, bool forceLoad) { initialTechSelection= i; } string txTech = techTree->getTranslatedName(techTreeFiles.at(i), forceLoad); - translatedTechs.push_back(txTech); + translatedTechs.push_back(formatString(txTech)); } @@ -4556,7 +4556,7 @@ void MenuStateCustomGame::reloadFactions(bool keepExistingSelectedItem, string s factionFiles= results; for(int i = 0; i < results.size(); ++i) { results[i]= formatString(results[i]); - translatedFactionNames.push_back(techTree->getTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i])); + translatedFactionNames.push_back(formatString(techTree->getTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i]))); //printf("FACTIONS i = %d results [%s]\n",i,results[i].c_str()); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"Tech [%s] has faction [%s]\n",techTreeFiles[listBoxTechTree.getSelectedItemIndex()].c_str(),results[i].c_str()); diff --git a/source/glest_game/types/faction_type.cpp b/source/glest_game/types/faction_type.cpp index 3275d73c..f910a577 100644 --- a/source/glest_game/types/faction_type.cpp +++ b/source/glest_game/types/faction_type.cpp @@ -116,7 +116,7 @@ void FactionType::load(const string &factionName, const TechTree *techTree, Chec } char szBuf[8096]=""; - snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingFactionType","",true).c_str(),formatString(name).c_str()); + snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingFactionType","",true).c_str(),formatString(this->getName()).c_str()); Logger::getInstance().add(szBuf, true); if(personalityType == fpt_Normal) { diff --git a/source/glest_game/types/tech_tree.cpp b/source/glest_game/types/tech_tree.cpp index 87e1031e..eaed19ab 100644 --- a/source/glest_game/types/tech_tree.cpp +++ b/source/glest_game/types/tech_tree.cpp @@ -267,7 +267,7 @@ void TechTree::load(const string &dir, set &factions, Checksum* checksum Lang::getInstance().get("Faction").c_str(), i+1, (int)factions.size(), - this->getTranslatedFactionName(name,factionName).c_str()); + formatString(this->getTranslatedFactionName(name,factionName)).c_str()); Logger &logger= Logger::getInstance(); logger.setState(szBuf); logger.setProgress((int)((((double)i) / (double)factions.size()) * 100.0));