Index: ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json +++ ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json @@ -251,6 +251,7 @@ { "nick": "thamlett", "name": "Timothy Hamlett" }, { "nick": "thedrunkyak", "name": "Dan Fuhr" }, { "nick": "Tobbi" }, + { "nick": "Toonijn", "name": "Toon Baeyens" }, { "nick": "TrinityDeath", "name": "Jethro Lu" }, { "nick": "triumvir", "name": "Corin Schedler" }, { "nick": "trompetin17", "name": "Juan Guillermo" }, Index: ps/trunk/binaries/data/mods/public/gui/summary/counters.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/summary/counters.js +++ ps/trunk/binaries/data/mods/public/gui/summary/counters.js @@ -17,9 +17,10 @@ let ret = ""; for (let type in values) - ret += (g_SummaryTypes[type].color ? - coloredText(values[type], g_SummaryTypes[type].color) : - values[type]) + g_SummaryTypes[type].postfix; + if (!g_SummaryTypes[type].hideInSummary) + ret += (g_SummaryTypes[type].color ? + coloredText(values[type], g_SummaryTypes[type].color) : + values[type]) + g_SummaryTypes[type].postfix; return ret; } @@ -157,7 +158,7 @@ /** * Keep this in sync with the score computation in session/ for the lobby rating reports! */ - function calculateScoreTotal(playerState, index) +function calculateScoreTotal(playerState, index) { return calculateEconomyScore(playerState, index) + calculateMilitaryScore(playerState, index) + @@ -218,6 +219,7 @@ function calculateResources(playerState, index, type) { return { + "count": playerState.sequences.resourcesCount[type][index], "gathered": playerState.sequences.resourcesGathered[type][index], "used": playerState.sequences.resourcesUsed[type][index] - playerState.sequences.resourcesSold[type][index] }; @@ -227,14 +229,16 @@ { let totalGathered = 0; let totalUsed = 0; + let totalCount = 0; for (let type of g_ResourceData.GetCodes()) { + totalCount += playerState.sequences.resourcesCount[type][index]; totalGathered += playerState.sequences.resourcesGathered[type][index]; totalUsed += playerState.sequences.resourcesUsed[type][index] - playerState.sequences.resourcesSold[type][index]; } - return { "gathered": totalGathered, "used": totalUsed }; + return { "count": totalCount, "gathered": totalGathered, "used": totalUsed }; } function calculateTreasureCollected(playerState, index) @@ -321,6 +325,11 @@ playerState.sequences.unitsLost.total[index]); } +function calculatePopulationCount(playerState, index) +{ + return { "population": playerState.sequences.populationCount[index] }; +} + function calculateMapExploration(playerState, index) { return { "percent": playerState.sequences.percentMapExplored[index] }; Index: ps/trunk/binaries/data/mods/public/gui/summary/layout.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/summary/layout.js +++ ps/trunk/binaries/data/mods/public/gui/summary/layout.js @@ -193,6 +193,7 @@ "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, { "identifier": "killDeath", "caption": translate("Kill / Death ratio"), "yStart": 16, "width": 100, "format": "DECIMAL2" }, + { "identifier": "population", "caption": translate("Population"), "yStart": 16, "width": 100, "hideInSummary": true }, { "identifier": "mapControlPeak", "caption": translate("Map control (peak)"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, { "identifier": "mapControl", "caption": translate("Map control (finish)"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, { "identifier": "mapExploration", "caption": translate("Map exploration"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, @@ -213,6 +214,7 @@ "titleHeadings": [], "counters": [ { "width": 100, "fn": calculateKillDeathRatio, "verticalOffset": 12 }, + { "width": 100, "fn": calculatePopulationCount, "verticalOffset": 12, "hideInSummary": true }, { "width": 100, "fn": calculateMapPeakControl, "verticalOffset": 12 }, { "width": 100, "fn": calculateMapFinalControl, "verticalOffset": 12 }, { "width": 100, "fn": calculateMapExploration, "verticalOffset": 12 }, @@ -255,8 +257,10 @@ } } -function updateGeneralPanelHeadings(headings) +function updateGeneralPanelHeadings(allHeadings) { + let headings = allHeadings.filter(heading => !heading.hideInSummary); + let left = 50; for (let h in headings) { @@ -295,8 +299,9 @@ } } -function updateGeneralPanelCounter(counters) +function updateGeneralPanelCounter(allCounters) { + let counters = allCounters.filter(counter => !counter.hideInSummary); let rowPlayerObjectWidth = 0; let left = 0; Index: ps/trunk/binaries/data/mods/public/gui/summary/summary.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/summary/summary.js +++ ps/trunk/binaries/data/mods/public/gui/summary/summary.js @@ -40,6 +40,10 @@ "caption": translate("Gathered"), "postfix": " / " }, + "count": { + "caption": translate("Count"), + "hideInSummary": true + }, "sent": { "color": g_TypeColors.green, "caption": translate("Sent"), @@ -90,6 +94,11 @@ "caption": translate("Received"), "postfix": "" }, + "population": { + "color": g_TypeColors.red, + "caption": translate("Population"), + "postfix": "" + }, "sold": { "color": g_TypeColors.red, "caption": translate("Sold"), Index: ps/trunk/binaries/data/mods/public/simulation/components/StatisticsTracker.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/StatisticsTracker.js +++ ps/trunk/binaries/data/mods/public/simulation/components/StatisticsTracker.js @@ -131,6 +131,7 @@ "enemyBuildingsDestroyedValue": this.enemyBuildingsDestroyedValue, "buildingsCaptured": this.buildingsCaptured, "buildingsCapturedValue": this.buildingsCapturedValue, + "resourcesCount": this.GetResourceCounts(), "resourcesGathered": this.resourcesGathered, "resourcesUsed": this.resourcesUsed, "resourcesSold": this.resourcesSold, @@ -140,6 +141,7 @@ "tradeIncome": this.tradeIncome, "treasuresCollected": this.treasuresCollected, "lootCollected": this.lootCollected, + "populationCount": this.GetPopulationCount(), "percentMapExplored": this.GetPercentMapExplored(), "teamPercentMapExplored": this.GetTeamPercentMapExplored(), "percentMapControlled": this.GetPercentMapControlled(), @@ -346,6 +348,17 @@ }; /** + * @return {Object} - The amount of available resources. + */ +StatisticsTracker.prototype.GetResourceCounts = function() +{ + let cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); + return cmpPlayer ? + cmpPlayer.GetResourceCounts() : + Object.fromEntries(Resources.GetCodes().map(res => [res, 0])); +}; + +/** * @param {string} type - generic type of resource. * @param {number} amount - amount of resource, whick should be added. * @param {string} specificType - specific type of resource. @@ -403,6 +416,12 @@ this.tradeIncome += amount; }; +StatisticsTracker.prototype.GetPopulationCount = function() +{ + let cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); + return cmpPlayer ? cmpPlayer.GetPopulationCount() : 0; +}; + StatisticsTracker.prototype.IncreaseSuccessfulBribesCounter = function() { ++this.successfulBribes;