Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(match2) Add map points input to Halo #4793

Merged
merged 8 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions components/match2/wikis/halo/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ end
function MapFunctions.getExtraData(map, opponentCount)
return {
comment = map.comment,
points1 = map.points1,
hjpalpha marked this conversation as resolved.
Show resolved Hide resolved
points2 = map.points2,
}
end

Expand Down
23 changes: 21 additions & 2 deletions components/match2/wikis/halo/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,33 @@ function CustomMatchSummary._createMapRow(game)
centerNode:addClass('brkts-popup-spaced-map-skip')
end

local displayScore = function(opponentIndex)
local score = DisplayHelper.MapScore(
game.scores[opponentIndex],
opponentIndex,
game.resultType,
game.walkover,
game.winner
)
local points = game.extradata['points' .. opponentIndex]
if not points then
return score
end
local flipped = opponentIndex == 2
if flipped then
return '(' .. points .. ') ' .. score
end
return score .. ' (' .. points .. ')'
mbergen marked this conversation as resolved.
Show resolved Hide resolved
end

local leftNode = mw.html.create('div')
:addClass('brkts-popup-spaced')
:node(CustomMatchSummary._addCheckmark(game.winner == 1))
:node(DisplayHelper.MapScore(game.scores[1], 1, game.resultType, game.walkover, game.winner))
:node(displayScore(1))

local rightNode = mw.html.create('div')
:addClass('brkts-popup-spaced')
:node(DisplayHelper.MapScore(game.scores[2], 2, game.resultType, game.walkover, game.winner))
:node(displayScore(2))
:node(CustomMatchSummary._addCheckmark(game.winner == 2))

row:addElement(leftNode)
Expand Down
Loading