Skip to content

Commit

Permalink
game summary
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpalpha committed Dec 14, 2024
1 parent a931941 commit 7da23b7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
-- @Liquipedia
-- wiki=commons
-- page=Module:GameSummary/Starcraft/FFa
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local CustomGameSummary = {}

local Lua = require('Module:Lua')

local MatchGroupUtil = Lua.import('Module:MatchGroup/Util/Starcraft')

local SummaryHelper = Lua.import('Module:MatchSummary/Base/Ffa')
local MatchSummaryWidgets = Lua.import('Module:Widget/Match/Summary/Ffa/All')

---@param props {bracketId: string, matchId: string, gameIdx: integer}
---@return Html
function CustomGameSummary.getGameByMatchId(props)
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)

return MatchSummaryWidgets.Tab{
matchId = match.matchId,
idx = props.gameIdx,
children = {
MatchSummaryWidgets.GameDetails{game = game},
SummaryHelper.standardGame(game)
}
}
end

return CustomGameSummary
13 changes: 13 additions & 0 deletions components/match2/wikis/starcraft/game_summary.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
-- @Liquipedia
-- wiki=starcraft
-- page=Module:GameSummary
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Lua = require('Module:Lua')

local StarcraftFfaGameSummary = Lua.import('Module:GameSummary/Starcraft/FFa')

return StarcraftFfaGameSummary
13 changes: 13 additions & 0 deletions components/match2/wikis/starcraft2/game_summary.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
-- @Liquipedia
-- wiki=starcraft2
-- page=Module:GameSummary
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Lua = require('Module:Lua')

local StarcraftFfaGameSummary = Lua.import('Module:GameSummary/Starcraft/FFa')

return StarcraftFfaGameSummary

0 comments on commit 7da23b7

Please sign in to comment.