mirror of
https://github.com/glest/glest-source.git
synced 2025-09-02 04:22:32 +02:00
- added two new lua functions:
networkSetCameraPositionForFaction(int factionIndex,Vec2i pos) networkSetCameraPositionForTeam(int teamIndex, Vec2i pos)
This commit is contained in:
@@ -243,6 +243,9 @@ void ScriptManager::init(World* world, GameCamera *gameCamera, const XmlNode *ro
|
|||||||
luaScript.registerFunction(networkShowMessageForFaction, "networkShowMessageForFaction");
|
luaScript.registerFunction(networkShowMessageForFaction, "networkShowMessageForFaction");
|
||||||
luaScript.registerFunction(networkShowMessageForTeam, "networkShowMessageForTeam");
|
luaScript.registerFunction(networkShowMessageForTeam, "networkShowMessageForTeam");
|
||||||
|
|
||||||
|
luaScript.registerFunction(networkSetCameraPositionForFaction, "networkSetCameraPositionForFaction");
|
||||||
|
luaScript.registerFunction(networkSetCameraPositionForTeam, "networkSetCameraPositionForTeam");
|
||||||
|
|
||||||
luaScript.registerFunction(showMessage, "showMessage");
|
luaScript.registerFunction(showMessage, "showMessage");
|
||||||
luaScript.registerFunction(setDisplayText, "setDisplayText");
|
luaScript.registerFunction(setDisplayText, "setDisplayText");
|
||||||
luaScript.registerFunction(addConsoleText, "addConsoleText");
|
luaScript.registerFunction(addConsoleText, "addConsoleText");
|
||||||
@@ -827,6 +830,26 @@ void ScriptManager::networkShowMessageForTeam(const string &text, const string &
|
|||||||
onMessageBoxOk(false);
|
onMessageBoxOk(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptManager::networkSetCameraPositionForFaction(int factionIndex, const Vec2i &pos) {
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
||||||
|
|
||||||
|
if(factionIndex == this->world->getThisFactionIndex()) {
|
||||||
|
gameCamera->centerXZ(pos.x, pos.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScriptManager::networkSetCameraPositionForTeam(int teamIndex, const Vec2i &pos) {
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
||||||
|
|
||||||
|
if(teamIndex == this->world->getThisTeamIndex()) {
|
||||||
|
gameCamera->centerXZ(pos.x, pos.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptManager::showMessage(const string &text, const string &header){
|
void ScriptManager::showMessage(const string &text, const string &header){
|
||||||
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
ScriptManager_STREFLOP_Wrapper streflopWrapper;
|
||||||
|
|
||||||
@@ -1600,6 +1623,19 @@ int ScriptManager::networkShowMessageForTeam(LuaHandle* luaHandle){
|
|||||||
return luaArguments.getReturnCount();
|
return luaArguments.getReturnCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ScriptManager::networkSetCameraPositionForFaction(LuaHandle* luaHandle){
|
||||||
|
LuaArguments luaArguments(luaHandle);
|
||||||
|
thisScriptManager->networkSetCameraPositionForFaction(luaArguments.getInt(-2), luaArguments.getVec2i(-1));
|
||||||
|
return luaArguments.getReturnCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScriptManager::networkSetCameraPositionForTeam(LuaHandle* luaHandle){
|
||||||
|
LuaArguments luaArguments(luaHandle);
|
||||||
|
thisScriptManager->networkSetCameraPositionForTeam(luaArguments.getInt(-2), luaArguments.getVec2i(-1));
|
||||||
|
return luaArguments.getReturnCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int ScriptManager::setDisplayText(LuaHandle* luaHandle){
|
int ScriptManager::setDisplayText(LuaHandle* luaHandle){
|
||||||
LuaArguments luaArguments(luaHandle);
|
LuaArguments luaArguments(luaHandle);
|
||||||
thisScriptManager->setDisplayText(luaArguments.getString(-1));
|
thisScriptManager->setDisplayText(luaArguments.getString(-1));
|
||||||
|
@@ -241,6 +241,9 @@ private:
|
|||||||
void networkShowMessageForFaction(const string &text, const string &header,int factionIndex);
|
void networkShowMessageForFaction(const string &text, const string &header,int factionIndex);
|
||||||
void networkShowMessageForTeam(const string &text, const string &header,int teamIndex);
|
void networkShowMessageForTeam(const string &text, const string &header,int teamIndex);
|
||||||
|
|
||||||
|
void networkSetCameraPositionForFaction(int factionIndex, const Vec2i &pos);
|
||||||
|
void networkSetCameraPositionForTeam(int teamIndex, const Vec2i &pos);
|
||||||
|
|
||||||
void showMessage(const string &text, const string &header);
|
void showMessage(const string &text, const string &header);
|
||||||
void clearDisplayText();
|
void clearDisplayText();
|
||||||
void setDisplayText(const string &text);
|
void setDisplayText(const string &text);
|
||||||
@@ -363,6 +366,9 @@ private:
|
|||||||
static int networkShowMessageForFaction(LuaHandle* luaHandle);
|
static int networkShowMessageForFaction(LuaHandle* luaHandle);
|
||||||
static int networkShowMessageForTeam(LuaHandle* luaHandle);
|
static int networkShowMessageForTeam(LuaHandle* luaHandle);
|
||||||
|
|
||||||
|
static int networkSetCameraPositionForFaction(LuaHandle* luaHandle);
|
||||||
|
static int networkSetCameraPositionForTeam(LuaHandle* luaHandle);
|
||||||
|
|
||||||
static int showMessage(LuaHandle* luaHandle);
|
static int showMessage(LuaHandle* luaHandle);
|
||||||
static int setDisplayText(LuaHandle* luaHandle);
|
static int setDisplayText(LuaHandle* luaHandle);
|
||||||
static int addConsoleText(LuaHandle* luaHandle);
|
static int addConsoleText(LuaHandle* luaHandle);
|
||||||
|
Reference in New Issue
Block a user