Ticket #3518: ticket3518_summarystyle_3.1.diff
File ticket3518_summarystyle_3.1.diff, 1.7 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/summary/counters.js
18 18 function calculateEconomyScore(playerState, position) 19 19 { 20 20 let total = 0; 21 for each (let resin playerState.statistics.resourcesGathered)22 total += res;21 for (let type in playerState.statistics.resourcesGathered) 22 total += playerState.statistics.resourcesGathered[type]; 23 23 24 24 return Math.round(total / 10); 25 25 } … … 202 202 function calculateBatteryEfficiency(playerState, position) 203 203 { 204 204 let totalBought = 0; 205 for each (let boughtAmount in playerState.statistics.resourcesBought)206 totalBought += boughtAmount;207 205 let totalSold = 0; 208 for each (let soldAmount in playerState.statistics.resourcesSold) 209 totalSold += soldAmount; 206 for (let boughtAmount in playerState.statistics.resourcesBought) 207 totalBought += playerState.statistics.resourcesBought[boughtAmount]; 208 for (let soldAmount in playerState.statistics.resourcesSold) 209 totalSold += playerState.statistics.resourcesSold[soldAmount]; 210 210 211 211 return Math.floor(totalSold > 0 ? (totalBought / totalSold) * 100 : 0) + "%"; 212 212 } … … 366 366 else if (!g_TeamMiscHelperData[t][w].unitsLost) // and enemyUnitsKilled.total > 0 367 367 teamTotal = g_InfiniteSymbol; // infinity symbol 368 368 else 369 teamTotal = Math.round((g_TeamMiscHelperData[t][w].enemyUnitsKilled / g_TeamMiscHelperData[t][w].unitsLost) *100)/100;369 teamTotal = Math.round((g_TeamMiscHelperData[t][w].enemyUnitsKilled / g_TeamMiscHelperData[t][w].unitsLost) * 100) / 100; 370 370 } 371 371 else if (w >= 3) 372 372 teamTotal = g_TeamMiscHelperData[t][w] + "%";