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 4 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 @@ -177,6 +177,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
25 changes: 23 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,35 @@ function CustomMatchSummary._createMapRow(game)
centerNode:addClass('brkts-popup-spaced-map-skip')
end

local getScoreValue = function(opponentIndex)
hjpalpha marked this conversation as resolved.
Show resolved Hide resolved
local score = game.scores[opponentIndex]
mbergen marked this conversation as resolved.
Show resolved Hide resolved
if not score then
return
end
mbergen marked this conversation as resolved.
Show resolved Hide resolved
local points = game.extradata['points' .. opponentIndex]
if not points then
return score
end
if opponentIndex == 2 then
mbergen marked this conversation as resolved.
Show resolved Hide resolved
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(DisplayHelper.MapScore(
getScoreValue(1),
1, game.resultType, game.walkover, game.winner
))
mbergen marked this conversation as resolved.
Show resolved Hide resolved

local rightNode = mw.html.create('div')
:addClass('brkts-popup-spaced')
:node(DisplayHelper.MapScore(game.scores[2], 2, game.resultType, game.walkover, game.winner))
:node(DisplayHelper.MapScore(
getScoreValue(2),
2, game.resultType, game.walkover, game.winner
))
mbergen marked this conversation as resolved.
Show resolved Hide resolved
:node(CustomMatchSummary._addCheckmark(game.winner == 2))

row:addElement(leftNode)
Expand Down
Loading