From a3029e6e2529a85e85fee6fc72dd40ef300652ae Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 30 Mar 2011 23:48:27 +0000 Subject: [PATCH] - updated lua attribute to additionally accept: --- source/glest_game/menu/main_menu.h | 1 + source/glest_game/menu/menu_state_scenario.cpp | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/glest_game/menu/main_menu.h b/source/glest_game/menu/main_menu.h index 626c8369..c6ce2ac5 100644 --- a/source/glest_game/menu/main_menu.h +++ b/source/glest_game/menu/main_menu.h @@ -58,6 +58,7 @@ struct ScenarioInfo string desc; bool fogOfWar; + bool fogOfWar_exploredFlag; }; class MenuState; diff --git a/source/glest_game/menu/menu_state_scenario.cpp b/source/glest_game/menu/menu_state_scenario.cpp index 476d0275..1b87853b 100644 --- a/source/glest_game/menu/menu_state_scenario.cpp +++ b/source/glest_game/menu/menu_state_scenario.cpp @@ -308,11 +308,19 @@ void MenuStateScenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo scenarioInfo->desc+= lang.get("TechTree") + ": " + formatString(scenarioInfo->techTreeName) + "\n"; if(scenarioNode->hasChild("fog-of-war") == true) { - scenarioInfo->fogOfWar = scenarioNode->getChild("fog-of-war")->getAttribute("value")->getBoolValue(); + if(scenarioNode->getChild("fog-of-war")->getAttribute("value")->getValue() == "explored") { + scenarioInfo->fogOfWar = true; + scenarioInfo->fogOfWar_exploredFlag = true; + } + else { + scenarioInfo->fogOfWar = scenarioNode->getChild("fog-of-war")->getAttribute("value")->getBoolValue(); + scenarioInfo->fogOfWar_exploredFlag = false; + } //printf("\nFOG OF WAR is set to [%d]\n",scenarioInfo->fogOfWar); } else { - scenarioInfo->fogOfWar = true; + scenarioInfo->fogOfWar = true; + scenarioInfo->fogOfWar_exploredFlag = false; } enableScenarioTexturePreview = true; @@ -366,7 +374,7 @@ void MenuStateScenario::loadGameSettings(const ScenarioInfo *scenarioInfo, GameS gameSettings->setFactionCount(factionCount); gameSettings->setFogOfWar(scenarioInfo->fogOfWar); uint32 valueFlags1 = gameSettings->getFlagTypes1(); - if(scenarioInfo->fogOfWar == false) { + if(scenarioInfo->fogOfWar == false || scenarioInfo->fogOfWar_exploredFlag) { valueFlags1 |= ft1_show_map_resources; gameSettings->setFlagTypes1(valueFlags1); }