Rename some variables to point out that they are only used in visual replay. Add script function IsVisualReplay. Refs #9 #3355, patch by elexis

This was SVN commit r17017.
This commit is contained in:
mimo
2015-09-13 19:03:33 +00:00
parent 7ac0a4a3db
commit 9816e7c92d
4 changed files with 26 additions and 13 deletions
+6
View File
@@ -181,6 +181,11 @@ std::wstring SetCursor(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), std::wstr
return old;
}
bool IsVisualReplay(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
{
return g_Game ? g_Game->IsVisualReplay() : false;
}
int GetPlayerID(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
{
if (g_Game)
@@ -978,6 +983,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
// Misc functions
scriptInterface.RegisterFunction<std::wstring, std::wstring, &SetCursor>("SetCursor");
scriptInterface.RegisterFunction<bool, &IsVisualReplay>("IsVisualReplay");
scriptInterface.RegisterFunction<int, &GetPlayerID>("GetPlayerID");
scriptInterface.RegisterFunction<void, int, &SetPlayerID>("SetPlayerID");
scriptInterface.RegisterFunction<void, std::string, &OpenURL>("OpenURL");