mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
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.
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