mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-18 06:13:55 -07:00
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
binaries/data/mods/public/gui/reference
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
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)
|
|
{
|
|
const template = g_Page.TemplateLoader.loadEntityTemplate(templateName, g_Page.activeCiv);
|
|
return GetTemplateDataHelper(template, null, g_Page.TemplateLoader.auraData, g_ResourceData, 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");
|
|
}
|
|
|
|
function AuraTemplateExists(templateName)
|
|
{
|
|
return Engine.FileExists(g_Page.TemplateLoader.AuraPath + templateName + ".json");
|
|
}
|