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): use ffa base ms on starcraft(2) #5207

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
efbd975
feat(match2): use ffa base ms on starcraft(2)
hjpalpha Dec 14, 2024
5eb1af0
rename var
hjpalpha Dec 14, 2024
26b0fe8
unused import
hjpalpha Dec 14, 2024
cf7579c
double to single quote
hjpalpha Dec 14, 2024
1ea456b
switch to fix
hjpalpha Dec 14, 2024
914bea5
only show countdown in header if games actually have dates
hjpalpha Dec 14, 2024
bf86c1e
not needed anymore
hjpalpha Dec 14, 2024
02442c6
linter: unused var
hjpalpha Dec 14, 2024
3ef7b95
unused import
hjpalpha Dec 14, 2024
c31c77a
missed to replace that
hjpalpha Dec 14, 2024
6e0f6aa
fix the display for with points
hjpalpha Dec 14, 2024
a931941
nill catches in standard ffa game
hjpalpha Dec 14, 2024
7da23b7
game summary
hjpalpha Dec 14, 2024
8ba58cd
make GameStandingsColumns adjustable
hjpalpha Dec 14, 2024
bd2c0e3
sc(2) adjustGameStandingsColumns
hjpalpha Dec 14, 2024
10159e0
unused import
hjpalpha Dec 14, 2024
5af121c
as per review
hjpalpha Dec 16, 2024
094fdd6
from review
hjpalpha Dec 16, 2024
5de7261
update smoke on apex
hjpalpha Dec 16, 2024
8ec98c3
as per review move function to commons
hjpalpha Dec 16, 2024
9f33433
not needed
hjpalpha Dec 16, 2024
9711340
linter: unused import
hjpalpha Dec 16, 2024
740bd64
fix anno
hjpalpha Dec 16, 2024
83d257f
as per review use MatchSummaryFfa.schedule in all customs
hjpalpha Dec 16, 2024
45c9170
smoke
hjpalpha Dec 16, 2024
851d289
Merge branch 'main' into sc2-ffa-ms-use-base
hjpalpha Dec 19, 2024
46a28af
noscore into settings
hjpalpha Dec 19, 2024
97de033
refacto schedule/countdown stuff as mentioned in screenshot
hjpalpha Dec 19, 2024
0266c64
linter:unused import
hjpalpha Dec 19, 2024
8ce6221
fixerino
hjpalpha Dec 19, 2024
39e5b49
smoke
hjpalpha Dec 19, 2024
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
17 changes: 17 additions & 0 deletions components/match2/commons/match_summary_base_ffa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
local Array = require('Module:Array')
local FnUtil = require('Module:FnUtil')
local Lua = require('Module:Lua')
local Operator = require('Module:Operator')
local Table = require('Module:Table')

local OpponentLibraries = require('Module:OpponentLibraries')
Expand Down Expand Up @@ -627,4 +628,20 @@ function MatchSummaryFfa.updateGameOpponents(game, matchOpponents)
Array.sortInPlaceBy(game.opponents, FnUtil.identity, MatchSummaryFfa.placementSortFunction)
end

---@param match StarcraftMatchGroupUtilMatch
hjpalpha marked this conversation as resolved.
Show resolved Hide resolved
---@return Widget
function MatchSummaryFfa.schedule(match)
hjpalpha marked this conversation as resolved.
Show resolved Hide resolved
if MatchSummaryFfa.gamesHaveDifferentDates(match) then
return MatchSummaryWidgets.GamesSchedule{games = match.games}
end
return MatchSummaryWidgets.MatchSchedule{match = match}
end

---@param match StarcraftMatchGroupUtilMatch
---@return boolean
function MatchSummaryFfa.gamesHaveDifferentDates(match)
local dates = Array.map(match.games, Operator.property('date'))
return Array.any(dates, function(date) return date ~= match.date end)
end

return MatchSummaryFfa
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,13 @@ function StarcraftMatchSummaryFfa.getByMatchId(props)
matchId = match.matchId,
idx = 0,
children = {
StarcraftMatchSummaryFfa._schedule(match),
BaseMatchSummary.schedule(match),
BaseMatchSummary.standardMatch(match, Parser),
}
}
}}
end

---@param match StarcraftMatchGroupUtilMatch
---@return Widget
function StarcraftMatchSummaryFfa._schedule(match)
if StarcraftMatchSummaryFfa._gamesHaveDates(match) then
return MatchSummaryWidgets.GamesSchedule{games = match.games}
end
return MatchSummaryWidgets.MatchSchedule{match = match}
end

---@param match StarcraftMatchGroupUtilMatch
---@return boolean
function StarcraftMatchSummaryFfa._gamesHaveDates(match)
local dates = Array.map(match.games, Operator.property('date'))
return Array.any(dates, function(date) return date ~= match.date end)
end

---@param columns table[]
---@return table[]
function Parser.adjustMatchColumns(columns)
Expand Down Expand Up @@ -117,7 +101,7 @@ function Parser.gameHeader(match, game, gameIndex)
}
}
},
StarcraftMatchSummaryFfa._gamesHaveDates(match) and MatchSummaryWidgets.GameCountdown{game = game} or nil,
BaseMatchSummary.gamesHaveDifferentDates(match) and MatchSummaryWidgets.GameCountdown{game = game} or nil,
}
end

Expand Down