Ticket #3216: 3216.5.patch
File 3216.5.patch, 7.8 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/summary/counters.js
27 27 function calculateMilitaryScore(playerState, position) 28 28 { 29 29 return Math.round((playerState.statistics.enemyUnitsKilledValue + 30 playerState.statistics.enemyBuildingsDestroyedValue) / 10); 30 playerState.statistics.enemyBuildingsDestroyedValue + 31 playerState.statistics.buildingsCapturedValue) / 10); 31 32 } 32 33 33 34 function calculateExplorationScore(playerState, position) … … 63 64 function calculateBuildings(playerState, position) 64 65 { 65 66 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]'; 69 71 } 70 72 71 73 function calculateColorsTeam(counters) -
binaries/data/mods/public/gui/summary/layout.js
29 29 { "caption": translate("Wonders"), "yStart": 34, "width": 85 } 30 30 ], 31 31 "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 33 39 ], 34 40 "counters": [ // counters on buildings panel 35 41 {"width": 105, "fn": calculateBuildings}, … … 189 195 { 190 196 var rowPlayerObjectWidth = 0; 191 197 var left = 0; 198 199 if (panelsData[1].counters == counters) //for buildings panel 200 var verticalOffset = 3; 201 else 202 var verticalOffset = 12; 203 192 204 for (var p = 0; p < MAX_SLOTS; ++p) 193 205 { 194 206 left = 240; … … 196 208 for (var w in counters) 197 209 { 198 210 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%"; 200 212 counterObject.hidden = false; 201 213 left += counters[w].width; 202 214 } -
binaries/data/mods/public/gui/summary/summary.js
6 6 // const for filtering long collective headings 7 7 const LONG_HEADING_WIDTH = 250; 8 8 // vertical size of player box 9 const PLAYER_BOX_Y_SIZE = 30;9 const PLAYER_BOX_Y_SIZE = 40; 10 10 // gap between players boxes 11 11 const PLAYER_BOX_GAP = 2; 12 12 // alpha for player box … … 19 19 const TRAINED_COLOR = '[color="201 255 200"]'; 20 20 const LOST_COLOR = '[color="255 213 213"]'; 21 21 const KILLED_COLOR = '[color="196 198 255"]'; 22 const CAPTURED_COLOR = '[color="255 255 157"]'; 22 23 23 24 const BUILDINGS_TYPES = [ "total", "House", "Economic", "Outpost", "Military", "Fortress", "CivCentre", "Wonder" ]; 24 25 const UNITS_TYPES = [ "total", "Infantry", "Worker", "Cavalry", "Champion", "Hero", "Ship" ]; -
binaries/data/mods/public/gui/summary/summary.xml
140 140 <object type="image" name="noTeamsBox" size="0 65 100% 100%-50" hidden="true"> 141 141 <repeat count="8"> 142 142 <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"> 144 144 <object name="playerColorBox[n]" type="image" size="2 2 22 22"/> 145 145 </object> 146 146 <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"/> 148 148 <repeat var="x" count="8"> 149 149 <object name="valueData[n][x]" type="text" style="ModernTabLabelText"> 150 150 </object> -
binaries/data/mods/public/simulation/components/Capturable.js
103 103 for (let i in this.cp) 104 104 if (this.cp[i] >= this.cp[bestPlayer]) 105 105 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 } 107 113 cmpOwnership.SetOwner(bestPlayer); 108 114 109 115 return takenCp; -
binaries/data/mods/public/simulation/components/StatisticsTracker.js
76 76 "CivCentre": 0, 77 77 "Wonder": 0, 78 78 "total": 0 79 79 }; 80 80 this.buildingsLostValue = 0; 81 81 this.enemyBuildingsDestroyed = { 82 82 "House": 0, … … 87 87 "CivCentre": 0, 88 88 "Wonder": 0, 89 89 "total": 0 90 }; 91 this.enemyBuildingsDestroyedValue = 0; 90 }; 91 this.enemyBuildingsDestroyedValue = 0; 92 this.buildingsCaptured = { 93 "House": 0, 94 "Economic": 0, 95 "Outpost": 0, 96 "Military": 0, 97 "Fortress": 0, 98 "CivCentre": 0, 99 "Wonder": 0, 100 "total": 0 101 }; 102 this.buildingsCapturedValue = 0; 92 103 // resources 93 104 this.resourcesGathered = { 94 105 "food": 0, … … 149 160 "buildingsLost": this.buildingsLost, 150 161 "buildingsLostValue": this.buildingsLostValue, 151 162 "enemyBuildingsDestroyed": this.enemyBuildingsDestroyed, 152 "enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue, 163 "enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue, 164 "buildingsCaptured": this.buildingsCaptured, 165 "buildingsCapturedValue": this.buildingsCapturedValue, 153 166 "resourcesGathered": this.resourcesGathered, 154 167 "resourcesUsed": this.resourcesUsed, 155 168 "resourcesSold": this.resourcesSold, … … 292 305 for each (var cost in costs) 293 306 this.buildingsLostValue += cost; 294 307 } 308 }; 309 310 StatisticsTracker.prototype.CapturedBuilding = function(capturedBuilding) 311 { 312 var cmpCapturedBuildingIdentity = Engine.QueryInterface(capturedBuilding, IID_Identity); 313 var cmpCost = Engine.QueryInterface(capturedBuilding, IID_Cost); 314 var costs = cmpCost.GetResourceCosts(); 315 316 for each (var type in this.buildingsClasses) 317 this.CounterIncrement(cmpCapturedBuildingIdentity, "buildingsCaptured", type); 318 319 this.buildingsCaptured.total++; 320 321 for each (var cost in costs) 322 this.buildingsCapturedValue += cost; 295 323 }; 296 324 297 325 /**