Skip to content

Commit

Permalink
feat(match2): Make Match Point commons handling for all BR/FFA (#5155)
Browse files Browse the repository at this point in the history
* mpe to commons (needed on 3+ wikis)

* fix spelling
  • Loading branch information
Rathoz authored Dec 2, 2024
1 parent 1243648 commit b73df16
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 299 deletions.
28 changes: 27 additions & 1 deletion components/match2/commons/match_summary_ffa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ local STATUS_ICONS = {
stay = 'standings_stay',
staydown = 'standings_staydown',
down = 'standings_down',

-- Special Status for Match Point matches
trophy = 'firstplace',
matchpoint = 'matchpoint',
}

local MATCH_OVERVIEW_COLUMNS = {
Expand Down Expand Up @@ -127,6 +131,29 @@ local MATCH_OVERVIEW_COLUMNS = {
end,
},
},
{
sortable = true,
sortType = 'match-points',
class = 'cell--match-points',
icon = 'matchpoint',
show = function(match)
return match.matchPointThreshold
end,
header = {
value = 'MPe Game',
mobileValue = 'MPe',
},
sortVal = {
value = function (opponent, idx)
return opponent.matchPointReachedIn or 999 -- High number that should not be exceeded
end,
},
row = {
value = function (opponent, idx)
return opponent.matchPointReachedIn and "Game " .. opponent.matchPointReachedIn or nil
end,
},
},
}
local GAME_OVERVIEW_COLUMNS = {
{
Expand Down Expand Up @@ -169,7 +196,6 @@ local GAME_OVERVIEW_COLUMNS = {
},
},
}

local GAME_STANDINGS_COLUMNS = {
{
sortable = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function MatchFunctions.parseSettings(match)
-- Score Settings
local scoreSettings = {
kill = tonumber(match.p_kill) or 1,
matchPointThreadhold = tonumber(match.matchpoint),
matchPointThreshold = tonumber(match.matchpoint),
placement = Array.mapIndexes(function(idx)
return match['opponent' .. idx] and (tonumber(match['p' .. idx]) or 0) or nil
end)
Expand Down
Loading

0 comments on commit b73df16

Please sign in to comment.