Changes between Initial Version and Version 1 of Ticket #6691


Ignore:
Timestamp:
Jan 16, 2023, 9:27:55 AM (16 months ago)
Author:
Langbart
Comment:

Minimize the diff from the possible solution section

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6691 – Description

    initial v1  
    1717--- a/binaries/data/mods/public/gui/reference/viewer/ViewerPage.js
    1818+++ b/binaries/data/mods/public/gui/reference/viewer/ViewerPage.js
    19 @@ -82,6 +82,15 @@ class ViewerPage extends ReferencePage
     19@@ -77,6 +77,11 @@ class ViewerPage extends ReferencePage
     20                        let researchers = templateLists.techs.get(currentTemplateName);
     21                        if (researchers && researchers.length)
     22                                this.currentTemplate.researchedByListOfNames = researchers.map(researcher => getEntityNames(this.TemplateParser.getEntity(researcher, this.activeCiv)));
     23+
     24+                       const {techCostMultiplier} = this.TemplateParser.getEntity(researchers[0], this.activeCiv);
     25+                       for (const res in this.currentTemplate.cost)
     26+                               if (this.currentTemplate.cost[res])
     27+                                       this.currentTemplate.cost[res] *= techCostMultiplier[res];
     28                }
     29 
    2030                if (this.currentTemplate.builder && this.currentTemplate.builder.length)
    21                         this.currentTemplate.buildListOfNames = this.currentTemplate.builder.map(prod => getEntityNames(this.TemplateParser.getEntity(prod, this.activeCiv)));
    22  
    23 +               if (this.currentTemplate.researchedByListOfNames)
    24 +               {
    25 +                       const structure = this.TemplateParser.getEntity(`structures/${this.activeCiv}/${this.currentTemplate.researchedByListOfNames[0].toLowerCase()}`, this.activeCiv);
    26 +
    27 +                       for (const i in this.currentTemplate.cost)
    28 +                               if (this.currentTemplate.cost[i])
    29 +                                       this.currentTemplate.cost[i] *= structure.techCostMultiplier[i];
    30 +               }
    31 +
    32                 if (this.currentTemplate.production)
    33                 {
    34                         if (this.currentTemplate.production.units && this.currentTemplate.production.units.length)
    3531}}}
    3632