Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/structree/load.js
function loadUnit(templateName) | function loadUnit(templateName) | ||||
{ | { | ||||
if (!Engine.TemplateExists(templateName)) | if (!Engine.TemplateExists(templateName)) | ||||
return null; | return null; | ||||
let template = loadTemplate(templateName); | let template = loadTemplate(templateName); | ||||
let unit = GetTemplateDataHelper(template, null, g_AuraData, g_ResourceData); | let unit = GetTemplateDataHelper(template, null, g_AuraData, g_ResourceData, g_CurrentModifiers); | ||||
if (template.ProductionQueue) | if (template.ProductionQueue) | ||||
{ | { | ||||
unit.production = {}; | unit.production = {}; | ||||
if (template.ProductionQueue.Entities) | if (template.ProductionQueue.Entities) | ||||
{ | { | ||||
unit.production.units = []; | unit.production.units = []; | ||||
for (let build of template.ProductionQueue.Entities._string.split(" ")) | for (let build of template.ProductionQueue.Entities._string.split(" ")) | ||||
Show All 25 Lines | if (template.Builder && template.Builder.Entities._string) | ||||
} | } | ||||
return unit; | return unit; | ||||
} | } | ||||
function loadStructure(templateName) | function loadStructure(templateName) | ||||
{ | { | ||||
let template = loadTemplate(templateName); | let template = loadTemplate(templateName); | ||||
let structure = GetTemplateDataHelper(template, null, g_AuraData, g_ResourceData); | let structure = GetTemplateDataHelper(template, null, g_AuraData, g_ResourceData, g_CurrentModifiers); | ||||
structure.production = { | structure.production = { | ||||
"technology": [], | "technology": [], | ||||
"units": [] | "units": [] | ||||
}; | }; | ||||
if (template.ProductionQueue) | if (template.ProductionQueue) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator