Give access to the templates to the GUI. This will be useful for eventually displaying factions specificities in main menus.

This was SVN commit r16075.
This commit is contained in:
Itms
2014-12-28 16:21:07 +00:00
parent 92af594986
commit 4c12440868
5 changed files with 28 additions and 4 deletions
+6
View File
@@ -842,6 +842,11 @@ CScriptVal ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, std::wstring fil
return out.get();
}
CParamNode GetTemplate(ScriptInterface::CxPrivate* pCxPrivate, std::string templateName)
{
return g_GUI->GetTemplate(templateName);
}
//-----------------------------------------------------------------------------
// Timer
//-----------------------------------------------------------------------------
@@ -1002,6 +1007,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<int, &GetFps>("GetFPS");
scriptInterface.RegisterFunction<std::wstring, int, &GetBuildTimestamp>("GetBuildTimestamp");
scriptInterface.RegisterFunction<CScriptVal, std::wstring, &ReadJSONFile>("ReadJSONFile");
scriptInterface.RegisterFunction<CParamNode, std::string, &GetTemplate>("GetTemplate");
// User report functions
scriptInterface.RegisterFunction<bool, &IsUserReportEnabled>("IsUserReportEnabled");