forked from 0ad/0ad
Fix structure tree/civinfo with empty civ history.
Since the history string is optional, don't fail without it. Based on a patch by: @Silier Fixes #6651 This was SVN commit r27427.
This commit is contained in:
parent
344e85e97f
commit
eae5840b0e
@ -39,10 +39,7 @@ class CivInfoPage extends ReferencePage
|
||||
if(!civInfo)
|
||||
error(sprintf("Error loading civ data for \"%(code)s\"", { "code": civCode }));
|
||||
|
||||
// Update civ gameplay display
|
||||
this.gameplaySection.update(this.activeCiv, civInfo);
|
||||
|
||||
// Update civ history display
|
||||
this.historySection.update(civInfo);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,13 @@ class HistorySection
|
||||
|
||||
update(civInfo)
|
||||
{
|
||||
if (!civInfo.History)
|
||||
{
|
||||
this.CivHistoryHeading.caption = "";
|
||||
this.CivHistoryText.caption = "";
|
||||
return;
|
||||
}
|
||||
|
||||
this.CivHistoryHeading.caption =
|
||||
this.page.formatHeading(
|
||||
sprintf(this.headingCaption, { "civilization": civInfo.Name }),
|
||||
|
@ -48,7 +48,7 @@ class StructreePage extends ReferencePage
|
||||
|
||||
this.CivEmblem.sprite = "stretched:" + this.civData[this.activeCiv].Emblem;
|
||||
this.CivName.caption = this.civData[this.activeCiv].Name;
|
||||
this.CivHistory.caption = this.civData[this.activeCiv].History;
|
||||
this.CivHistory.caption = this.civData[this.activeCiv].History || "";
|
||||
|
||||
let templateLists = this.TemplateLister.getTemplateLists(this.activeCiv);
|
||||
this.TreeSection.draw(templateLists.structures, this.activeCiv);
|
||||
|
Loading…
Reference in New Issue
Block a user