Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local INDENT = WikiCopyPaste.Indent

function WikiCopyPaste.getMatchCode(bestof, mode, index, opponents, args)
local showScore = Logic.nilOr(Logic.readBoolOrNil, bestof == 0)
local bans = Logic.readBool(args.bans)
local bans = tonumber(args.bans)

local lines = Array.extend(
'{{Match|bestof=' .. (bestof ~= 0 and bestof or ''),
Expand All @@ -40,17 +40,27 @@ function WikiCopyPaste.getMatchCode(bestof, mode, index, opponents, args)
end

---@param mapIndex integer
---@param bans boolean
---@param bans integer
---@return string
function WikiCopyPaste._getMapCode(mapIndex, bans)
banBool = false
ban1Text = ""
ban2Text = ""
if bans > 0 then
banBool = true
for ban = 1, bans do
ban1Text = ban1Text .. "|t1b" .. ban .. "="
ban2Text = ban2Text .. "|t2b" .. ban .. "="
end
end

@hjpalpha hjpalpha Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kick the stuff you added here and rather use something like this

	---@param opponentIndex integer
	---@return string?
	local bans = function(opponentIndex)
		if bans <= 0 then
			return
		end
		return INDENT .. INDENT .. table.concat(Array.mapRange(1, bans, function(banIndex)
			return '|t' .. opponentIndex .. 'b' .. banIndex .. '='
		end))
	end

return table.concat(Array.extend(
INDENT .. '|map' .. mapIndex .. '={{Map',
INDENT .. INDENT .. '|team1side=',
INDENT .. INDENT .. '|t1h1=|t1h2=|t1h3=|t1h4=|t1h5=|t1h6=',
bans and (INDENT .. INDENT .. '|t1b1=|t1b2=|t1b3=|t1b4=|t1b5=|t1b6=') or nil,
banBool and (INDENT .. INDENT .. ban1Text) or nil,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
banBool and (INDENT .. INDENT .. ban1Text) or nil,
bans(1),

INDENT .. INDENT .. '|team2side=',
INDENT .. INDENT .. '|t2h1=|t2h2=|t2h3=|t2h4=|t2h5=|t2h6=',
bans and (INDENT .. INDENT .. '|t2b1=|t2b2=|t2b3=|t2b4=|t2b5=|t2b6=') or nil,
banBool and (INDENT .. INDENT .. ban2Text) or nil,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
banBool and (INDENT .. INDENT .. ban2Text) or nil,
bans(2),

INDENT .. INDENT .. '|length=|winner=|matchid=|vod=',
INDENT .. '}}'
), '\n')
Expand Down