1
0
forked from mirrors/0ad
Files
0ad/binaries/data/mods/public/gui/reference/common/common.js
T
s0600204 b2842e8021 Rewrite Structure Tree and Template Viewer to use OOP principles
Commenters: elexis, Stan, Angen
Refs.: #5387
Differential Revision: https://code.wildfiregames.com/D2734
This was SVN commit r23808.
2020-07-07 19:11:36 +00:00

29 lines
940 B
JavaScript

/**
* This needs to stay in the global scope, as it is used by various functions
* within gui/common/tooltip.js
*/
var g_ResourceData = new Resources();
var g_Page;
/**
* This is needed because getEntityCostTooltip in tooltip.js needs to get
* the template data of the different wallSet pieces. In the session this
* function does some caching, but here we do that in the TemplateLoader
* class already.
*/
function GetTemplateData(templateName)
{
let template = g_Page.TemplateLoader.loadEntityTemplate(templateName, g_Page.activeCiv);
return GetTemplateDataHelper(template, null, g_Page.TemplateLoader.auraData, g_Page.TemplateParser.getModifiers(g_Page.activeCiv));
}
/**
* This would ideally be an Engine method.
* Or part of globalscripts. Either would be better than here.
*/
function TechnologyTemplateExists(templateName)
{
return Engine.FileExists(g_Page.TemplateLoader.TechnologyPath + templateName + ".json");
}