From d1d86031a356ceb21941e42bc020156929167dfb Mon Sep 17 00:00:00 2001 From: Rikard Blixt Date: Sun, 16 Aug 2026 14:14:56 +0200 Subject: [PATCH] refactor: remove date param in createGame (and fix some annotations --- lua/wikis/apexlegends/MatchSummary.lua | 7 +++---- lua/wikis/arenafps/MatchSummary.lua | 7 +++---- lua/wikis/artifact/MatchSummary.lua | 7 +++---- lua/wikis/autochess/MatchSummary.lua | 7 +++---- lua/wikis/battalion/MatchSummary.lua | 7 +++---- lua/wikis/battlerite/MatchSummary.lua | 7 +++---- lua/wikis/callofduty/MatchSummary.lua | 7 +++---- lua/wikis/chess/MatchSummary.lua | 15 ++++++++------- lua/wikis/clashofclans/MatchSummary.lua | 7 +++---- lua/wikis/clashroyale/MatchSummary.lua | 14 +++++++------- lua/wikis/commons/MatchSummary/Base.lua | 8 ++++---- lua/wikis/criticalops/MatchSummary.lua | 7 +++---- lua/wikis/crossfire/MatchSummary.lua | 7 +++---- lua/wikis/deltaforce/MatchSummary.lua | 3 +-- lua/wikis/easportsfc/MatchSummary.lua | 12 ++++++------ lua/wikis/eva/MatchSummary.Lua | 7 +++---- lua/wikis/fortnite/MatchSummary.lua | 7 +++---- lua/wikis/freefire/MatchSummary.lua | 7 +++---- lua/wikis/geoguessr/MatchSummary.lua | 7 +++---- lua/wikis/goals/MatchSummary.lua | 7 +++---- lua/wikis/halo/MatchSummary.lua | 7 +++---- lua/wikis/magic/MatchSummary.lua | 7 +++---- lua/wikis/marvelrivals/MatchSummary.lua | 7 +++---- lua/wikis/paladins/MatchSummary.lua | 7 +++---- lua/wikis/pokemon/MatchSummary.lua | 16 +++++++--------- lua/wikis/pubg/MatchSummary.lua | 7 +++---- lua/wikis/pubgmobile/MatchSummary.lua | 7 +++---- lua/wikis/rematch/MatchSummary.lua | 7 +++---- lua/wikis/rocketleague/MatchSummary.lua | 7 +++---- lua/wikis/runeterra/MatchSummary.lua | 7 +++---- lua/wikis/sideswipe/MatchSummary.lua | 7 +++---- lua/wikis/smite/MatchSummary.lua | 16 +++++++--------- lua/wikis/splatoon/MatchSummary.lua | 8 ++++---- lua/wikis/splitgate/MatchSummary.lua | 7 +++---- lua/wikis/squadrons/MatchSummary.lua | 7 +++---- lua/wikis/tarkovarena/MatchSummary.lua | 7 +++---- lua/wikis/teamfortress/MatchSummary.lua | 7 +++---- lua/wikis/tetris/MatchSummary.lua | 7 +++---- lua/wikis/tft/MatchSummary.lua | 7 +++---- lua/wikis/thefinals/MatchSummary.lua | 7 +++---- lua/wikis/trackmania/MatchSummary.lua | 7 +++---- lua/wikis/warthunder/MatchSummary.lua | 7 +++---- lua/wikis/wildrift/MatchSummary.lua | 6 +++--- lua/wikis/worldoftanks/MatchSummary.lua | 7 +++---- lua/wikis/worldofwarcraft/MatchSummary.lua | 7 +++---- lua/wikis/zula/MatchSummary.lua | 7 +++---- 46 files changed, 158 insertions(+), 199 deletions(-) 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/chess/MatchSummary.lua b/lua/wikis/chess/MatchSummary.lua index 2fbb2e07f70..522649734f3 100644 --- a/lua/wikis/chess/MatchSummary.lua +++ b/lua/wikis/chess/MatchSummary.lua @@ -50,14 +50,14 @@ local KING_ICONS = { } ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args) end ---@param match table ---@param createGame fun(date: string, game: table, gameIndex: integer): Widget ----@return Widget[] +---@return Renderable[] function CustomMatchSummary.createBody(match, createGame) return WidgetUtil.collect( Array.map(match.games, createGame), @@ -67,7 +67,7 @@ end ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return MatchSummaryRow +---@return Renderable function CustomMatchSummary.createGame(game, gameIndex) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, @@ -108,7 +108,7 @@ end ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return Widget +---@return Renderable function CustomMatchSummary._getCenterContent(game, gameIndex) return Div{ children = { @@ -128,7 +128,7 @@ function CustomMatchSummary._getCenterContent(game, gameIndex) end ---@param gameOpponent table ----@return Widget +---@return Renderable function CustomMatchSummary._getSideIcon(gameOpponent) return Div{ classes = {'brkts-popup-spaced'}, @@ -137,7 +137,7 @@ function CustomMatchSummary._getSideIcon(gameOpponent) end ---@param game MatchGroupUtilGame ----@return Widget? +---@return Renderable? function CustomMatchSummary._getHeader(game) return String.isNotEmpty(game.header) and { Div{ @@ -152,7 +152,7 @@ function CustomMatchSummary._getHeader(game) end ---@param match any ----@return Widget? +---@return Renderable? function CustomMatchSummary._linksTable(match) if Logic.isDeepEmpty(match.links) then return @@ -168,6 +168,7 @@ function CustomMatchSummary._linksTable(match) local linksFooter = MatchSummary.Footer() MatchSummary.addVodsToFooter({vod = vod, games = {}}, linksFooter) +---@diagnostic disable-next-line: param-type-mismatch GETTING FIX IN ANOTHER PR linksFooter:addLinks(links) return Tr{children = { 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 106ce92620b..afdbae18ed4 100644 --- a/lua/wikis/commons/MatchSummary/Base.lua +++ b/lua/wikis/commons/MatchSummary/Base.lua @@ -33,7 +33,7 @@ local TBD = Abbreviation.make{text = 'TBD', title = 'To Be Determined'} ---@class CustomMatchSummaryInterface ---@field createHeader? fun(match: MatchGroupUtilMatch, options: {teamStyle: teamStyle?}?): Renderable ---@field createBody? fun(match: MatchGroupUtilMatch): Renderable|Renderable[] ----@field createGame? fun(date: string, game: table, gameIndex: integer): Renderable|Renderable[] +---@field createGame? fun(game: table, gameIndex: integer): Renderable|Renderable[] ---@field addToFooter? fun(match: MatchGroupUtilMatch, footer: MatchSummaryFooter): MatchSummaryFooter ---@field createMatch? fun(matchData: MatchGroupUtilMatch): MatchSummaryMatch @@ -194,11 +194,11 @@ end -- Default body function ---@param match MatchGroupUtilMatch ----@param createGame fun(date: string, game: table, gameIndex: integer): Renderable|Renderable[] +---@param createGame fun(game: table, gameIndex: integer): Renderable|Renderable[] ---@return Renderable[] function MatchSummary.createDefaultBody(match, createGame) return WidgetUtil.collect( - Array.map(match.games, FnUtil.curry(createGame, match.date)), + Array.map(match.games, createGame), MatchSummaryWidgets.Mvp(match.extradata.mvp), MatchSummaryWidgets.MapVeto(MatchSummary.preProcessMapVeto(match.extradata.mapveto, {game = match.game})) ) @@ -285,7 +285,7 @@ end function MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, options) assert( (type(CustomMatchSummary.createBody) == 'function' or type(CustomMatchSummary.createGame) == 'function'), - 'createBody(match) or createGame(date, game, gameIndex) must be implemented in Module:MatchSummary' + 'createBody(match) or createGame(game, gameIndex) must be implemented in Module:MatchSummary' ) options = options or {} 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/easportsfc/MatchSummary.lua b/lua/wikis/easportsfc/MatchSummary.lua index 1d1a508a3d0..e82c6577d20 100644 --- a/lua/wikis/easportsfc/MatchSummary.lua +++ b/lua/wikis/easportsfc/MatchSummary.lua @@ -23,13 +23,13 @@ local NO_CHECK = '[[File:NoCheck.png|link=]]' 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 hasSubMatches = Logic.readBool((match.extradata or {}).hassubmatches) @@ -46,7 +46,7 @@ function CustomMatchSummary.createBody(match) end ---@param game MatchGroupUtilGame ----@return MatchSummaryRow +---@return Renderable function CustomMatchSummary._createGame(game) return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'}, @@ -63,7 +63,7 @@ end ---@param game MatchGroupUtilGame ---@param match MatchGroupUtilMatch ----@return MatchSummaryRow +---@return Renderable function CustomMatchSummary._createSubMatch(game, match) local players = CustomMatchSummary._extractPlayersFromGame(game, match) @@ -110,7 +110,7 @@ end ---@param game MatchGroupUtilGame ---@param opponentIndex integer ----@return string +---@return string? function CustomMatchSummary._subMatchPenaltyScore(game, opponentIndex) local scores = (game.extradata or {}).penaltyscores @@ -137,7 +137,7 @@ function CustomMatchSummary._players(players, opponentIndex, winner) :css('text-align', flip and 'right' or 'left') :css('width', '35%') :node(OpponentDisplay.BlockPlayers{ - opponent = {players = players}, + opponent = {players = players, type = 'solo', extradata = {}}, overflow = 'ellipsis', showLink = true, }) 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 a2c90221eb9..be68856fc33 100644 --- a/lua/wikis/pokemon/MatchSummary.lua +++ b/lua/wikis/pokemon/MatchSummary.lua @@ -10,7 +10,6 @@ local CustomMatchSummary = {} local Lua = require('Module:Lua') local Array = Lua.import('Module:Array') -local FnUtil = Lua.import('Module:FnUtil') local Logic = Lua.import('Module:Logic') local Operator = Lua.import('Module:Operator') @@ -22,28 +21,27 @@ local MAX_NUM_BANS = 5 local NUM_CHAMPIONS_PICK = 5 ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '420px', teamStyle = 'bracket'}) end ---@param match MatchGroupUtilMatch ----@return Widget[] +---@return Renderable[] function CustomMatchSummary.createBody(match) local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS) return WidgetUtil.collect( - Array.map(match.games, FnUtil.curry(CustomMatchSummary._createGame, match.date)), + Array.map(match.games, CustomMatchSummary._createGame), MatchSummaryWidgets.Mvp(match.extradata.mvp), MatchSummaryWidgets.CharacterBanTable{bans = characterBansData, date = match.date} ) 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) local extradata = game.extradata or {} -- TODO: Change to use participant data @@ -70,7 +68,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)}, @@ -79,7 +77,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 8e3fde587c2..854b6c91911 100644 --- a/lua/wikis/smite/MatchSummary.lua +++ b/lua/wikis/smite/MatchSummary.lua @@ -10,7 +10,6 @@ local CustomMatchSummary = {} local Lua = require('Module:Lua') local Array = Lua.import('Module:Array') -local FnUtil = Lua.import('Module:FnUtil') local Logic = Lua.import('Module:Logic') local MatchSummary = Lua.import('Module:MatchSummary/Base') @@ -21,27 +20,26 @@ local MAX_NUM_BANS = 5 local NUM_GODS_PICK = 5 ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '400px', teamStyle = 'bracket'}) end ---@param match MatchGroupUtilMatch ----@return Widget[] +---@return Renderable[] function CustomMatchSummary.createBody(match) local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS) return WidgetUtil.collect( - Array.map(match.games, FnUtil.curry(CustomMatchSummary._createGame, match.date)), + Array.map(match.games, CustomMatchSummary._createGame), MatchSummaryWidgets.CharacterBanTable{bans = characterBansData, date = match.date} ) 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) local extradata = game.extradata or {} -- TODO: Change to use participant data @@ -57,7 +55,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)}, @@ -66,7 +64,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 c1f0af1369e..b807f374fe4 100644 --- a/lua/wikis/wildrift/MatchSummary.lua +++ b/lua/wikis/wildrift/MatchSummary.lua @@ -20,13 +20,13 @@ local MAX_NUM_BANS = 5 local NUM_CHAMPIONS_PICK = 5 ---@param args table ----@return Widget +---@return Renderable function CustomMatchSummary.getByMatchId(args) return MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, {width = '420px'}) end ---@param match MatchGroupUtilMatch ----@return Widget[] +---@return Renderable[] function CustomMatchSummary.createBody(match) local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS) @@ -39,7 +39,7 @@ end ---@param game MatchGroupUtilGame ---@param gameIndex integer ----@return MatchSummaryRow? +---@return Renderable? function CustomMatchSummary._createGame(game, gameIndex) local extradata = game.extradata or {} 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