Fix #56 (add unit-following camera mode (press 'F')), based on patch from markelov.

Remove obsolete IsNewSimulation function.

This was SVN commit r8190.
This commit is contained in:
Ykkrosh
2010-09-26 23:05:25 +00:00
parent 9bdbc3906f
commit 82691683cb
10 changed files with 108 additions and 7 deletions
+11 -6
View File
@@ -73,11 +73,6 @@ void PopGuiPage(void* UNUSED(cbdata))
g_GUI->PopPage();
}
bool IsNewSimulation(void* UNUSED(cbdata))
{
return true; // XXX: delete this function
}
CScriptVal GuiInterfaceCall(void* cbdata, std::wstring name, CScriptVal data)
{
CGUIManager* guiManager = static_cast<CGUIManager*> (cbdata);
@@ -317,6 +312,16 @@ void SetRevealMap(void* UNUSED(cbdata), bool enabled)
cmpRangeManager->SetLosRevealAll(enabled);
}
/**
* Start / stop camera following mode
* @param entityid unit id to follow. If zero, stop following mode
*/
void CameraFollow(void* UNUSED(cbdata), entity_id_t entityid)
{
if (g_Game && g_Game->GetView())
g_Game->GetView()->CameraFollow(entityid);
}
} // namespace
void GuiScriptingInit(ScriptInterface& scriptInterface)
@@ -328,7 +333,6 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<void, &PopGuiPage>("PopGuiPage");
// Simulation<->GUI interface functions:
scriptInterface.RegisterFunction<bool, &IsNewSimulation>("IsNewSimulation");
scriptInterface.RegisterFunction<CScriptVal, std::wstring, CScriptVal, &GuiInterfaceCall>("GuiInterfaceCall");
scriptInterface.RegisterFunction<void, CScriptVal, &PostNetworkCommand>("PostNetworkCommand");
@@ -357,4 +361,5 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<bool, &AtlasIsAvailable>("AtlasIsAvailable");
scriptInterface.RegisterFunction<CScriptVal, std::wstring, &LoadMapData>("LoadMapData");
scriptInterface.RegisterFunction<void, bool, &SetRevealMap>("SetRevealMap");
scriptInterface.RegisterFunction<void, entity_id_t, &CameraFollow>("CameraFollow");
}