From 8b112d47b218f6053a971d9394f068603e1664a4 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:14:33 +0200 Subject: [PATCH] Add option to force display of a Bracket as a matchList (#3276) * Add option to forceDisplay a Bracket as a matchList * break line * Update match_group.lua --- components/match2/commons/match_group.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/match2/commons/match_group.lua b/components/match2/commons/match_group.lua index 45a51202189..07a669320d1 100644 --- a/components/match2/commons/match_group.lua +++ b/components/match2/commons/match_group.lua @@ -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') @@ -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})