diff --git a/lua/wikis/apexlegends/MatchSummary.lua b/lua/wikis/apexlegends/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/apexlegends/MatchSummary.lua +++ b/lua/wikis/apexlegends/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/arenafps/MatchSummary.lua b/lua/wikis/arenafps/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/arenafps/MatchSummary.lua +++ b/lua/wikis/arenafps/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/artifact/MatchSummary.lua b/lua/wikis/artifact/MatchSummary.lua index 967d97ba5bb..347e04530d2 100644 --- a/lua/wikis/artifact/MatchSummary.lua +++ b/lua/wikis/artifact/MatchSummary.lua @@ -18,16 +18,15 @@ local IconImage = Lua.import('Module:Widget/Image/Icon/Image') local WidgetUtil = Lua.import('Module:Widget/Util') ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '420px', teamStyle = 'bracket'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local characterData = { (((game.opponents[1] or {}).players or {})[1] or {}).characters, (((game.opponents[2] or {}).players or {})[1] or {}).characters, diff --git a/lua/wikis/autochess/MatchSummary.lua b/lua/wikis/autochess/MatchSummary.lua index 96c64db06b6..2d44dbf49d9 100644 --- a/lua/wikis/autochess/MatchSummary.lua +++ b/lua/wikis/autochess/MatchSummary.lua @@ -14,16 +14,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, children = WidgetUtil.collect( diff --git a/lua/wikis/battalion/MatchSummary.lua b/lua/wikis/battalion/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/battalion/MatchSummary.lua +++ b/lua/wikis/battalion/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/battlerite/MatchSummary.lua b/lua/wikis/battlerite/MatchSummary.lua index a292a2e6f2c..06006776e37 100644 --- a/lua/wikis/battlerite/MatchSummary.lua +++ b/lua/wikis/battlerite/MatchSummary.lua @@ -16,16 +16,15 @@ local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/All') local WidgetUtil = Lua.import('Module:Widget/Util') ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px', teamStyle = 'bracket'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, children = WidgetUtil.collect( diff --git a/lua/wikis/callofduty/MatchSummary.lua b/lua/wikis/callofduty/MatchSummary.lua index c8cad8a8e62..95473fbfec9 100644 --- a/lua/wikis/callofduty/MatchSummary.lua +++ b/lua/wikis/callofduty/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/clashofclans/MatchSummary.lua b/lua/wikis/clashofclans/MatchSummary.lua index 1d1ab42f500..5c27f5cce3d 100644 --- a/lua/wikis/clashofclans/MatchSummary.lua +++ b/lua/wikis/clashofclans/MatchSummary.lua @@ -20,7 +20,7 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px'}) end @@ -53,11 +53,10 @@ function CustomMatchSummary._time(game, opponentIndex) :wikitext(Abbreviation.make{text = '(' .. os.date('%M:%S', time) .. ')', title = 'Total Time'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local scores = Array.map(game.opponents, Operator.property('score')) if Table.isEmpty(scores) then return diff --git a/lua/wikis/clashroyale/MatchSummary.lua b/lua/wikis/clashroyale/MatchSummary.lua index 5012dae3a17..96fd9327b7f 100644 --- a/lua/wikis/clashroyale/MatchSummary.lua +++ b/lua/wikis/clashroyale/MatchSummary.lua @@ -28,13 +28,13 @@ local DEFAULT_CARD = 'default' local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ---@param match MatchGroupUtilMatch ----@return Widget[] +---@return Renderable[] function CustomMatchSummary.createBody(match) local isTeamGame = Array.any(match.opponents, function(opponent) return opponent.type == Opponent.team end) local games @@ -55,7 +55,7 @@ end ---@param game MatchGroupUtilGame ---@param gameIndex integer ---@param date string ----@return Widget +---@return Renderable function CustomMatchSummary._createGame(game, gameIndex, date) local cardData = Array.map(game.opponents, function(opponent) return Array.map(opponent.players or {}, function(player) @@ -91,7 +91,7 @@ function CustomMatchSummary._createGame(game, gameIndex, date) end ---@param match MatchGroupUtilMatch ----@return Widget[] +---@return Renderable[] function CustomMatchSummary._createTeamMatchBody(match) local _, subMatches = Array.groupBy(match.games, Operator.property('subgroup')) subMatches = Array.map(subMatches, function(subMatch) @@ -179,7 +179,7 @@ end ---@param subMatchIndex integer ---@param subMatch table ---@param extradata table ----@return Widget +---@return Renderable function CustomMatchSummary._createSubMatch(players, subMatchIndex, subMatch, extradata) -- Add submatch header local header @@ -203,7 +203,7 @@ function CustomMatchSummary._createSubMatch(players, subMatchIndex, subMatch, ex :css('text-align', 'right') :css('width', '40%') :node(OpponentDisplay.BlockPlayers{ - opponent = {players = players[1]}, + opponent = {players = players[1], type = 'solo', extradata = {}}, overflow = 'ellipsis', showLink = true, flip = true, @@ -230,7 +230,7 @@ function CustomMatchSummary._createSubMatch(players, subMatchIndex, subMatch, ex :css('text-align', 'left') :css('width', '40%') :node(OpponentDisplay.BlockPlayers{ - opponent = {players = players[2]}, + opponent = {players = players[2], type = 'solo', extradata = {}}, overflow = 'ellipsis', showLink = true, flip = false, diff --git a/lua/wikis/commons/MatchSummary/Base.lua b/lua/wikis/commons/MatchSummary/Base.lua index d204e301dd2..e011a08fcd3 100644 --- a/lua/wikis/commons/MatchSummary/Base.lua +++ b/lua/wikis/commons/MatchSummary/Base.lua @@ -32,7 +32,7 @@ local TBD = Abbreviation.make{text = 'TBD', title = 'To Be Determined'} ---@class CustomMatchSummaryInterface ---@field createBody? fun(match: MatchGroupUtilMatch): Renderable|Renderable[] @deprecated ---@field createGames? fun(match: MatchGroupUtilMatch): Renderable|Renderable[] @deprecated (but better than createBody) ----@field createGame? fun(date: string, game: table, gameIndex: integer): Renderable|Renderable[] @deprecated +---@field createGame? fun(game: table, gameIndex: integer): Renderable|Renderable[] @deprecated ---@field GameRow? Component ---@field createFooter? fun(match: MatchGroupUtilMatch): Renderable|Renderable[] @@ -97,9 +97,8 @@ function MatchSummary.createDefaultBody(match, CustomMatchSummary, options) end elseif createGames then nodes = createGames(match) - else - ---@diagnostic disable-next-line: param-type-mismatch fixed in another PR - nodes = Array.map(match.games, FnUtil.curry(createGame, match.date)) + elseif createGame then + nodes = Array.map(match.games, createGame) end return WidgetUtil.collect( diff --git a/lua/wikis/criticalops/MatchSummary.lua b/lua/wikis/criticalops/MatchSummary.lua index 489665cc3c6..f8218b3c599 100644 --- a/lua/wikis/criticalops/MatchSummary.lua +++ b/lua/wikis/criticalops/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/crossfire/MatchSummary.lua b/lua/wikis/crossfire/MatchSummary.lua index 7c22348ef3f..2c414421a86 100644 --- a/lua/wikis/crossfire/MatchSummary.lua +++ b/lua/wikis/crossfire/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/deltaforce/MatchSummary.lua b/lua/wikis/deltaforce/MatchSummary.lua index 647e3a4e67d..8e0244bda90 100644 --- a/lua/wikis/deltaforce/MatchSummary.lua +++ b/lua/wikis/deltaforce/MatchSummary.lua @@ -34,11 +34,10 @@ function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ---@return Renderable? -function CustomMatchSummary.createGame(date, game, gameIndex) +function CustomMatchSummary.createGame(game, gameIndex) ---@param opponentIndex integer ---@return Renderable[] local function makeTeamSection(opponentIndex) diff --git a/lua/wikis/eva/MatchSummary.Lua b/lua/wikis/eva/MatchSummary.Lua index 60911d3df58..8189fc84bcc 100644 --- a/lua/wikis/eva/MatchSummary.Lua +++ b/lua/wikis/eva/MatchSummary.Lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) return { MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, diff --git a/lua/wikis/fortnite/MatchSummary.lua b/lua/wikis/fortnite/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/fortnite/MatchSummary.lua +++ b/lua/wikis/fortnite/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/freefire/MatchSummary.lua b/lua/wikis/freefire/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/freefire/MatchSummary.lua +++ b/lua/wikis/freefire/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/geoguessr/MatchSummary.lua b/lua/wikis/geoguessr/MatchSummary.lua index 60911d3df58..8189fc84bcc 100644 --- a/lua/wikis/geoguessr/MatchSummary.lua +++ b/lua/wikis/geoguessr/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) return { MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, diff --git a/lua/wikis/goals/MatchSummary.lua b/lua/wikis/goals/MatchSummary.lua index 96071a43097..bb669eccfe5 100644 --- a/lua/wikis/goals/MatchSummary.lua +++ b/lua/wikis/goals/MatchSummary.lua @@ -15,16 +15,15 @@ local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/All') local WidgetUtil = Lua.import('Module:Widget/Util') ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return MatchSummaryRow -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable +function CustomMatchSummary.createGame(game, gameIndex) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, children = WidgetUtil.collect( diff --git a/lua/wikis/halo/MatchSummary.lua b/lua/wikis/halo/MatchSummary.lua index 42cfcdc89e4..5701aafc58f 100644 --- a/lua/wikis/halo/MatchSummary.lua +++ b/lua/wikis/halo/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/magic/MatchSummary.lua b/lua/wikis/magic/MatchSummary.lua index a9bef276702..5f8b5193198 100644 --- a/lua/wikis/magic/MatchSummary.lua +++ b/lua/wikis/magic/MatchSummary.lua @@ -14,16 +14,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, children = WidgetUtil.collect( diff --git a/lua/wikis/marvelrivals/MatchSummary.lua b/lua/wikis/marvelrivals/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/marvelrivals/MatchSummary.lua +++ b/lua/wikis/marvelrivals/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/paladins/MatchSummary.lua b/lua/wikis/paladins/MatchSummary.lua index f97d98fac97..4295c67bd98 100644 --- a/lua/wikis/paladins/MatchSummary.lua +++ b/lua/wikis/paladins/MatchSummary.lua @@ -19,16 +19,15 @@ local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/All') local WidgetUtil = Lua.import('Module:Widget/Util') ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '420px', teamStyle = 'bracket'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local characterData = { Array.map((game.opponents[1] or {}).players or {}, Operator.property('character')), Array.map((game.opponents[2] or {}).players or {}, Operator.property('character')), diff --git a/lua/wikis/pokemon/MatchSummary.lua b/lua/wikis/pokemon/MatchSummary.lua index f4762e12ffc..9efdc02d778 100644 --- a/lua/wikis/pokemon/MatchSummary.lua +++ b/lua/wikis/pokemon/MatchSummary.lua @@ -27,11 +27,10 @@ function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, options) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ---@return Renderable? -function CustomMatchSummary.createGame(date, game, gameIndex) +function CustomMatchSummary.createGame(game, gameIndex) local extradata = game.extradata or {} -- TODO: Change to use participant data @@ -58,7 +57,7 @@ function CustomMatchSummary.createGame(date, game, gameIndex) flipped = false, characters = characterData[1], bg = 'brkts-popup-side-color brkts-popup-side-color--' .. (extradata.team1side or ''), - date = date, + date = game.date, }, MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = 1}, MatchSummaryWidgets.GameCenter{children = score or ('Game ' .. gameIndex)}, @@ -67,7 +66,7 @@ function CustomMatchSummary.createGame(date, game, gameIndex) flipped = true, characters = characterData[2], bg = 'brkts-popup-side-color brkts-popup-side-color--' .. (extradata.team2side or ''), - date = date, + date = game.date, }, MatchSummaryWidgets.GameComment{children = game.comment} ) diff --git a/lua/wikis/pubg/MatchSummary.lua b/lua/wikis/pubg/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/pubg/MatchSummary.lua +++ b/lua/wikis/pubg/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/pubgmobile/MatchSummary.lua b/lua/wikis/pubgmobile/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/pubgmobile/MatchSummary.lua +++ b/lua/wikis/pubgmobile/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/rematch/MatchSummary.lua b/lua/wikis/rematch/MatchSummary.lua index 7323df99f1f..1a27168ccf0 100644 --- a/lua/wikis/rematch/MatchSummary.lua +++ b/lua/wikis/rematch/MatchSummary.lua @@ -15,16 +15,15 @@ local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/All') local WidgetUtil = Lua.import('Module:Widget/Util') ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return MatchSummaryRow -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable +function CustomMatchSummary.createGame(game, gameIndex) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, children = WidgetUtil.collect( diff --git a/lua/wikis/rocketleague/MatchSummary.lua b/lua/wikis/rocketleague/MatchSummary.lua index d6ff0f99d3f..cf52627517f 100644 --- a/lua/wikis/rocketleague/MatchSummary.lua +++ b/lua/wikis/rocketleague/MatchSummary.lua @@ -24,16 +24,15 @@ local TIMEOUT = '[[File:Cooldown_Clock.png|14x14px|link=]]' local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/runeterra/MatchSummary.lua b/lua/wikis/runeterra/MatchSummary.lua index bc54772aa74..af37d3c2698 100644 --- a/lua/wikis/runeterra/MatchSummary.lua +++ b/lua/wikis/runeterra/MatchSummary.lua @@ -12,16 +12,15 @@ local MatchSummary = Lua.import('Module:MatchSummary/Base') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {teamStyle = 'short'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) return nil end diff --git a/lua/wikis/sideswipe/MatchSummary.lua b/lua/wikis/sideswipe/MatchSummary.lua index d021d05099a..d6555d6bd57 100644 --- a/lua/wikis/sideswipe/MatchSummary.lua +++ b/lua/wikis/sideswipe/MatchSummary.lua @@ -17,16 +17,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/smite/MatchSummary.lua b/lua/wikis/smite/MatchSummary.lua index 8710d939f1a..50b086185ee 100644 --- a/lua/wikis/smite/MatchSummary.lua +++ b/lua/wikis/smite/MatchSummary.lua @@ -25,11 +25,10 @@ function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, options) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ---@return Renderable -function CustomMatchSummary.createGame(date, game, gameIndex) +function CustomMatchSummary.createGame(game, gameIndex) local extradata = game.extradata or {} -- TODO: Change to use participant data @@ -45,7 +44,7 @@ function CustomMatchSummary.createGame(date, game, gameIndex) flipped = false, characters = characterData[1], bg = 'brkts-popup-side-color brkts-popup-side-color--' .. (extradata.team1side or ''), - date = date, + date = game.date, }, MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = 1}, MatchSummaryWidgets.GameCenter{children = Logic.nilIfEmpty(game.length) or ('Game ' .. gameIndex)}, @@ -54,7 +53,7 @@ function CustomMatchSummary.createGame(date, game, gameIndex) flipped = true, characters = characterData[2], bg = 'brkts-popup-side-color brkts-popup-side-color--' .. (extradata.team2side or ''), - date = date, + date = game.date, }, MatchSummaryWidgets.GameComment{children = game.comment} ) diff --git a/lua/wikis/splatoon/MatchSummary.lua b/lua/wikis/splatoon/MatchSummary.lua index 9cb814441c3..d7487c9d330 100644 --- a/lua/wikis/splatoon/MatchSummary.lua +++ b/lua/wikis/splatoon/MatchSummary.lua @@ -21,16 +21,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '500px', teamStyle = 'bracket'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end @@ -39,6 +38,7 @@ function CustomMatchSummary.createGame(date, game, gameIndex) local opponent = game.opponents[opponentIndex] or {} local weaponsData = Array.map(opponent.players or {}, Operator.property('weapon')) + ---@type string|integer local score = opponent.score if score and game.mode == 'turf war' then score = score .. '%' diff --git a/lua/wikis/splitgate/MatchSummary.lua b/lua/wikis/splitgate/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/splitgate/MatchSummary.lua +++ b/lua/wikis/splitgate/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/squadrons/MatchSummary.lua b/lua/wikis/squadrons/MatchSummary.lua index bc54772aa74..af37d3c2698 100644 --- a/lua/wikis/squadrons/MatchSummary.lua +++ b/lua/wikis/squadrons/MatchSummary.lua @@ -12,16 +12,15 @@ local MatchSummary = Lua.import('Module:MatchSummary/Base') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {teamStyle = 'short'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) return nil end diff --git a/lua/wikis/tarkovarena/MatchSummary.lua b/lua/wikis/tarkovarena/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/tarkovarena/MatchSummary.lua +++ b/lua/wikis/tarkovarena/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/teamfortress/MatchSummary.lua b/lua/wikis/teamfortress/MatchSummary.lua index 60911d3df58..8189fc84bcc 100644 --- a/lua/wikis/teamfortress/MatchSummary.lua +++ b/lua/wikis/teamfortress/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) return { MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, diff --git a/lua/wikis/tetris/MatchSummary.lua b/lua/wikis/tetris/MatchSummary.lua index 9ba1bab8be0..56e6e4460f0 100644 --- a/lua/wikis/tetris/MatchSummary.lua +++ b/lua/wikis/tetris/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) return { MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, diff --git a/lua/wikis/tft/MatchSummary.lua b/lua/wikis/tft/MatchSummary.lua index c98cc3e3f07..655081c0504 100644 --- a/lua/wikis/tft/MatchSummary.lua +++ b/lua/wikis/tft/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) return { MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, diff --git a/lua/wikis/thefinals/MatchSummary.lua b/lua/wikis/thefinals/MatchSummary.lua index ac2381d9d18..8189fc84bcc 100644 --- a/lua/wikis/thefinals/MatchSummary.lua +++ b/lua/wikis/thefinals/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Html +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) return { MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, diff --git a/lua/wikis/trackmania/MatchSummary.lua b/lua/wikis/trackmania/MatchSummary.lua index 4c3252ba3ed..40643e6a7ce 100644 --- a/lua/wikis/trackmania/MatchSummary.lua +++ b/lua/wikis/trackmania/MatchSummary.lua @@ -18,16 +18,15 @@ local OVERTIME = '[[File:Cooldown_Clock.png|14x14px|link=]]' local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/warthunder/MatchSummary.lua b/lua/wikis/warthunder/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/warthunder/MatchSummary.lua +++ b/lua/wikis/warthunder/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/wildrift/MatchSummary.lua b/lua/wikis/wildrift/MatchSummary.lua index aa089971d98..1829e3919dd 100644 --- a/lua/wikis/wildrift/MatchSummary.lua +++ b/lua/wikis/wildrift/MatchSummary.lua @@ -24,11 +24,10 @@ function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '420px', maxBans = MAX_NUM_BANS}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ---@return Renderable? -function CustomMatchSummary.createGame(date, game, gameIndex) +function CustomMatchSummary.createGame(game, gameIndex) local extradata = game.extradata or {} -- TODO: Change to use participant data diff --git a/lua/wikis/worldoftanks/MatchSummary.lua b/lua/wikis/worldoftanks/MatchSummary.lua index c80ab7f4487..f5b1e69a71c 100644 --- a/lua/wikis/worldoftanks/MatchSummary.lua +++ b/lua/wikis/worldoftanks/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end diff --git a/lua/wikis/worldofwarcraft/MatchSummary.lua b/lua/wikis/worldofwarcraft/MatchSummary.lua index 8a717e3fb6d..08d8f8ed1d7 100644 --- a/lua/wikis/worldofwarcraft/MatchSummary.lua +++ b/lua/wikis/worldofwarcraft/MatchSummary.lua @@ -19,16 +19,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px', teamStyle = 'bracket'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) local function makeTeamSection(opponentIndex) local flipped = opponentIndex == 2 local characters = Array.map((game.opponents[opponentIndex] or {}).players or {}, Operator.property('character')) diff --git a/lua/wikis/zula/MatchSummary.lua b/lua/wikis/zula/MatchSummary.lua index 0dcae8cd1ed..fcc11abea68 100644 --- a/lua/wikis/zula/MatchSummary.lua +++ b/lua/wikis/zula/MatchSummary.lua @@ -15,16 +15,15 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local CustomMatchSummary = {} ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px'}) end ----@param date string ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget? -function CustomMatchSummary.createGame(date, game, gameIndex) +---@return Renderable? +function CustomMatchSummary.createGame(game, gameIndex) if not game.map then return end