mirror of
https://github.com/glest/glest-source.git
synced 2025-09-02 20:42:34 +02:00
Changed fow setting to use a property instead of lua method
This commit is contained in:
@@ -71,8 +71,6 @@ void ScriptManager::init(World* world, GameCamera *gameCamera){
|
|||||||
luaScript.registerFunction(getLastDeadUnitId, "lastDeadUnit");
|
luaScript.registerFunction(getLastDeadUnitId, "lastDeadUnit");
|
||||||
luaScript.registerFunction(getUnitCount, "unitCount");
|
luaScript.registerFunction(getUnitCount, "unitCount");
|
||||||
luaScript.registerFunction(getUnitCountOfType, "unitCountOfType");
|
luaScript.registerFunction(getUnitCountOfType, "unitCountOfType");
|
||||||
luaScript.registerFunction(unfogMap, "unfogMap");
|
|
||||||
|
|
||||||
|
|
||||||
//load code
|
//load code
|
||||||
for(int i= 0; i<scenario->getScriptCount(); ++i){
|
for(int i= 0; i<scenario->getScriptCount(); ++i){
|
||||||
@@ -397,14 +395,4 @@ int ScriptManager::getUnitCountOfType(LuaHandle* luaHandle){
|
|||||||
return luaArguments.getReturnCount();
|
return luaArguments.getReturnCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptManager::unfogMap() {
|
|
||||||
world->setFogOfWar(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ScriptManager::unfogMap(LuaHandle* luaHandle){
|
|
||||||
LuaArguments luaArguments(luaHandle);
|
|
||||||
thisScriptManager->unfogMap();
|
|
||||||
return luaArguments.getReturnCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
@@ -136,7 +136,6 @@ private:
|
|||||||
void disableAi(int factionIndex);
|
void disableAi(int factionIndex);
|
||||||
void setPlayerAsWinner(int factionIndex);
|
void setPlayerAsWinner(int factionIndex);
|
||||||
void endGame();
|
void endGame();
|
||||||
void unfogMap();
|
|
||||||
|
|
||||||
//wrappers, queries
|
//wrappers, queries
|
||||||
Vec2i getStartLocation(int factionIndex);
|
Vec2i getStartLocation(int factionIndex);
|
||||||
@@ -163,7 +162,6 @@ private:
|
|||||||
static int disableAi(LuaHandle* luaHandle);
|
static int disableAi(LuaHandle* luaHandle);
|
||||||
static int setPlayerAsWinner(LuaHandle* luaHandle);
|
static int setPlayerAsWinner(LuaHandle* luaHandle);
|
||||||
static int endGame(LuaHandle* luaHandle);
|
static int endGame(LuaHandle* luaHandle);
|
||||||
static int unfogMap(LuaHandle* luaHandle);
|
|
||||||
|
|
||||||
//callbacks, queries
|
//callbacks, queries
|
||||||
static int getStartLocation(LuaHandle* luaHandle);
|
static int getStartLocation(LuaHandle* luaHandle);
|
||||||
|
@@ -46,6 +46,8 @@ struct ScenarioInfo
|
|||||||
bool defaultVictoryConditions;
|
bool defaultVictoryConditions;
|
||||||
|
|
||||||
string desc;
|
string desc;
|
||||||
|
|
||||||
|
bool fogOfWar;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MenuState;
|
class MenuState;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// ==============================================================
|
// ==============================================================
|
||||||
// This file is part of Glest (www.glest.org)
|
// This file is part of Glest (www.glest.org)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2005 Marti<EFBFBD>o Figueroa
|
// Copyright (C) 2001-2005 Martio Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// 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("Map") + ": " + formatString(scenarioInfo->mapName) + "\n";
|
||||||
scenarioInfo->desc+= lang.get("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n";
|
scenarioInfo->desc+= lang.get("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n";
|
||||||
scenarioInfo->desc+= lang.get("TechTree") + ": " + formatString(scenarioInfo->techTreeName) + "\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){
|
void MenuStateScenario::loadGameSettings(const ScenarioInfo *scenarioInfo, GameSettings *gameSettings){
|
||||||
@@ -229,6 +236,7 @@ void MenuStateScenario::loadGameSettings(const ScenarioInfo *scenarioInfo, GameS
|
|||||||
}
|
}
|
||||||
|
|
||||||
gameSettings->setFactionCount(factionCount);
|
gameSettings->setFactionCount(factionCount);
|
||||||
|
gameSettings->setFogOfWar(scenarioInfo->fogOfWar);
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlType MenuStateScenario::strToControllerType(const string &str){
|
ControlType MenuStateScenario::strToControllerType(const string &str){
|
||||||
|
Reference in New Issue
Block a user