Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lua/wikis/apexlegends/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/arenafps/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/artifact/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/autochess/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/battalion/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/battlerite/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/callofduty/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/clashofclans/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions lua/wikis/clashroyale/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/commons/MatchSummary/Base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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<MatchSummaryGameRowProps>
---@field createFooter? fun(match: MatchGroupUtilMatch): Renderable|Renderable[]

Expand Down Expand Up @@ -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(
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/criticalops/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/crossfire/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions lua/wikis/deltaforce/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/eva/MatchSummary.Lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/fortnite/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/freefire/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/geoguessr/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
7 changes: 3 additions & 4 deletions lua/wikis/goals/MatchSummary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading
Loading