Ticket #3216: 3216.6.patch

File 3216.6.patch, 5.5 KB (added by maveric, 9 years ago)
  • public/gui/summary/counters.js

     
    2727function calculateMilitaryScore(playerState, position)
    2828{
    2929    return Math.round((playerState.statistics.enemyUnitsKilledValue +
    30         playerState.statistics.enemyBuildingsDestroyedValue) / 10);
     30        playerState.statistics.enemyBuildingsDestroyedValue +
     31        playerState.statistics.buildingsCapturedValue) / 10);
    3132}
    3233
    3334function calculateExplorationScore(playerState, position)
     
    6364function calculateBuildings(playerState, position)
    6465{
    6566    var type = BUILDINGS_TYPES[position];
    66     return TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' +
    67     LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color] / ' +
    68     KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]';
     67    return '   ' + TRAINED_COLOR + playerState.statistics.buildingsConstructed[type] + '[/color] / ' +
     68    KILLED_COLOR + playerState.statistics.enemyBuildingsDestroyed[type] + '[/color]\n' +
     69    CAPTURED_COLOR + playerState.statistics.buildingsCaptured[type] + '[/color] / ' +
     70    LOST_COLOR + playerState.statistics.buildingsLost[type] + '[/color]';
    6971}
    7072
    7173function calculateColorsTeam(counters)
  • public/gui/summary/layout.js

     
    2929            { "caption": translate("Wonders"), "yStart": 34, "width": 85 }
    3030        ],
    3131        "titleHeadings": [
    32             { "caption": translate("Buildings Statistics (Constructed / Lost / Destroyed)"), "yStart": 16, "width": (85 * 7 + 105) },   // width = 735
     32            { "caption": translate("Buildings Statistics") + ' (' +
     33                                            '[color="201 255 200"]' + translate("Constructed") + '[/color]' +
     34                                    ' / ' + '[color="196 198 255"]' + translate("Destroyed") + '[/color]' +
     35                                    ' / ' + '[color="255 255 157"]' + translate("Captured") + '[/color]' +
     36                                    ' / ' + '[color="255 213 213"]' + translate("Lost") + '[/color]' + ')',
     37              "yStart": 16, "width": (85 * 7 + 105)
     38            },  // width = 735
    3339        ],
    3440        "counters": [   // counters on buildings panel
    3541            {"width": 105, "fn": calculateBuildings},
     
    189195{
    190196    var rowPlayerObjectWidth = 0;
    191197    var left = 0;
     198   
     199    if (panelsData[1].counters == counters) //for buildings panel
     200        var verticalOffset = 3;
     201    else
     202        var verticalOffset = 12;
     203       
    192204    for (var p = 0; p < MAX_SLOTS; ++p)
    193205    {
    194206        left = 240;
     
    196208        for (var w in counters)
    197209        {
    198210            counterObject = Engine.GetGUIObjectByName("valueData[" + p + "][" + w + "]");
    199             counterObject.size = left + " 6 " + (left + counters[w].width) + " 100%";
     211            counterObject.size = left + " " + verticalOffset + " " + (left + counters[w].width) + " 100%";
    200212            counterObject.hidden = false;
    201213            left += counters[w].width;
    202214        }
  • public/gui/summary/summary.js

     
    66// const for filtering long collective headings
    77const LONG_HEADING_WIDTH = 250;
    88// vertical size of player box
    9 const PLAYER_BOX_Y_SIZE = 30;
     9const PLAYER_BOX_Y_SIZE = 40;
    1010// gap between players boxes
    1111const PLAYER_BOX_GAP = 2;
    1212// alpha for player box
     
    1919const TRAINED_COLOR = '[color="201 255 200"]';
    2020const LOST_COLOR = '[color="255 213 213"]';
    2121const KILLED_COLOR = '[color="196 198 255"]';
     22const CAPTURED_COLOR = '[color="255 255 157"]';
    2223
    2324const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ];
    2425const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ];
  • public/gui/summary/summary.xml

     
    140140            <object type="image" name="noTeamsBox" size="0 65 100% 100%-50" hidden="true">
    141141                <repeat count="8">
    142142                    <object type="image" name="playerBox[n]" size="10 0 10 30" hidden="true">
    143                         <object type="image" sprite="ForegroundBox" size="10 4 34 28">
     143                        <object type="image" sprite="ForegroundBox" size="10 9 34 33">
    144144                            <object name="playerColorBox[n]" type="image" size="2 2 22 22"/>
    145145                        </object>
    146146                        <object name="playerName[n]" type="text"  size="40 2 208 100%" style="ModernLeftLabelText"/>
    147                         <object name="civIcon[n]" type="image" size="208 0 240 32"/>
     147                        <object name="civIcon[n]" type="image" size="208 5 240 37"/>
    148148                        <repeat var="x" count="8">
    149149                            <object name="valueData[n][x]" type="text" style="ModernTabLabelText">
    150150                            </object>
  • public/simulation/components/Capturable.js

     
    103103    for (let i in this.cp)
    104104        if (this.cp[i] >= this.cp[bestPlayer])
    105105            bestPlayer = +i;
    106 
     106   
     107    var cmpLostPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker);
     108    if (cmpLostPlayerStatisticsTracker)
     109    {
     110        cmpLostPlayerStatisticsTracker.LostEntity(this.entity);
     111        cmpLostPlayerStatisticsTracker.CapturedBuilding(this.entity);
     112    }
    107113    cmpOwnership.SetOwner(bestPlayer);
    108114
    109115    return takenCp;