diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index c1796267..e2714564 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -298,58 +298,60 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); - xoffset=100; + xoffset=40; int rowHeight=27; for(int i=0; i"); } labelControl.registerGraphicComponent(containerName,"labelControl"); - labelControl.init(xoffset+210, setupPos, GraphicListBox::defW, GraphicListBox::defH, true); + labelControl.init(xoffset+160, setupPos, GraphicListBox::defW, GraphicListBox::defH, true); labelControl.setText(lang.get("Control")); labelRMultiplier.registerGraphicComponent(containerName,"labelRMultiplier"); - labelRMultiplier.init(xoffset+350, setupPos, GraphicListBox::defW, GraphicListBox::defH, true); + labelRMultiplier.init(xoffset+300, setupPos, GraphicListBox::defW, GraphicListBox::defH, true); labelFaction.registerGraphicComponent(containerName,"labelFaction"); - labelFaction.init(xoffset+430, setupPos, GraphicListBox::defW, GraphicListBox::defH, true); + labelFaction.init(xoffset+380, setupPos, GraphicListBox::defW, GraphicListBox::defH, true); labelFaction.setText(lang.get("Faction")); labelTeam.registerGraphicComponent(containerName,"labelTeam"); - labelTeam.init(xoffset+590, setupPos, 60, GraphicListBox::defH, true); + labelTeam.init(xoffset+640, setupPos, 60, GraphicListBox::defH, true); labelTeam.setText(lang.get("Team")); labelControl.setFont(CoreData::getInstance().getMenuFontBig()); @@ -389,7 +391,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM for(int i=0; i translatedFactionNames; - for(int i= 0; i translatedFactionNames; + factionFiles= results; + for(int i = 0; i < results.size(); ++i) { + results[i]= formatString(results[i]); + string translatedString=techTree->getTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i]); + if(translatedString==results[i]){ + translatedFactionNames.push_back(results[i]); + } + else { + translatedFactionNames.push_back(formatString(results[i]+" ("+translatedString+")")); + } + //printf("FACTIONS i = %d results [%s]\n",i,results[i].c_str()); - 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()); - } + 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()); + } for(int i=0; i 0 ? listBoxFactions[i].getSelectedItem() : ""); + int originalIndex = listBoxFactions[i].getSelectedItemIndex(); + string originalValue = (listBoxFactions[i].getItemCount() > 0 ? listBoxFactions[i].getSelectedItem() : ""); listBoxFactions[i].setItems(results,translatedFactionNames); if( keepExistingSelectedItem == false || @@ -3382,7 +3390,13 @@ bool MenuStateConnectedGame::loadFactions(const GameSettings *gameSettings, bool factionFiles = results; vector translatedFactionNames; for(int i= 0; i < factionFiles.size(); ++i) { - translatedFactionNames.push_back(formatString(techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i]))); + string translatedString=techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i]); + if(translatedString==results[i]){ + translatedFactionNames.push_back(formatString(results[i])); + } + else { + translatedFactionNames.push_back(formatString(results[i]+" ("+translatedString+")")); + } } for(int i=0; i translatedFactionNames; for(int i= 0; i < factionFiles.size(); ++i) { - translatedFactionNames.push_back(formatString(techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i]))); + string translatedString=techTree->getTranslatedFactionName(gameSettings->getTech(),factionFiles[i]); + if(translatedString==results[i]){ + translatedFactionNames.push_back(formatString(results[i])); + } + else { + translatedFactionNames.push_back(formatString(results[i]+" ("+translatedString+")")); + } } for(int i= 0; igetStartLocationIndex(i); + if(slot == clientInterface->getPlayerIndex()){ + labelPlayerNames[slot].setEditable(true); + } + else { + labelPlayerNames[slot].setEditable(false); + } + if(i >= gameSettings->getFactionCount()) { if( gameSettings->getFactionControl(i) != ctNetworkUnassigned) { continue; @@ -4528,19 +4555,19 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings, gameSettings->getFactionControl(i) == ctHuman) { switch(gameSettings->getNetworkPlayerStatuses(i)) { case npst_BeRightBack: - labelPlayerStatus[slot].setText(lang.get("PlayerStatusBeRightBack")); + labelPlayerStatus[slot].setText("#"); labelPlayerStatus[slot].setTextColor(Vec3f(1.f, 0.8f, 0.f)); break; case npst_Ready: - labelPlayerStatus[slot].setText(lang.get("PlayerStatusReady")); + labelPlayerStatus[slot].setText("#"); labelPlayerStatus[slot].setTextColor(Vec3f(0.f, 1.f, 0.f)); break; case npst_PickSettings: - labelPlayerStatus[slot].setText(lang.get("PlayerStatusSetup")); + labelPlayerStatus[slot].setText("#"); labelPlayerStatus[slot].setTextColor(Vec3f(1.f, 0.f, 0.f)); break; case npst_Disconnected: - labelPlayerStatus[slot].setText(lang.get("Closed")); + labelPlayerStatus[slot].setText(lang.get("-")); break; default: @@ -4821,19 +4848,20 @@ int MenuStateConnectedGame::setupTechList(string scenario, bool forceLoad) { techTreeFiles= results; + vector translatedTechs; + for(unsigned int i= 0; i < results.size(); i++) { + //printf("TECHS i = %d results [%s] scenario [%s]\n",i,results[i].c_str(),scenario.c_str()); + results.at(i)= formatString(results.at(i)); if(config.getString("InitialTechTree", "Megapack") == results.at(i)) { initialTechSelection= i; } - } - - vector translatedTechs; - for(unsigned int i= 0; i < techTreeFiles.size(); i++) { string txTech = techTree->getTranslatedName(techTreeFiles.at(i), forceLoad); translatedTechs.push_back(formatString(txTech)); } + listBoxTechTree.setItems(results,translatedTechs); } catch(const std::exception &ex) { diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 18179faf..aaed1f88 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -336,18 +336,6 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, checkBoxAllowNativeLanguageTechtree.init(xoffset+650, mapHeadPos-70); checkBoxAllowNativeLanguageTechtree.setValue(false); - // Network Scenario - int scenarioX=810; - int scenarioY=140; - labelScenario.registerGraphicComponent(containerName,"labelScenario"); - labelScenario.init(scenarioX, scenarioY); - labelScenario.setText(lang.get("Scenario")); - listBoxScenario.registerGraphicComponent(containerName,"listBoxScenario"); - listBoxScenario.init(scenarioX, scenarioY-30,190); - checkBoxScenario.registerGraphicComponent(containerName,"checkBoxScenario"); - checkBoxScenario.init(scenarioX+90, scenarioY); - checkBoxScenario.setValue(false); - // player status listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus"); listBoxPlayerStatus.init(810, buttony, 150); @@ -361,6 +349,18 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, listBoxPlayerStatus.setLighted(false); listBoxPlayerStatus.setVisible(true); + // Network Scenario + int scenarioX=810; + int scenarioY=140; + labelScenario.registerGraphicComponent(containerName,"labelScenario"); + labelScenario.init(scenarioX, scenarioY); + labelScenario.setText(lang.get("Scenario")); + listBoxScenario.registerGraphicComponent(containerName,"listBoxScenario"); + listBoxScenario.init(scenarioX, scenarioY-30,190); + checkBoxScenario.registerGraphicComponent(containerName,"checkBoxScenario"); + checkBoxScenario.init(scenarioX+90, scenarioY); + checkBoxScenario.setValue(false); + //scenario listbox vector resultsScenarios; findDirs(dirList, resultsScenarios); @@ -2347,7 +2347,7 @@ void MenuStateCustomGame::update() { labelPlayerStatus[i].setTextColor(Vec3f(1.f, 0.f, 0.f)); break; case npst_Disconnected: - labelPlayerStatus[i].setText(lang.get("Closed")); + labelPlayerStatus[i].setText("-"); break; default: @@ -4650,7 +4650,7 @@ void MenuStateCustomGame::reloadFactions(bool keepExistingSelectedItem, string s results[i]= formatString(results[i]); string translatedString=techTree->getTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i]); if(translatedString==results[i]){ - translatedFactionNames.push_back(results[i]); + translatedFactionNames.push_back(formatString(results[i])); } else { translatedFactionNames.push_back(formatString(results[i]+" ("+translatedString+")"));