Ticket #3113: total_carried_resources_v1.4.patch
File total_carried_resources_v1.4.patch, 2.4 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/selection_details.js
303 303 let maxCapturePoints = 0; 304 304 let capturePoints = (new Array(9)).fill(0); 305 305 let playerID = 0; 306 let totalResourcesCarried; 306 307 307 308 for (let i = 0; i < selection.length; i++) 308 309 { … … 320 321 maxCapturePoints += entState.maxCapturePoints; 321 322 capturePoints = entState.capturePoints.map((v, i) => v + capturePoints[i]); 322 323 } 324 325 if (entState.resourceCarrying && entState.resourceCarrying.length !== 0) 326 { 327 if (!totalResourcesCarried) 328 totalResourcesCarried = {}; 329 330 let carrying = entState.resourceCarrying[0]; 331 if (totalResourcesCarried[carrying.type]) 332 totalResourcesCarried[carrying.type] += carrying.amount; 333 else 334 totalResourcesCarried[carrying.type] = carrying.amount; 335 } 323 336 } 324 337 325 338 Engine.GetGUIObjectByName("healthMultiple").hidden = averageHealth <= 0; … … 369 382 }); 370 383 } 371 384 372 Engine.GetGUIObjectByName("numberOfUnits").caption = selection.length; 385 let numberOfUnits = Engine.GetGUIObjectByName("numberOfUnits"); 386 numberOfUnits.caption = selection.length; 387 let str = ""; 388 if (totalResourcesCarried) 389 for (let res of RESOURCES) 390 if (totalResourcesCarried[res]) 391 { 392 str += getCostComponentDisplayName(res) + totalResourcesCarried[res] + " "; 393 } 394 numberOfUnits.tooltip = str.substr(0, str.length - 1); 373 395 374 396 // Unhide Details Area 375 397 Engine.GetGUIObjectByName("detailsAreaMultiple").hidden = false; -
binaries/data/mods/public/gui/session/selection_panels_middle/multiple_details_area.xml
19 19 20 20 <!-- Total --> 21 21 <object size="100%-42 12 100%-8 46" type="image" sprite="groupsIcon"> 22 <object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits" />22 <object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits" tooltip_style="sessionToolTipBold"/> 23 23 </object> 24 24 25 25 <!-- Stats Bars -->