From 524c0ef2d965fba842ea01a8d6e9cd151ed2abf3 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Thu, 24 Oct 2013 00:02:08 +0000 Subject: [PATCH] new arranged custom menu to get space for translated and untranslated faction names. ( this is work in progress and will be continued the next days. --- .../menu/menu_state_custom_game.cpp | 76 +++++++++++-------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 66814c57..c139a780 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -166,9 +166,6 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, buttonReturn.registerGraphicComponent(containerName,"buttonReturn"); buttonReturn.init(240, 180, 125); - buttonClearBlockedPlayers.registerGraphicComponent(containerName,"buttonClearBlockedPlayers"); - buttonClearBlockedPlayers.init(310, 620, 140); - buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings"); buttonRestoreLastSettings.init(250+130, 180, 220); @@ -178,7 +175,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, techTree.reset(new TechTree(config.getPathListForType(ptTechs))); int labelOffset=23; - int setupPos=590; + int setupPos=600; int mapHeadPos=330; int mapPos=mapHeadPos-labelOffset; int aHeadPos=240; @@ -402,56 +399,62 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, checkBoxNetworkPauseGameForLaggedClients.setValue(true); //list boxes - xoffset=100; + xoffset=40; int rowHeight=27; for(int i=0; i playerStatuses; playerStatuses.push_back(lang.get("PlayerStatusSetup")); playerStatuses.push_back(lang.get("PlayerStatusBeRightBack")); @@ -959,9 +965,11 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { else { string advanceToItemStartingWith = ""; if(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) { - wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed(); - //printf("lastKey = %d [%c]\n",lastKey,lastKey); - advanceToItemStartingWith = lastKey; + const wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed(); + xxx: +// string hehe=lastKey; +// printf("lastKey = %d [%c] '%s'\n",lastKey,lastKey,hehe); + advanceToItemStartingWith = lastKey; } if(activeInputLabel!=NULL && !(activeInputLabel->mouseClick(x,y))){ @@ -2324,16 +2332,19 @@ void MenuStateCustomGame::update() { if(listBoxControls[i].getSelectedItemIndex() == ctHuman) { switch(gameSettings.getNetworkPlayerStatuses(slotIndex)) { case npst_BeRightBack: - labelPlayerStatus[i].setText(lang.get("PlayerStatusBeRightBack")); + labelPlayerStatus[i].setText("#"); labelPlayerStatus[i].setTextColor(Vec3f(1.f, 0.8f, 0.f)); + labelPlayerNames[i].setTextColor(Vec3f(1.f, 0.8f, 0.f)); break; case npst_Ready: - labelPlayerStatus[i].setText(lang.get("PlayerStatusReady")); + labelPlayerStatus[i].setText("#"); labelPlayerStatus[i].setTextColor(Vec3f(0.f, 1.f, 0.f)); + labelPlayerNames[i].setTextColor(Vec3f(0.f, 1.f, 0.f)); break; case npst_PickSettings: - labelPlayerStatus[i].setText(lang.get("PlayerStatusSetup")); + labelPlayerStatus[i].setText("#"); labelPlayerStatus[i].setTextColor(Vec3f(1.f, 0.f, 0.f)); + labelPlayerNames[i].setTextColor(Vec3f(1.f, 0.f, 0.f)); break; case npst_Disconnected: labelPlayerStatus[i].setText(lang.get("Closed")); @@ -2365,17 +2376,20 @@ void MenuStateCustomGame::update() { if(hasNetworkGameSettings() == true) { switch(serverInterface->getSlot(i)->getNetworkPlayerStatus()) { case npst_BeRightBack: - labelPlayerStatus[i].setText(lang.get("PlayerStatusBeRightBack")); + labelPlayerStatus[i].setText("#"); labelPlayerStatus[i].setTextColor(Vec3f(1.f, 0.8f, 0.f)); + labelPlayerNames[i].setTextColor(Vec3f(1.f, 0.8f, 0.f)); break; case npst_Ready: - labelPlayerStatus[i].setText(lang.get("PlayerStatusReady")); + labelPlayerStatus[i].setText("#"); labelPlayerStatus[i].setTextColor(Vec3f(0.f, 1.f, 0.f)); + labelPlayerNames[i].setTextColor(Vec3f(0.f, 1.f, 0.f)); break; case npst_PickSettings: default: - labelPlayerStatus[i].setText(lang.get("PlayerStatusSetup")); + labelPlayerStatus[i].setText("#"); labelPlayerStatus[i].setTextColor(Vec3f(1.f, 0.f, 0.f)); + labelPlayerNames[i].setTextColor(Vec3f(1.f, 0.f, 0.f)); break; } } @@ -4639,7 +4653,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(formatString(techTree->getTranslatedFactionName(techTreeFiles[listBoxTechTree.getSelectedItemIndex()],factionFiles[i]))); + translatedFactionNames.push_back(formatString(results[i]+" ("+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());