Skip to content

Commit

Permalink
Add option to force display of a Bracket as a matchList (#3276)
Browse files Browse the repository at this point in the history
* Add option to forceDisplay a Bracket as a matchList

* break line

* Update match_group.lua
  • Loading branch information
hjpalpha authored Sep 14, 2023
1 parent 4da5372 commit 8b112d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/match2/commons/match_group.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
local Arguments = require('Module:Arguments')
local Array = require('Module:Array')
local FeatureFlag = require('Module:FeatureFlag')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local Table = require('Module:Table')
local WarningBox = require('Module:WarningBox')

local DisplayHelper = Lua.import('Module:MatchGroup/Display/Helper', {requireDevIfEnabled = true})
local Match = Lua.import('Module:Match', {requireDevIfEnabled = true})
local MatchGroupBase = Lua.import('Module:MatchGroup/Base', {requireDevIfEnabled = true})
local MatchGroupConfig = Lua.loadDataIfExists('Module:MatchGroup/Config')
Expand Down Expand Up @@ -93,6 +95,14 @@ function MatchGroup.MatchGroupById(args)

local matchGroupType = matches[1].bracketData.type

if Logic.readBool(args.forceMatchList) then
matchGroupType = 'matchlist'
Array.forEach(matches, function(match)
match.bracketData.header = match.bracketData.header
and DisplayHelper.expandHeader(match.bracketData.header)[1] or nil
end)
end

local config
if matchGroupType == 'matchlist' then
local MatchlistDisplay = Lua.import('Module:MatchGroup/Display/Matchlist', {requireDevIfEnabled = true})
Expand Down

0 comments on commit 8b112d4

Please sign in to comment.