Changed fow setting to use a property instead of lua method
This commit is contained in:
parent
2e702d8dd8
commit
afcdc1209c
|
@ -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; i<scenario->getScriptCount(); ++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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -46,6 +46,8 @@ struct ScenarioInfo
|
|||
bool defaultVictoryConditions;
|
||||
|
||||
string desc;
|
||||
|
||||
bool fogOfWar;
|
||||
};
|
||||
|
||||
class MenuState;
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Reference in New Issue
Block a user