-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
204 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=tft | ||
-- page=Module:GameSummary | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local CustomGameSummary = {} | ||
|
||
local Lua = require('Module:Lua') | ||
|
||
local MatchGroupUtil = Lua.import('Module:MatchGroup/Util') | ||
|
||
local SummaryHelper = Lua.import('Module:MatchSummary/Base/Ffa') | ||
local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/Ffa/All') | ||
|
||
---@class ArenaFpsFfaMatchGroupUtilGame: MatchGroupUtilGame | ||
---@field stream table | ||
|
||
---@param props {bracketId: string, matchId: string, gameIdx: integer} | ||
---@return Html | ||
function CustomGameSummary.getGameByMatchId(props) | ||
---@class ArenaFpsFfaMatchGroupUtilMatch | ||
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 | ||
|
||
SummaryHelper.updateGameOpponents(game, match.opponents) | ||
local scoringData = SummaryHelper.createScoringData(match) | ||
|
||
return MatchSummaryWidgets.Tab{ | ||
matchId = match.matchId, | ||
idx = props.gameIdx, | ||
children = { | ||
MatchSummaryWidgets.GameDetails{game = game}, | ||
MatchSummaryWidgets.PointsDistribution{scores = scoringData}, | ||
SummaryHelper.standardGame(game) | ||
} | ||
} | ||
end | ||
|
||
return CustomGameSummary |
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
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,44 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=tft | ||
-- page=Module:MatchSummary/Ffa | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local CustomMatchSummary = {} | ||
|
||
local Lua = require('Module:Lua') | ||
|
||
local MatchGroupUtil = Lua.import('Module:MatchGroup/Util') | ||
local SummaryHelper = Lua.import('Module:MatchSummary/Base/Ffa') | ||
|
||
local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/Ffa/All') | ||
local HtmlWidgets = Lua.import('Module:Widget/Html/All') | ||
|
||
---@class ArenaFpsFfaMatchGroupUtilMatch: MatchGroupUtilMatch | ||
---@field games ArenaFpsFfaMatchGroupUtilGame[] | ||
|
||
---@param props {bracketId: string, matchId: string} | ||
---@return Widget | ||
function CustomMatchSummary.getByMatchId(props) | ||
---@class ArenaFpsFfaMatchGroupUtilMatch | ||
local match = MatchGroupUtil.fetchMatchForBracketDisplay(props.bracketId, props.matchId) | ||
SummaryHelper.updateMatchOpponents(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{scores = scoringData}, | ||
SummaryHelper.standardMatch(match), | ||
} | ||
} | ||
}} | ||
end | ||
|
||
return CustomMatchSummary |