From bd2c0e3b1758edc9b28a110dc7f97c369c6bb068 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Sat, 14 Dec 2024 19:01:11 +0100 Subject: [PATCH] sc(2) adjustGameStandingsColumns --- .../game_summary_starcraft_ffa.lua | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/components/match2/commons/starcraft_starcraft2/game_summary_starcraft_ffa.lua b/components/match2/commons/starcraft_starcraft2/game_summary_starcraft_ffa.lua index 3d8c7a45b7..2db433d792 100644 --- a/components/match2/commons/starcraft_starcraft2/game_summary_starcraft_ffa.lua +++ b/components/match2/commons/starcraft_starcraft2/game_summary_starcraft_ffa.lua @@ -8,7 +8,9 @@ local CustomGameSummary = {} +local Array = require('Module:Array') local Lua = require('Module:Lua') +local Table = require('Module:Table') local MatchGroupUtil = Lua.import('Module:MatchGroup/Util/Starcraft') @@ -24,6 +26,7 @@ function CustomGameSummary.getGameByMatchId(props) assert(game, 'Error Game ID ' .. tostring(props.gameIdx) .. ' not found') game.stream = match.stream + game.noScore = match.noScore SummaryHelper.updateGameOpponents(game, match.opponents) @@ -32,9 +35,24 @@ function CustomGameSummary.getGameByMatchId(props) idx = props.gameIdx, children = { MatchSummaryWidgets.GameDetails{game = game}, - SummaryHelper.standardGame(game) + SummaryHelper.standardGame(game, CustomGameSummary) } } end +---@param columns table[] +---@param game table +---@return table[] +function CustomGameSummary.adjustGameStandingsColumns(columns, game) + return Array.map(columns, function(column) + if column.id == 'totalPoints' and game.noScore then + return + elseif column.id == 'placements' or column.id == 'kills' then + return + end + + return column + end) +end + return CustomGameSummary