diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index d2bd87ac1..2673969b9 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -71,8 +71,6 @@ void ScriptManager::init(World* world, GameCamera *gameCamera){ luaScript.registerFunction(getLastDeadUnitId, "lastDeadUnit"); luaScript.registerFunction(getUnitCount, "unitCount"); luaScript.registerFunction(getUnitCountOfType, "unitCountOfType"); - luaScript.registerFunction(unfogMap, "unfogMap"); - //load code for(int i= 0; igetScriptCount(); ++i){ @@ -397,14 +395,4 @@ int ScriptManager::getUnitCountOfType(LuaHandle* luaHandle){ return luaArguments.getReturnCount(); } -void ScriptManager::unfogMap() { - world->setFogOfWar(false); -} - -int ScriptManager::unfogMap(LuaHandle* luaHandle){ - LuaArguments luaArguments(luaHandle); - thisScriptManager->unfogMap(); - return luaArguments.getReturnCount(); -} - }}//end namespace diff --git a/source/glest_game/game/script_manager.h b/source/glest_game/game/script_manager.h index dbb197650..421cc723b 100644 --- a/source/glest_game/game/script_manager.h +++ b/source/glest_game/game/script_manager.h @@ -136,7 +136,6 @@ private: void disableAi(int factionIndex); void setPlayerAsWinner(int factionIndex); void endGame(); - void unfogMap(); //wrappers, queries Vec2i getStartLocation(int factionIndex); @@ -163,7 +162,6 @@ private: static int disableAi(LuaHandle* luaHandle); static int setPlayerAsWinner(LuaHandle* luaHandle); static int endGame(LuaHandle* luaHandle); - static int unfogMap(LuaHandle* luaHandle); //callbacks, queries static int getStartLocation(LuaHandle* luaHandle); diff --git a/source/glest_game/menu/main_menu.h b/source/glest_game/menu/main_menu.h index dc426f7e3..c4926b021 100644 --- a/source/glest_game/menu/main_menu.h +++ b/source/glest_game/menu/main_menu.h @@ -46,6 +46,8 @@ struct ScenarioInfo bool defaultVictoryConditions; string desc; + + bool fogOfWar; }; class MenuState; diff --git a/source/glest_game/menu/menu_state_scenario.cpp b/source/glest_game/menu/menu_state_scenario.cpp index b897ca77d..e6bbc6ab4 100644 --- a/source/glest_game/menu/menu_state_scenario.cpp +++ b/source/glest_game/menu/menu_state_scenario.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2005 Martiņo Figueroa +// Copyright (C) 2001-2005 Martio Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -198,6 +198,13 @@ void MenuStateScenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo scenarioInfo->desc+= lang.get("Map") + ": " + formatString(scenarioInfo->mapName) + "\n"; scenarioInfo->desc+= lang.get("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n"; 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(); + } + else { + scenarioInfo->fogOfWar = true; + } } void MenuStateScenario::loadGameSettings(const ScenarioInfo *scenarioInfo, GameSettings *gameSettings){ @@ -229,6 +236,7 @@ void MenuStateScenario::loadGameSettings(const ScenarioInfo *scenarioInfo, GameS } gameSettings->setFactionCount(factionCount); + gameSettings->setFogOfWar(scenarioInfo->fogOfWar); } ControlType MenuStateScenario::strToControllerType(const string &str){