From 9145e03bf5babe9a03a130e2b9ecb67917cdc38f Mon Sep 17 00:00:00 2001 From: Freagarach Date: Thu, 21 Jan 2021 17:12:56 +0000 Subject: [PATCH] Fix values of miscellaneous summary tab shifted. Introduced in 57d0e7bd96. Caused by incomplete filtering. Differential revision: D3340 Fixes: #5946 Reviewed by: @wraitii Tested by: @Langbart Comment by: @toonijn Suggestions from: @Imarok This was SVN commit r24754. --- binaries/data/mods/public/gui/summary/counters.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/gui/summary/counters.js b/binaries/data/mods/public/gui/summary/counters.js index 900bab995d..446bcb62b0 100644 --- a/binaries/data/mods/public/gui/summary/counters.js +++ b/binaries/data/mods/public/gui/summary/counters.js @@ -30,8 +30,10 @@ function getPlayerValuesPerTeam(team, index, type, counters, headings) return g_Teams[team].map(player => fn(g_GameData.sim.playerStates[player], index, type)); } -function updateCountersPlayer(playerState, counters, headings, idGUI, index) +function updateCountersPlayer(playerState, allCounters, allHeadings, idGUI, index) { + let counters = allCounters.filter(counter => !counter.hideInSummary); + let headings = allHeadings.filter(heading => !heading.hideInSummary); for (let n in counters) { let fn = counters[n].fn; @@ -40,8 +42,10 @@ function updateCountersPlayer(playerState, counters, headings, idGUI, index) } } -function updateCountersTeam(teamFn, counters, headings, index) +function updateCountersTeam(teamFn, allCounters, allHeadings, index) { + let counters = allCounters.filter(counter => !counter.hideInSummary); + let headings = allHeadings.filter(heading => !heading.hideInSummary); for (let team in g_Teams) { if (team == -1)