From c0fe2425042a68ae54b64e05ce955bbcfc53e42f Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 12 Feb 2013 02:10:00 +0000 Subject: [PATCH] - allow for translated names to be shown for tutorials and scenarios in selection menu --- .../glest_game/menu/menu_state_scenario.cpp | 21 +++++++++++++++++-- source/glest_game/world/scenario.cpp | 10 +++++++++ source/glest_game/world/scenario.h | 2 ++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/source/glest_game/menu/menu_state_scenario.cpp b/source/glest_game/menu/menu_state_scenario.cpp index fa7da545..2e72e8e5 100644 --- a/source/glest_game/menu/menu_state_scenario.cpp +++ b/source/glest_game/menu/menu_state_scenario.cpp @@ -113,8 +113,25 @@ MenuStateScenario::MenuStateScenario(Program *program, MainMenu *mainMenu, showMessageBox( "Error: There are no scenarios found to load", "Error detected", false); } } - for(int i= 0; idesc += lang.get("Description") + ": \n" + tmp_description + "\n"; } + scenarioInfo->namei18n = ""; + if(lang.hasScenarioString("SCENARIO_NAME") == true) { + scenarioInfo->namei18n =lang.getScenarioString("SCENARIO_NAME"); + //printf("scenarioInfo->namei18n [%s]\n",scenarioInfo->namei18n.c_str()); + } + else if(lang.hasScenarioString("TUTORIAL_NAME") == true) { + scenarioInfo->namei18n =lang.getScenarioString("TUTORIAL_NAME"); + //printf("scenarioInfo->namei18n [%s]\n",scenarioInfo->namei18n.c_str()); + } + if(scenarioNode->hasChild("fog-of-war") == true) { if(scenarioNode->getChild("fog-of-war")->getAttribute("value")->getValue() == "explored") { scenarioInfo->fogOfWar = true; diff --git a/source/glest_game/world/scenario.h b/source/glest_game/world/scenario.h index e789e841..da1e0e09 100644 --- a/source/glest_game/world/scenario.h +++ b/source/glest_game/world/scenario.h @@ -70,6 +70,7 @@ public: file = ""; name = ""; + namei18n = ""; } int difficulty; ControlType factionControls[GameConstants::maxPlayers]; @@ -92,6 +93,7 @@ public: string file; string name; + string namei18n; }; // =====================================================