diff --git a/components/match2/commons/brkts_wiki_specific_base.lua b/components/match2/commons/brkts_wiki_specific_base.lua index 9f03671c793..41e55288ba9 100644 --- a/components/match2/commons/brkts_wiki_specific_base.lua +++ b/components/match2/commons/brkts_wiki_specific_base.lua @@ -52,7 +52,11 @@ Called from MatchGroup -- @returns module ]] function WikiSpecificBase.getMatchGroupContainer(matchGroupType) - if matchGroupType == 'matchlist' then + -- TODO Add a check if opponent count is > 2 + if Lua.moduleExists('Module:GameSummary') then + local Horizontallist = Lua.import('Module:MatchGroup/Display/Horizontallist') + return Horizontallist.BracketContainer + elseif matchGroupType == 'matchlist' then local MatchList = Lua.import('Module:MatchGroup/Display/Matchlist') return MatchList.MatchlistContainer end diff --git a/components/match2/commons/match_group_input_util.lua b/components/match2/commons/match_group_input_util.lua index 970a26b90f7..028633a6039 100644 --- a/components/match2/commons/match_group_input_util.lua +++ b/components/match2/commons/match_group_input_util.lua @@ -1289,7 +1289,7 @@ function MatchGroupInputUtil.standardProcessFfaMatch(match, Parser, mapProps) or nil Array.forEach(opponents, function(opponent, opponentIndex) opponent.extradata = opponent.extradata or {} - opponent.extradata.startingpoints = tonumber(opponent.pointmodifier) + opponent.extradata.startingpoints = tonumber(opponent.startingpoints) opponent.placement = tonumber(opponent.placement) opponent.score, opponent.status = MatchGroupInputUtil.computeOpponentScore({ diff --git a/components/match2/commons/match_summary_ffa.lua b/components/match2/commons/match_summary_ffa.lua index 50005f0af22..caabcbf1549 100644 --- a/components/match2/commons/match_summary_ffa.lua +++ b/components/match2/commons/match_summary_ffa.lua @@ -157,6 +157,9 @@ local MATCH_OVERVIEW_COLUMNS = { } local GAME_OVERVIEW_COLUMNS = { { + show = function(match) + return match.extradata.settings.showGameDetails + end, class = 'panel-table__cell__game-placement', icon = 'placement', header = { @@ -184,6 +187,9 @@ local GAME_OVERVIEW_COLUMNS = { }, }, { + show = function(match) + return match.extradata.settings.showGameDetails + end, class = 'panel-table__cell__game-kills', icon = 'kills', header = { @@ -195,6 +201,21 @@ local GAME_OVERVIEW_COLUMNS = { end, }, }, + { + show = function(match) + return not match.extradata.settings.showGameDetails + end, + class = 'panel-table__cell__game-total-points', + icon = 'points', + header = { + value = 'Pts.', + }, + row = { + value = function (opponent) + return opponent.score + end, + }, + }, } local GAME_STANDINGS_COLUMNS = { { @@ -274,6 +295,9 @@ local GAME_STANDINGS_COLUMNS = { }, }, { + show = function(match) + return match.extradata.settings.showGameDetails + end, sortable = true, sortType = 'placements', class = 'cell--placements', @@ -293,6 +317,9 @@ local GAME_STANDINGS_COLUMNS = { }, }, { + show = function(match) + return match.extradata.settings.showGameDetails + end, sortable = true, sortType = 'kills', class = 'cell--kills', @@ -451,6 +478,9 @@ function MatchSummaryFfa.standardMatch(match) HtmlWidgets.Div{ classes = {'panel-table__cell__game-details'}, children = Array.map(GAME_OVERVIEW_COLUMNS, function(column) + if column.show and not column.show(match) then + return + end return MatchSummaryWidgets.TableHeaderCell{ class = column.class, icon = column.icon, diff --git a/components/match2/wikis/apexlegends/brkts_wiki_specific.lua b/components/match2/wikis/apexlegends/brkts_wiki_specific.lua deleted file mode 100644 index 1dfc19724e4..00000000000 --- a/components/match2/wikis/apexlegends/brkts_wiki_specific.lua +++ /dev/null @@ -1,24 +0,0 @@ ---- --- @Liquipedia --- wiki=apexlegends --- page=Module:Brkts/WikiSpecific --- --- Please see https://github.com/Liquipedia/Lua-Modules to contribute --- - -local Lua = require('Module:Lua') -local Table = require('Module:Table') - -local BaseWikiSpecific = Lua.import('Module:Brkts/WikiSpecific/Base') - ----@class ApexlegendsBrktsWikiSpecific: BrktsWikiSpecific -local WikiSpecific = Table.copy(BaseWikiSpecific) - ----@param matchGroupType string ----@return function -function WikiSpecific.getMatchGroupContainer(matchGroupType) - local Horizontallist = Lua.import('Module:MatchGroup/Display/Horizontallist') - return Horizontallist.BracketContainer -end - -return WikiSpecific diff --git a/components/match2/wikis/apexlegends/match_group_input_custom.lua b/components/match2/wikis/apexlegends/match_group_input_custom.lua index cad147a8441..0ec36292ca1 100644 --- a/components/match2/wikis/apexlegends/match_group_input_custom.lua +++ b/components/match2/wikis/apexlegends/match_group_input_custom.lua @@ -8,6 +8,7 @@ local Array = require('Module:Array') local Json = require('Module:Json') +local Logic = require('Module:Logic') local Lua = require('Module:Lua') local Operator = require('Module:Operator') local Table = require('Module:Table') @@ -106,6 +107,9 @@ function MatchFunctions.parseSettings(match) return { score = scoreSettings, status = statusSettings, + settings = { + showGameDetails = Logic.nilOr(Logic.readBoolOrNil(match.showgamedetails), true), + } } end @@ -118,6 +122,7 @@ function MatchFunctions.getExtraData(match, games, opponents, settings) return { scoring = settings.score, status = settings.status, + settings = settings.settings, } end diff --git a/components/match2/wikis/freefire/game_summary.lua b/components/match2/wikis/freefire/game_summary.lua new file mode 100644 index 00000000000..104f3cb9950 --- /dev/null +++ b/components/match2/wikis/freefire/game_summary.lua @@ -0,0 +1,89 @@ +--- +-- @Liquipedia +-- wiki=freefire +-- page=Module:GameSummary +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local CustomGameSummary = {} + +local Array = require('Module:Array') +local FnUtil = require('Module:FnUtil') +local Lua = require('Module:Lua') +local Page = require('Module:Page') +local Table = require('Module:Table') + +local MatchGroupUtil = Lua.import('Module:MatchGroup/Util') + +local SummaryHelper = Lua.import('Module:MatchSummary/Ffa') +local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/Ffa/All') +local HtmlWidgets = Lua.import('Module:Widget/Html/All') +local IconWidget = Lua.import('Module:Widget/Image/Icon/Fontawesome') + +---@class FreefireMatchGroupUtilGame: MatchGroupUtilGame +---@field stream table + +---@param props {bracketId: string, matchId: string, gameIdx: integer} +---@return Html +function CustomGameSummary.getGameByMatchId(props) + ---@class ApexMatchGroupUtilMatch + local match = MatchGroupUtil.fetchMatchForBracketDisplay(props.bracketId, props.matchId) + + local game = match.games[props.gameIdx] + assert(game, 'Error Game ID ' .. tostring(props.gameIdx) .. ' not found') + + game.stream = match.stream + + CustomGameSummary._opponents(game, match.opponents) + local scoringData = SummaryHelper.createScoringData(match) + + return MatchSummaryWidgets.Tab{ + matchId = match.matchId, + idx = props.gameIdx, + children = { + CustomGameSummary._createGameDetails(game), + MatchSummaryWidgets.PointsDistribution{killScore = scoringData.kill, placementScore = scoringData.placement}, + SummaryHelper.standardGame(game) + } + } +end + +---@param game table +---@return Widget +function CustomGameSummary._createGameDetails(game) + return MatchSummaryWidgets.ContentItemContainer{contentClass = 'panel-content__game-schedule', + items = { + { + icon = MatchSummaryWidgets.CountdownIcon{game = game}, + content = MatchSummaryWidgets.GameCountdown{game = game}, + }, + game.map and { + icon = IconWidget{iconName = 'map'}, + content = HtmlWidgets.Span{children = Page.makeInternalLink(game.map)}, + } or nil, + } + } +end + +---@param game table +---@param matchOpponents table[] +function CustomGameSummary._opponents(game, matchOpponents) + -- Add match opponent data to game opponent + game.opponents = Array.map(game.opponents, + function(gameOpponent, opponentIdx) + local matchOpponent = matchOpponents[opponentIdx] + local newGameOpponent = Table.merge(matchOpponent, gameOpponent) + -- These values are only allowed to come from Game and not Match + newGameOpponent.placement = gameOpponent.placement + newGameOpponent.score = gameOpponent.score + newGameOpponent.status = gameOpponent.status + return newGameOpponent + end + ) + + -- Sort game level based on placement + Array.sortInPlaceBy(game.opponents, FnUtil.identity, SummaryHelper.placementSortFunction) +end + +return CustomGameSummary diff --git a/components/match2/wikis/freefire/get_match_group_copy_paste_wiki.lua b/components/match2/wikis/freefire/get_match_group_copy_paste_wiki.lua new file mode 100644 index 00000000000..adcc54b885e --- /dev/null +++ b/components/match2/wikis/freefire/get_match_group_copy_paste_wiki.lua @@ -0,0 +1,68 @@ +--- +-- @Liquipedia +-- wiki=freefire +-- page=Module:GetMatchGroupCopyPaste/wiki +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local Array = require('Module:Array') +local Class = require('Module:Class') +local Lua = require('Module:Lua') + +local OpponentLibraries = require('Module:OpponentLibraries') +local Opponent = OpponentLibraries.Opponent + +local BaseCopyPaste = Lua.import('Module:GetMatchGroupCopyPaste/wiki/Base') + +---WikiSpecific Code for MatchList and Bracket Code Generators +---@class FreefireMatchCopyPaste: Match2CopyPasteBase +local WikiCopyPaste = Class.new(BaseCopyPaste) + +local INDENT = WikiCopyPaste.Indent + +---returns the Code for a Match, depending on the input +---@param bestof integer +---@param mode string +---@param index integer +---@param opponents integer +---@param args table +---@return string +function WikiCopyPaste.getMatchCode(bestof, mode, index, opponents, args) + local lines = Array.extend( + '{{Match|finished=', + INDENT .. '|p_kill=1 |p1=12 |p2=9 |p3=8 |p4=7 |p5=6 |p6=5 |p7=4 |p8=3 |p9=2 |p10=1 |p11=0 |p12=0', + {INDENT .. '|twitch=|youtube='}, + Array.map(Array.range(1, bestof), function(mapIndex) + return INDENT .. '|map' .. mapIndex .. '={{Map|date=|finished=|map=|vod=}}' + end), + Array.map(Array.range(1, opponents), function(opponentIndex) + return INDENT .. '|opponent' .. opponentIndex .. '=' .. WikiCopyPaste._getOpponent(mode, bestof) + end), + '}}' + ) + + return table.concat(lines, '\n') +end + +--subfunction used to generate the code for the Opponent template, depending on the type of opponent +---@param mode string +---@param mapCount integer +---@return string +function WikiCopyPaste._getOpponent(mode, mapCount) + local mapScores = table.concat(Array.map(Array.range(1, mapCount), function(idx) + return '|m' .. idx .. '={{MS||}}' + end)) + + if mode == Opponent.solo then + return '{{SoloOpponent||flag=' .. mapScores .. '}}' + elseif mode == Opponent.team then + return '{{TeamOpponent|' .. mapScores .. '}}' + elseif mode == Opponent.literal then + return '{{Literal|' .. mapScores .. '}}' + end + + return '' +end + +return WikiCopyPaste diff --git a/components/match2/wikis/freefire/match_group_input_custom.lua b/components/match2/wikis/freefire/match_group_input_custom.lua new file mode 100644 index 00000000000..823f11f404d --- /dev/null +++ b/components/match2/wikis/freefire/match_group_input_custom.lua @@ -0,0 +1,180 @@ +--- +-- @Liquipedia +-- wiki=freefire +-- page=Module:MatchGroup/Input/Custom +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local Array = require('Module:Array') +local Json = require('Module:Json') +local Logic = require('Module:Logic') +local Lua = require('Module:Lua') +local Operator = require('Module:Operator') +local Table = require('Module:Table') + +local MatchGroupInputUtil = Lua.import('Module:MatchGroup/Input/Util') + +local MapFunctions = {} +local MatchFunctions = { + OPPONENT_CONFIG = { + resolveRedirect = true, + applyUnderScores = true, + maxNumPlayers = 3, + }, + DEFAULT_MODE = 'team' +} + +local CustomMatchGroupInput = {} + +---@param match table +---@param options table? +---@return table +function CustomMatchGroupInput.processMatch(match, options) + return MatchGroupInputUtil.standardProcessFfaMatch(match, MatchFunctions) +end + +-- +-- match related functions +-- +---@param match table +---@param opponents table[] +---@param scoreSettings table +---@return table[] +function MatchFunctions.extractMaps(match, opponents, scoreSettings) + local maps = {} + for key, map, mapIndex in Table.iter.pairsByPrefix(match, 'map', {requireIndex = true}) do + local finishedInput = map.finished --[[@as string?]] + local winnerInput = map.winner --[[@as string?]] + + Table.mergeInto(map, MatchGroupInputUtil.readDate(map.date)) + map.finished = MatchGroupInputUtil.mapIsFinished(map) + + map.opponents = Array.map(opponents, function(matchOpponent) + local opponentMapInput = Json.parseIfString(matchOpponent['m' .. mapIndex]) + return MapFunctions.makeMapOpponentDetails(opponentMapInput, scoreSettings) + end) + + map.scores = Array.map(map.opponents, Operator.property('score')) + if map.finished then + map.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + map.winner = MatchGroupInputUtil.getWinner(map.status, winnerInput, map.opponents) + end + + map.extradata = MapFunctions.getExtraData(map) + + table.insert(maps, map) + match[key] = nil + end + + return maps +end + +---@param opponents table[] +---@param maps table[] +---@return fun(opponentIndex: integer): integer? +function MatchFunctions.calculateMatchScore(opponents, maps) + return function(opponentIndex) + return Array.reduce(Array.map(maps, function(map) + return map.opponents[opponentIndex].score or 0 + end), Operator.add, 0) + (opponents[opponentIndex].extradata.startingpoints or 0) + end +end + + +---@param match table +---@return {score: table, status: table} +function MatchFunctions.parseSettings(match) + -- Score Settings + local scoreSettings = { + kill = tonumber(match.p_kill) or 1, + placement = Array.mapIndexes(function(idx) + return match['opponent' .. idx] and (tonumber(match['p' .. idx]) or 0) or nil + end) + } + + -- Up/Down colors + local statusSettings = Array.flatMap(Array.parseCommaSeparatedString(match.bg, ','), function (status) + local placements, color = unpack(Array.parseCommaSeparatedString(status, '=')) + local pStart, pEnd = unpack(Array.parseCommaSeparatedString(placements, '-')) + local pStartNumber = tonumber(pStart) --[[@as integer]] + local pEndNumber = tonumber(pEnd) or pStartNumber + return Array.map(Array.range(pStartNumber, pEndNumber), function() + return color + end) + end) + + return { + score = scoreSettings, + status = statusSettings, + settings = { + showGameDetails = Logic.nilOr(Logic.readBoolOrNil(match.showgamedetails), true), + } + } +end + +---@param match table +---@param games table[] +---@param opponents table[] +---@param settings table +---@return table +function MatchFunctions.getExtraData(match, games, opponents, settings) + return { + scoring = settings.score, + status = settings.status, + settings = settings.settings, + } +end + +-- +-- map related functions +-- + +---@param map table +---@return table +function MapFunctions.getExtraData(map) + return { + dateexact = map.dateexact, + comment = map.comment, + } +end + +---@param scoreDataInput table? +---@param scoreSettings table +---@return table +function MapFunctions.makeMapOpponentDetails(scoreDataInput, scoreSettings) + if not scoreDataInput then + return {} + end + + local scoreBreakdown = {} + + local placement, kills = tonumber(scoreDataInput[1]), tonumber(scoreDataInput[2]) + local points = tonumber(scoreDataInput.p) + if placement or kills then + if placement then + scoreBreakdown.placePoints = scoreSettings.placement[placement] or 0 + end + if kills then + scoreBreakdown.killPoints = kills * scoreSettings.kill + scoreBreakdown.kills = kills + end + scoreBreakdown.totalPoints = (scoreBreakdown.placePoints or 0) + (scoreBreakdown.killPoints or 0) + end + + local opponent = { + status = MatchGroupInputUtil.STATUS.SCORE, + scoreBreakdown = scoreBreakdown, + placement = placement, + score = points or scoreBreakdown.totalPoints, + } + + if scoreDataInput[1] == '-' then + opponent.status = MatchGroupInputUtil.STATUS.FORFEIT + opponent.score = 0 + end + + return opponent +end + +return CustomMatchGroupInput diff --git a/components/match2/wikis/freefire/match_legacy.lua b/components/match2/wikis/freefire/match_legacy.lua new file mode 100644 index 00000000000..23eb17db4b2 --- /dev/null +++ b/components/match2/wikis/freefire/match_legacy.lua @@ -0,0 +1,44 @@ +--- +-- @Liquipedia +-- wiki=freefire +-- page=Module:Match/Legacy +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local MatchLegacy = {} + +local DisplayHelper = require('Module:MatchGroup/Display/Helper') +local Json = require('Module:Json') +local String = require('Module:StringUtils') +local Table = require('Module:Table') + + +function MatchLegacy.storeMatch(match2) + for gameIndex, game2 in ipairs(match2.match2games or {}) do + local match = Table.deepCopy(match2) + local g2extradata = Json.parseIfString(game2.extradata) or {} + + match.date = game2.date + match.vod = game2.vod + match.dateexact = g2extradata.dateexact + match.finished = String.isNotEmpty(game2.winner) + match.staticid = match2.match2id .. '_' .. gameIndex + + -- Handle extradata fields + local bracketData = Json.parseIfString(match2.match2bracketdata) + if type(bracketData) == 'table' and bracketData.inheritedheader then + match.header = (DisplayHelper.expandHeader(bracketData.inheritedheader) or {})[1] + end + local m1extradata = {} + + m1extradata.map = game2.map + m1extradata.round = tostring(gameIndex) + + match.extradata = mw.ext.LiquipediaDB.lpdb_create_json(m1extradata) + + mw.ext.LiquipediaDB.lpdb_match('legacymatch_' .. match2.match2id .. '_' .. gameIndex, match) + end +end + +return MatchLegacy diff --git a/components/match2/wikis/freefire/match_summary.lua b/components/match2/wikis/freefire/match_summary.lua new file mode 100644 index 00000000000..47fc15baca7 --- /dev/null +++ b/components/match2/wikis/freefire/match_summary.lua @@ -0,0 +1,64 @@ +--- +-- @Liquipedia +-- wiki=freefire +-- page=Module:MatchSummary +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +local CustomMatchSummary = {} + +local Array = require('Module:Array') +local FnUtil = require('Module:FnUtil') +local Lua = require('Module:Lua') + +local MatchGroupUtil = Lua.import('Module:MatchGroup/Util') +local SummaryHelper = Lua.import('Module:MatchSummary/Ffa') + +local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/Ffa/All') +local HtmlWidgets = Lua.import('Module:Widget/Html/All') + +---@class FreefireMatchGroupUtilMatch: MatchGroupUtilMatch +---@field games ApexMatchGroupUtilGame[] + +---@param props {bracketId: string, matchId: string} +---@return Widget +function CustomMatchSummary.getByMatchId(props) + ---@class ApexMatchGroupUtilMatch + local match = MatchGroupUtil.fetchMatchForBracketDisplay(props.bracketId, props.matchId) + CustomMatchSummary._opponents(match) + local scoringData = SummaryHelper.createScoringData(match) + + return HtmlWidgets.Fragment{children = { + MatchSummaryWidgets.Header{matchId = match.matchId, games = match.games}, + MatchSummaryWidgets.Tab{ + matchId = match.matchId, + idx = 0, + children = { + MatchSummaryWidgets.GamesSchedule{games = match.games}, + MatchSummaryWidgets.PointsDistribution{killScore = scoringData.kill, placementScore = scoringData.placement}, + SummaryHelper.standardMatch(match), + } + } + }} +end + +---@param match table +function CustomMatchSummary._opponents(match) + -- Add games opponent data to the match opponent + Array.forEach(match.opponents, function (opponent, idx) + opponent.games = Array.map(match.games, function (game) + return game.opponents[idx] + end) + end) + + -- Sort match level based on final placement & score + Array.sortInPlaceBy(match.opponents, FnUtil.identity, SummaryHelper.placementSortFunction) + + -- Set the status of the current placement + Array.forEach(match.opponents, function(opponent, idx) + opponent.placementStatus = match.extradata.status[idx] + end) +end + +return CustomMatchSummary diff --git a/components/match2/wikis/pubg/brkts_wiki_specific.lua b/components/match2/wikis/pubg/brkts_wiki_specific.lua deleted file mode 100644 index ffb991d3538..00000000000 --- a/components/match2/wikis/pubg/brkts_wiki_specific.lua +++ /dev/null @@ -1,24 +0,0 @@ ---- --- @Liquipedia --- wiki=pubg --- page=Module:Brkts/WikiSpecific --- --- Please see https://github.com/Liquipedia/Lua-Modules to contribute --- - -local Lua = require('Module:Lua') -local Table = require('Module:Table') - -local BaseWikiSpecific = Lua.import('Module:Brkts/WikiSpecific/Base') - ----@class PubgBrktsWikiSpecific: BrktsWikiSpecific -local WikiSpecific = Table.copy(BaseWikiSpecific) - ----@param matchGroupType string ----@return function -function WikiSpecific.getMatchGroupContainer(matchGroupType) - local Horizontallist = Lua.import('Module:MatchGroup/Display/Horizontallist') - return Horizontallist.BracketContainer -end - -return WikiSpecific diff --git a/components/match2/wikis/pubg/match_group_input_custom.lua b/components/match2/wikis/pubg/match_group_input_custom.lua index 60ad0e6f42b..f8605b912a4 100644 --- a/components/match2/wikis/pubg/match_group_input_custom.lua +++ b/components/match2/wikis/pubg/match_group_input_custom.lua @@ -8,6 +8,7 @@ local Array = require('Module:Array') local Json = require('Module:Json') +local Logic = require('Module:Logic') local Lua = require('Module:Lua') local Operator = require('Module:Operator') local Table = require('Module:Table') @@ -76,7 +77,7 @@ function MatchFunctions.calculateMatchScore(opponents, maps) return function(opponentIndex) return Array.reduce(Array.map(maps, function(map) return map.opponents[opponentIndex].score or 0 - end), Operator.add, 0) + end), Operator.add, 0) + (opponents[opponentIndex].extradata.startingpoints or 0) end end @@ -105,6 +106,9 @@ function MatchFunctions.parseSettings(match) return { score = scoreSettings, status = statusSettings, + settings = { + showGameDetails = Logic.nilOr(Logic.readBoolOrNil(match.showgamedetails), true), + } } end @@ -117,6 +121,7 @@ function MatchFunctions.getExtraData(match, games, opponents, settings) return { scoring = settings.score, status = settings.status, + settings = settings.settings, } end diff --git a/components/match2/wikis/pubgmobile/brkts_wiki_specific.lua b/components/match2/wikis/pubgmobile/brkts_wiki_specific.lua deleted file mode 100644 index 7ee89b54b48..00000000000 --- a/components/match2/wikis/pubgmobile/brkts_wiki_specific.lua +++ /dev/null @@ -1,24 +0,0 @@ ---- --- @Liquipedia --- wiki=pubgmobile --- page=Module:Brkts/WikiSpecific --- --- Please see https://github.com/Liquipedia/Lua-Modules to contribute --- - -local Lua = require('Module:Lua') -local Table = require('Module:Table') - -local BaseWikiSpecific = Lua.import('Module:Brkts/WikiSpecific/Base') - ----@class PubgmBrktsWikiSpecific: BrktsWikiSpecific -local WikiSpecific = Table.copy(BaseWikiSpecific) - ----@param matchGroupType string ----@return function -function WikiSpecific.getMatchGroupContainer(matchGroupType) - local Horizontallist = Lua.import('Module:MatchGroup/Display/Horizontallist') - return Horizontallist.BracketContainer -end - -return WikiSpecific diff --git a/components/match2/wikis/pubgmobile/match_group_input_custom.lua b/components/match2/wikis/pubgmobile/match_group_input_custom.lua index 800896226dc..b20be9549de 100644 --- a/components/match2/wikis/pubgmobile/match_group_input_custom.lua +++ b/components/match2/wikis/pubgmobile/match_group_input_custom.lua @@ -8,6 +8,7 @@ local Array = require('Module:Array') local Json = require('Module:Json') +local Logic = require('Module:Logic') local Lua = require('Module:Lua') local Operator = require('Module:Operator') local Table = require('Module:Table') @@ -76,7 +77,7 @@ function MatchFunctions.calculateMatchScore(opponents, maps) return function(opponentIndex) return Array.reduce(Array.map(maps, function(map) return map.opponents[opponentIndex].score or 0 - end), Operator.add, 0) + end), Operator.add, 0) + (opponents[opponentIndex].extradata.startingpoints or 0) end end @@ -105,6 +106,9 @@ function MatchFunctions.parseSettings(match) return { score = scoreSettings, status = statusSettings, + settings = { + showGameDetails = Logic.nilOr(Logic.readBoolOrNil(match.showgamedetails), true), + } } end @@ -117,6 +121,7 @@ function MatchFunctions.getExtraData(match, games, opponents, settings) return { scoring = settings.score, status = settings.status, + settings = settings.settings, } end diff --git a/stylesheets/commons/BattleRoyale/PanelTable.less b/stylesheets/commons/BattleRoyale/PanelTable.less index c670b324ec5..0f22e302e0e 100644 --- a/stylesheets/commons/BattleRoyale/PanelTable.less +++ b/stylesheets/commons/BattleRoyale/PanelTable.less @@ -231,6 +231,15 @@ Author(s): Elysienna background-color: var( --table-background-color, #ffffff ); } } + + &-total-points { + flex: 1 0 100%; + display: flex; + justify-content: center; + align-items: center; + padding: 0.5rem 0; + background-color: var( --table-background-color, #fafafa ); + } } &-game {