forked from mirrors/0ad
Fix phase names not updating on the structure tree
Reload all cached phase data when switching civ.
Add missing query for the generic phase technologies to the phase idents.
(cherry picked from commit 33111dc816)
Signed-off-by: Itms <itms@wildfiregames.com>
This commit is contained in:
@@ -371,6 +371,9 @@ class TemplateParser
|
||||
|
||||
derivePhaseList(technologyList, civCode)
|
||||
{
|
||||
// Wipe all cached phase data. It contains the previous civ's SpecificNames which wouldn't be reloaded otherwise.
|
||||
this.phases = {};
|
||||
|
||||
// Load all of a civ's specific phase technologies
|
||||
for (let techcode of technologyList)
|
||||
if (this.TemplateLoader.isPhaseTech(techcode))
|
||||
|
||||
@@ -47,7 +47,10 @@ class PhaseIdent
|
||||
drawPhaseIcon(phaseIcon, phaseIndex, civCode)
|
||||
{
|
||||
let phaseName = this.page.TemplateParser.phaseList[phaseIndex];
|
||||
let prodPhaseTemplate = this.page.TemplateParser.getTechnology(phaseName + "_" + civCode, civCode) || this.page.TemplateParser.getTechnology(phaseName, civCode);
|
||||
let prodPhaseTemplate =
|
||||
this.page.TemplateParser.getTechnology(phaseName + "_" + civCode, civCode) ||
|
||||
this.page.TemplateParser.getTechnology(phaseName + "_generic", civCode) ||
|
||||
this.page.TemplateParser.getTechnology(phaseName, civCode);
|
||||
|
||||
phaseIcon.sprite = "stretched:" + this.page.IconPath + prodPhaseTemplate.icon;
|
||||
phaseIcon.tooltip = getEntityNamesFormatted(prodPhaseTemplate);
|
||||
|
||||
Reference in New Issue
Block a user