Skip to content

Commit

Permalink
Add reworked MatchSummary (#3312)
Browse files Browse the repository at this point in the history
* add temp module

* remove annos in old one to avoid anno warnings in new one

* option to return both in `MatchGroupUtil.fetchMatchForBracketDisplay`

* line break

* Rework brawlstars MatchSummary

* improve vod order and simplify

* Update components/match2/wikis/brawlstars/match_summary.lua

Co-authored-by: Rikard Blixt <[email protected]>

---------

Co-authored-by: Rikard Blixt <[email protected]>
  • Loading branch information
hjpalpha and Rathoz authored Sep 25, 2023
1 parent bf9dfad commit a854354
Show file tree
Hide file tree
Showing 4 changed files with 693 additions and 93 deletions.
6 changes: 6 additions & 0 deletions components/match2/commons/match_group_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ function MatchGroupUtil.fetchMatchForBracketDisplay(bracketId, matchId, options)
if bracketResetMatch then
return MatchGroupUtil.mergeBracketResetMatch(match, bracketResetMatch)
end
elseif options.returnBoth then
local bracketResetMatch = match
and match.bracketData.bracketResetMatchId
and bracket.matchesById[match.bracketData.bracketResetMatchId]

return match, bracketResetMatch
end

return match
Expand Down
10 changes: 0 additions & 10 deletions components/match2/commons/match_summary_base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ function Footer:create()
return self.root
end

---MatchSummary Casters Class
---@class MatchSummaryCasters
---@operator call: MatchSummaryCasters
---@field root Html
---@field casters string[]
local Casters = Class.new(
function(self)
self.root = mw.html.create('div')
Expand All @@ -265,9 +260,6 @@ local Casters = Class.new(
end
)

---adds a casters display to thge casters list
---@param caster {name: string, displayName: string, flag: string?}?
---@return MatchSummaryCasters
function Casters:addCaster(caster)
if Logic.isNotEmpty(caster) then
---@cast caster -nil
Expand All @@ -282,8 +274,6 @@ function Casters:addCaster(caster)
return self
end

---creates the casters display
---@return Html
function Casters:create()
return self.root
:wikitext('Caster' .. (#self.casters > 1 and 's' or '') .. ': ')
Expand Down
Loading

0 comments on commit a854354

Please sign in to comment.