-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(match2): Add non-BR support for PUBG Mobile (#5278)
* feat(match2): Add non-BR support for PUBG Mobile * Create match_summary * Update components/match2/wikis/pubgmobile/match_group_input_custom.lua Co-authored-by: Rikard Blixt <[email protected]> * Rename match_summary to match_summary.lua --------- Co-authored-by: Rikard Blixt <[email protected]>
- Loading branch information
1 parent
d45a1dd
commit 0f0c2c2
Showing
2 changed files
with
121 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=pubgmobile | ||
-- page=Module:MatchSummary | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Lua = require('Module:Lua') | ||
|
||
local DisplayHelper = Lua.import('Module:MatchGroup/Display/Helper') | ||
local MatchSummary = Lua.import('Module:MatchSummary/Base') | ||
local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/All') | ||
local WidgetUtil = Lua.import('Module:Widget/Util') | ||
|
||
local CustomMatchSummary = {} | ||
|
||
---@param args table | ||
---@return Html | ||
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) | ||
if not game.map then | ||
return | ||
end | ||
|
||
local function makeTeamSection(opponentIndex) | ||
return { | ||
MatchSummaryWidgets.GameWinLossIndicator{winner = game.winner, opponentIndex = opponentIndex}, | ||
DisplayHelper.MapScore(game.opponents[opponentIndex], game.status) | ||
} | ||
end | ||
|
||
return MatchSummaryWidgets.Row{ | ||
classes = {'brkts-popup-body-game'}, | ||
children = WidgetUtil.collect( | ||
MatchSummaryWidgets.GameTeamWrapper{children = makeTeamSection(1)}, | ||
MatchSummaryWidgets.GameCenter{children = DisplayHelper.Map(game)}, | ||
MatchSummaryWidgets.GameTeamWrapper{children = makeTeamSection(2), flipped = true}, | ||
MatchSummaryWidgets.GameComment{children = game.comment} | ||
) | ||
} | ||
end | ||
|
||
return CustomMatchSummary |