Ticket #3948: 3948-sheep-summary-screen.patch

File 3948-sheep-summary-screen.patch, 7.2 KB (added by Jon Baer, 8 years ago)
  • binaries/data/mods/public/gui/summary/counters.js

    diff --git a/binaries/data/mods/public/gui/summary/counters.js b/binaries/data/mods/public/gui/summary/counters.js
    index f5c13f6..a3d1853 100644
    a b function calculateColorsTeam(counters)  
    157157function calculateUnits(playerState, position)
    158158{
    159159    let type = g_UnitsTypes[position];
    160     return g_TrainedColor + playerState.statistics.unitsTrained[type] + '[/color] / ' +
    161         g_LostColor + playerState.statistics.unitsLost[type] + '[/color] / ' +
    162         g_KilledColor + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
     160
     161    if (type == "total") {
     162        return g_TrainedColor + (playerState.statistics.unitsTrained[type] - playerState.statistics.unitsTrained['Animal']) + '[/color] / ' +
     163            g_LostColor + playerState.statistics.unitsLost[type] + '[/color] / ' +
     164            g_KilledColor + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
     165    } else {
     166        return g_TrainedColor + playerState.statistics.unitsTrained[type] + '[/color] / ' +
     167            g_LostColor + playerState.statistics.unitsLost[type] + '[/color] / ' +
     168            g_KilledColor + playerState.statistics.enemyUnitsKilled[type] + '[/color]';
     169    }
    163170}
    164171
    165172function calculateResources(playerState, position)
  • binaries/data/mods/public/gui/summary/layout.js

    diff --git a/binaries/data/mods/public/gui/summary/layout.js b/binaries/data/mods/public/gui/summary/layout.js
    index 9ed33b9..f8dcac7 100644
    a b var g_ScorePanelsData = [  
    5353            { "caption": translate("Champion"), "yStart": 34, "width": 100 },
    5454            { "caption": translate("Heroes"), "yStart": 34, "width": 100 },
    5555            { "caption": translate("Navy"), "yStart": 34, "width": 100 },
    56             { "caption": translate("Traders"), "yStart": 34, "width": 100 }
     56            { "caption": translate("Traders"), "yStart": 34, "width": 100 },
     57            { "caption": translate("Animals"), "yStart": 34, "width": 100 }
    5758        ],
    5859        "titleHeadings": [
    59             { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 7 + 120) }, // width = 820
     60            { "caption": translate("Units Statistics (Trained / Lost / Killed)"), "yStart": 16, "width": (100 * 8 + 120) }, // width = 920
    6061        ],
    6162        "counters": [   // counters on units panel
    6263            { "width": 120, "fn": calculateUnits },
    var g_ScorePanelsData = [  
    6667            { "width": 100, "fn": calculateUnits },
    6768            { "width": 100, "fn": calculateUnits },
    6869            { "width": 100, "fn": calculateUnits },
     70            { "width": 100, "fn": calculateUnits },
    6971            { "width": 100, "fn": calculateUnits }
    7072        ],
    7173        "teamCounterFn": calculateColorsTeam
  • binaries/data/mods/public/gui/summary/summary.js

    diff --git a/binaries/data/mods/public/gui/summary/summary.js b/binaries/data/mods/public/gui/summary/summary.js
    index d1bf648..d2d81bc 100644
    a b  
    1 const g_MaxHeadingTitle= 8;
     1const g_MaxHeadingTitle= 9;
    22
    33// const for filtering long collective headings
    44const g_LongHeadingWidth = 250;
    const g_LostColor = '[color="255 213 213"]';  
    1818const g_KilledColor = '[color="196 198 255"]';
    1919
    2020const g_BuildingsTypes = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ];
    21 const g_UnitsTypes = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship", "Trader" ];
     21const g_UnitsTypes = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship", "Trader", "Animal" ];
    2222const g_ResourcesTypes = [ "food", "wood", "stone", "metal" ];
    2323
    2424// Colors used for gathered and traded resources
  • binaries/data/mods/public/gui/summary/summary.xml

    diff --git a/binaries/data/mods/public/gui/summary/summary.xml b/binaries/data/mods/public/gui/summary/summary.xml
    index 8178571..21d6e87 100644
    a b  
    106106                <object name="playerNameHeading" type="text" style="ModernLeftTabLabelText">
    107107                    <translatableAttribute id="caption">Player name</translatableAttribute>
    108108                </object>
    109                 <repeat var="x" count="8">
     109                <repeat var="x" count="9">
    110110                    <object name="titleHeading[x]" type="text" style="ModernTabLabelText">
    111111                    </object>
    112112                </repeat>
    113                 <repeat var="x" count="8">
     113                <repeat var="x" count="9">
    114114                    <object name="Heading[x]" type="text" style="ModernTabLabelText">
    115115                    </object>
    116116                </repeat>
     
    120120                <object type="image" name="teamBoxt[i]" size="0 65 100% 100%-50" hidden="true">
    121121                    <object type="text" name="teamNameHeadingt[i]" size="15 5 100% 100%" style="ModernLeftTabLabelText"/>
    122122                    <object size="0 30 100% 100%">
    123                         <repeat count="8" var="n">
     123                        <repeat count="9" var="n">
    124124                            <object type="image" name="playerBoxt[i][n]" size="10 0 10 30" hidden="true">
    125125                                <object name="playerColorBoxt[i][n]" type="image" size="10 4 30 24"/>
    126126                                <object name="playerNamet[i][n]" type="text"  size="40 2 208 100%" style="ModernLeftLabelText" />
    127127                                <object name="civIcont[i][n]" type="image" size="208 0 240 32"/>
    128                                 <repeat var="x" count="8">
     128                                <repeat var="x" count="9">
    129129                                    <object name="valueDataTeam[i][n][x]" type="text" style="ModernTabLabelText">
    130130                                    </object>
    131131                                </repeat>
     
    133133                        </repeat>
    134134                    </object>
    135135                    <object name="teamHeadingt[i]" type="text" style="ModernLeftTabLabelText"/>
    136                     <repeat var="x" count="8">
     136                    <repeat var="x" count="9">
    137137                        <object name="valueDataTeam[i][x]" type="text" style="ModernTabLabelText">
    138138                        </object>
    139139                    </repeat>
     
    141141            </repeat>
    142142
    143143            <object type="image" name="noTeamsBox" size="0 65 100% 100%-50" hidden="true">
    144                 <repeat count="8">
     144                <repeat count="9">
    145145                    <object type="image" name="playerBox[n]" size="10 0 10 30" hidden="true">
    146146                        <object type="image" sprite="ForegroundBox" size="10 4 34 28">
    147147                            <object name="playerColorBox[n]" type="image" size="2 2 22 22"/>
    148148                        </object>
    149149                        <object name="playerName[n]" type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
    150150                        <object name="civIcon[n]" type="image" size="208 0 240 32"/>
    151                         <repeat var="x" count="8">
     151                        <repeat var="x" count="9">
    152152                            <object name="valueData[n][x]" type="text" style="ModernTabLabelText">
    153153                            </object>
    154154                        </repeat>
  • binaries/data/mods/public/simulation/components/StatisticsTracker.js

    diff --git a/binaries/data/mods/public/simulation/components/StatisticsTracker.js b/binaries/data/mods/public/simulation/components/StatisticsTracker.js
    index 9b8e7ce..59355f0 100644
    a b StatisticsTracker.prototype.Init = function()  
    1414        "Champion",
    1515        "Hero",
    1616        "Ship",
    17         "Trader"
     17        "Trader",
     18        "Animal"
    1819    ]; 
    1920    this.unitsTrained = {
    2021        "Infantry": 0,
    StatisticsTracker.prototype.Init = function()  
    2526        "Hero": 0,
    2627        "Ship": 0,
    2728        "Trader": 0,
     29        "Animal": 0,
    2830        "total": 0
    2931    };
    3032    this.unitsLost = {
    StatisticsTracker.prototype.Init = function()  
    3638        "Hero": 0,
    3739        "Ship": 0,
    3840        "Trader": 0,
     41        "Animal": 0,
    3942        "total": 0
    4043    };
    4144    this.unitsLostValue = 0;
    StatisticsTracker.prototype.Init = function()  
    4851        "Hero": 0,
    4952        "Ship": 0,
    5053        "Trader": 0,
     54        "Animal": 0,
    5155        "total": 0
    5256    };
    5357    this.enemyUnitsKilledValue = 0;