Skip to content

Commit

Permalink
sc(2) adjustGameStandingsColumns
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpalpha committed Dec 14, 2024
1 parent 8ba58cd commit bd2c0e3
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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)

Expand All @@ -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

0 comments on commit bd2c0e3

Please sign in to comment.