Ticket #3518: ticket3518_summarystyle_3.diff
File ticket3518_summarystyle_3.diff, 9.1 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 } … … 119 119 g_OutcomeColor + (playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type]) + '[/color]'; 120 120 } 121 121 122 function calculateTotalResources(playerState, position)123 {124 let totalGathered = 0;125 let totalUsed = 0;126 127 for each (let type in g_ResourcesTypes)128 {129 totalGathered += playerState.statistics.resourcesGathered[type];130 totalUsed += playerState.statistics.resourcesUsed[type] - playerState.statistics.resourcesSold[type];131 }132 133 return g_IncomeColor + totalGathered + '[/color] / ' + g_OutcomeColor + totalUsed + '[/color]';134 }135 136 122 function calculateTreasureCollected(playerState, position) 137 123 { 138 124 return playerState.statistics.treasuresCollected; … … 202 188 function calculateBatteryEfficiency(playerState, position) 203 189 { 204 190 let totalBought = 0; 205 for each (let boughtAmount in playerState.statistics.resourcesBought)206 totalBought += boughtAmount;207 191 let totalSold = 0; 208 for each (let soldAmount in playerState.statistics.resourcesSold) 209 totalSold += soldAmount; 192 for (let boughtAmount in playerState.statistics.resourcesBought) 193 totalBought += playerState.statistics.resourcesBought[boughtAmount]; 194 for (let soldAmount in playerState.statistics.resourcesSold) 195 totalSold += playerState.statistics.resourcesSold[soldAmount]; 210 196 211 197 return Math.floor(totalSold > 0 ? (totalBought / totalSold) * 100 : 0) + "%"; 212 198 } … … 366 352 else if (!g_TeamMiscHelperData[t][w].unitsLost) // and enemyUnitsKilled.total > 0 367 353 teamTotal = g_InfiniteSymbol; // infinity symbol 368 354 else 369 teamTotal = Math.round((g_TeamMiscHelperData[t][w].enemyUnitsKilled / g_TeamMiscHelperData[t][w].unitsLost) *100)/100;355 teamTotal = Math.round((g_TeamMiscHelperData[t][w].enemyUnitsKilled / g_TeamMiscHelperData[t][w].unitsLost) * 100) / 100; 370 356 } 371 357 else if (w >= 3) 372 358 teamTotal = g_TeamMiscHelperData[t][w] + "%"; -
binaries/data/mods/public/gui/summary/layout.js
90 90 { "width": 100, "fn": calculateResources }, 91 91 { "width": 100, "fn": calculateResources }, 92 92 { "width": 100, "fn": calculateResources }, 93 { "width": 110, "fn": calculate TotalResources },93 { "width": 110, "fn": calculateResources }, 94 94 { "width": 121, "fn": calculateTributeSent }, 95 95 { "width": 100, "fn": calculateTreasureCollected }, 96 96 { "width": 100, "fn": calculateLootCollected } -
binaries/data/mods/public/gui/summary/summary.js
19 19 20 20 const g_BuildingsTypes = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ]; 21 21 const g_UnitsTypes = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship", "Trader" ]; 22 const g_ResourcesTypes = [ "food", "wood", "stone", "metal" ];22 const g_ResourcesTypes = [ "food", "wood", "stone", "metal", "total" ]; 23 23 24 24 // Colors used for gathered and traded resources 25 25 const g_IncomeColor = '[color="201 255 200"]'; -
binaries/data/mods/public/simulation/components/StatisticsTracker.js
Engine.RegisterComponentType(IID_Repairable, "Repairable", Repairable);
99 99 "wood": 0, 100 100 "metal": 0, 101 101 "stone": 0, 102 "total": 0, 102 103 "vegetarianFood": 0 103 104 }; 104 105 this.resourcesUsed = { … … 105 106 "food": 0, 106 107 "wood": 0, 107 108 "metal": 0, 108 "stone": 0 109 "stone": 0, 110 "total": 0 109 111 }; 110 112 this.resourcesSold = { 111 113 "food": 0, 112 114 "wood": 0, 113 115 "metal": 0, 114 "stone": 0 116 "stone": 0, 117 "total": 0 115 118 }; 116 119 this.resourcesBought = { 117 120 "food": 0, … … 314 317 StatisticsTracker.prototype.IncreaseResourceGatheredCounter = function(type, amount, specificType) 315 318 { 316 319 this.resourcesGathered[type] += amount; 320 this.resourcesGathered.total += amount; 317 321 318 322 if (type == "food" && (specificType == "fruit" || specificType == "grain")) 319 323 this.resourcesGathered.vegetarianFood += amount; … … 326 330 StatisticsTracker.prototype.IncreaseResourceUsedCounter = function(type, amount) 327 331 { 328 332 this.resourcesUsed[type] += amount; 333 this.resourcesUsed.total += amount; 329 334 }; 330 335 331 336 StatisticsTracker.prototype.IncreaseTreasuresCollectedCounter = function() -
binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
109 109 "resourcesGathered": { 110 110 "food": 100, 111 111 "wood": 0, 112 "metal": 0,113 112 "stone": 0, 113 "metal": 0, 114 "total": 0, 114 115 "vegetarianFood": 0, 115 116 }, 116 117 "percentMapExplored": 10 … … 126 127 "resourcesGathered": { 127 128 "food": 100, 128 129 "wood": 0, 129 "metal": 0,130 130 "stone": 0, 131 "metal": 0, 132 "total": 0, 131 133 "vegetarianFood": 0, 132 134 }, 133 135 "treasuresCollected": 0, … … 189 191 "resourcesGathered": { 190 192 "food": 100, 191 193 "wood": 0, 194 "stone": 0, 192 195 "metal": 0, 193 " stone": 0,196 "total": 0, 194 197 "vegetarianFood": 0, 195 198 }, 196 199 "percentMapExplored": 10 … … 206 209 "resourcesGathered": { 207 210 "food": 100, 208 211 "wood": 0, 209 "metal": 0,210 212 "stone": 0, 213 "metal": 0, 214 "total": 0, 211 215 "vegetarianFood": 0, 212 216 }, 213 217 "treasuresCollected": 0, … … 262 266 resourcesGathered: { 263 267 food: 100, 264 268 wood: 0, 269 stone: 0, 265 270 metal: 0, 266 stone: 0,271 total: 0, 267 272 vegetarianFood: 0, 268 273 }, 269 274 percentMapExplored: 10 … … 301 306 resourcesGathered: { 302 307 food: 100, 303 308 wood: 0, 309 stone: 0, 304 310 metal: 0, 305 stone: 0,311 total: 0, 306 312 vegetarianFood: 0, 307 313 }, 308 314 percentMapExplored: 10 … … 354 360 resourcesGathered: { 355 361 food: 100, 356 362 wood: 0, 363 stone: 0, 357 364 metal: 0, 358 stone: 0,365 total: 0, 359 366 vegetarianFood: 0, 360 367 }, 361 368 treasuresCollected: 0, … … 405 412 resourcesGathered: { 406 413 food: 100, 407 414 wood: 0, 415 stone: 0, 408 416 metal: 0, 409 stone: 0,417 total: 0, 410 418 vegetarianFood: 0, 411 419 }, 412 420 treasuresCollected: 0, -
source/tools/XpartaMuPP/LobbyRanking.py
1 1 #!/usr/bin/env python3 2 2 # -*- coding: utf-8 -*- 3 """Copyright (C) 201 3Wildfire Games.3 """Copyright (C) 2015 Wildfire Games. 4 4 * This file is part of 0 A.D. 5 5 * 6 6 * 0 A.D. is free software: you can redistribute it and/or modify … … 59 59 stoneUsed = Column(Integer) 60 60 metalGathered = Column(Integer) 61 61 metalUsed = Column(Integer) 62 totalGathered = Column(Integer) 63 totalUsed = Column(Integer) 62 64 vegetarianFoodGathered = Column(Integer) 63 65 treasuresCollected = Column(Integer) 64 66 lootCollected = Column(Integer) -
source/tools/XpartaMuPP/XpartaMuPP.py
1 1 #!/usr/bin/env python3 2 2 # -*- coding: utf-8 -*- 3 """Copyright (C) 201 4Wildfire Games.3 """Copyright (C) 2015 Wildfire Games. 4 4 * This file is part of 0 A.D. 5 5 * 6 6 * 0 A.D. is free software: you can redistribute it and/or modify … … 121 121 singleStats = {'timeElapsed', 'mapName', 'teamsLocked', 'matchID'} 122 122 totalScoreStats = {'economyScore', 'militaryScore', 'totalScore'} 123 123 resourceStats = {'foodGathered', 'foodUsed', 'woodGathered', 'woodUsed', 124 'stoneGathered', 'stoneUsed', 'metalGathered', 'metalUsed', ' vegetarianFoodGathered',124 'stoneGathered', 'stoneUsed', 'metalGathered', 'metalUsed', 'totalGathered', 'totalUsed', 'vegetarianFoodGathered', 125 125 'treasuresCollected', 'lootCollected', 'tributesSent', 'tributesReceived'} 126 126 unitsStats = {'totalUnitsTrained', 'totalUnitsLost', 'enemytotalUnitsKilled', 'infantryUnitsTrained', 127 127 'infantryUnitsLost', 'enemyInfantryUnitsKilled', 'workerUnitsTrained', 'workerUnitsLost',