Ticket #3216: t3216_capture_statistics_style.patch

File t3216_capture_statistics_style.patch, 3.3 KB (added by Imarok, 8 years ago)
  • binaries/data/mods/public/gui/summary/counters.js

     
    128128        for (let w in counters)
    129129        {
    130130            let total = {
    131                 "c": 0,
    132                 "l": 0,
    133                 "d": 0
     131                "constructed": 0,
     132                "lost": 0,
     133                "destroyed": 0
    134134            };
    135135
    136136            for (let p = 0; p < g_Teams[t]; ++p)
     
    141141
    142142                let splitCaption = caption.split("/");
    143143
    144                 total.c += (+splitCaption[0]);
    145                 total.l += (+splitCaption[1]);
    146                 total.d += (+splitCaption[2]);
     144                total.constructed += (+splitCaption[0]);
     145                total.lost += (+splitCaption[1]);
     146                total.destroyed += (+splitCaption[2]);
    147147            }
    148148
    149             let teamTotal = g_TrainedColor + total.c + '[/color] / ' +
    150                 g_LostColor + total.l + '[/color] / ' + g_KilledColor + total.d + '[/color]';
     149            let teamTotal = g_TrainedColor + total.constructed + '[/color] / ' +
     150                g_LostColor + total.lost + '[/color] / ' + g_KilledColor + total.destroyed + '[/color]';
    151151
    152152            Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
    153153        }
     
    211211            let teamTotal = "undefined";
    212212
    213213            let total = {
    214                 i : 0,
    215                 o : 0
     214                income : 0,
     215                outcome : 0
    216216            };
    217217
    218218            for (let p = 0; p < g_Teams[t]; ++p)
     
    222222                caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s/g, "");
    223223
    224224                if (w >= 6)
    225                     total.i += (+caption);
     225                    total.income += (+caption);
    226226                else
    227227                {
    228228                    let splitCaption = caption.split("/");
    229229
    230                     total.i += (+splitCaption[0]);
    231                     total.o += (+splitCaption[1]);
     230                    total.income += (+splitCaption[0]);
     231                    total.outcome += (+splitCaption[1]);
    232232                }
    233233            }
    234234
    235235            if (w >= 6)
    236                 teamTotal = total.i;
     236                teamTotal = total.income;
    237237            else
    238                 teamTotal = g_IncomeColor + total.i + "[/color] / " + g_OutcomeColor + total.o + "[/color]";
     238                teamTotal = g_IncomeColor + total.income + "[/color] / " + g_OutcomeColor + total.outcome + "[/color]";
    239239
    240240            Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
    241241        }
     
    280280            let teamTotal = "undefined";
    281281
    282282            let total = {
    283                 "i": 0,
    284                 "o": 0
     283                "income": 0,
     284                "outcome": 0
    285285            };
    286286
    287287            for (let p = 0; p < g_Teams[t]; ++p)
     
    291291                caption = caption.replace(/\[([\w\' \\\"\/\=]*)\]|\s|\+|\%/g, "");
    292292
    293293                if (w >= 4)
    294                     total.i += (+caption);
     294                    total.income += (+caption);
    295295                else
    296296                {
    297297                    let splitCaption = caption.split("-");
    298                     total.i += (+splitCaption[0]);
    299                     total.o += (+splitCaption[1]);
     298                    total.income += (+splitCaption[0]);
     299                    total.outcome += (+splitCaption[1]);
    300300                }
    301301            }
    302302
     
    303303            if (w == 4)
    304304                teamTotal = Math.floor(g_TeamHelperData[t].totalSold > 0 ? (g_TeamHelperData[t].totalBought / g_TeamHelperData[t].totalSold) * 100 : 0) + "%"
    305305            else if (w > 4)
    306                 teamTotal = total.i;
     306                teamTotal = total.income;
    307307            else
    308                 teamTotal = g_IncomeColor + '+' + total.i + '[/color] ' + g_OutcomeColor + '-' + total.o + '[/color]';
     308                teamTotal = g_IncomeColor + '+' + total.income + '[/color] ' + g_OutcomeColor + '-' + total.outcome + '[/color]';
    309309
    310310            Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]").caption = teamTotal;
    311311        }