Skip to content

Commit

Permalink
feat(match2): improve character pick and ban display
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Oct 17, 2024
1 parent 22335c3 commit 7bc6ff9
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 53 deletions.
10 changes: 4 additions & 6 deletions components/match2/wikis/heroes/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

-- Add the Map Vetoes
body:addRow(MatchSummary.defaultMapVetoDisplay(match, MapVeto()))
Expand Down
12 changes: 4 additions & 8 deletions components/match2/wikis/honorofkings/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

return body
end
Expand All @@ -106,8 +104,6 @@ function CustomMatchSummary._createGame(game, gameIndex, date)
championsData[2][champIndex] = extradata['team2champion' .. champIndex]
championsDataIsEmpty = false
end
championsData[1].color = extradata.team1side
championsData[2].color = extradata.team2side
end

if
Expand Down
10 changes: 4 additions & 6 deletions components/match2/wikis/leagueoflegends/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

return body
end
Expand Down
10 changes: 4 additions & 6 deletions components/match2/wikis/mobilelegends/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

return body
end
Expand Down
12 changes: 4 additions & 8 deletions components/match2/wikis/pokemon/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

return body
end
Expand All @@ -105,8 +103,6 @@ function CustomMatchSummary._createGame(game, gameIndex, date)
end
local championsData = Array.map(Array.range(1, 2), getChampsForTeam)--[[@as table]]
local championsDataIsEmpty = Array.all(championsData, Table.isEmpty)
championsData[1].color = extradata.team1side
championsData[2].color = extradata.team2side

if Table.isEmpty(game.scores) and Logic.isEmpty(game.winner) and championsDataIsEmpty then
return nil
Expand Down
12 changes: 4 additions & 8 deletions components/match2/wikis/smite/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

return body
end
Expand All @@ -95,8 +93,6 @@ function CustomMatchSummary._createGame(game, gameIndex, date)
if String.isNotEmpty(extradata['team2god' .. godIndex]) then
godsData[2][godIndex] = extradata['team2god' .. godIndex]
end
godsData[1].side = extradata.team1side
godsData[2].side = extradata.team2side
end

row:addClass('brkts-popup-body-game')
Expand Down
12 changes: 4 additions & 8 deletions components/match2/wikis/wildrift/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ function CustomMatchSummary.createBody(match)

-- Add the Character Bans
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS, NO_CHARACTER)
if characterBansData then
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})
end
body.root:node(MatchSummaryWidgets.CharacterBanTable{
bans = characterBansData,
date = match.date,
})

return body
end
Expand All @@ -105,8 +103,6 @@ function CustomMatchSummary._createGame(game, gameIndex)
championsData[2][champIndex] = extradata['team2champion' .. champIndex]
championsDataIsEmpty = false
end
championsData[1].color = extradata.team1side
championsData[2].color = extradata.team2side
end

if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ MatchSummaryCharacterBanTable.defaultProps = {

---@return Widget[]?
function MatchSummaryCharacterBanTable:render()
if not self.props.bans then
return nil
end
local rows = Array.map(self.props.bans, function(banData, gameNumber)
return Tr{
children = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ MatchSummaryCharacters.defaultProps = {

---@return Widget[]?
function MatchSummaryCharacters:render()
if not self.props.characters then
return nil
end
local flipped = self.props.flipped

return Div{
Expand Down
10 changes: 7 additions & 3 deletions stylesheets/commons/Brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -882,21 +882,24 @@
}

.brkts-champion-icon img {
height: auto;
height: 24px;
width: 24px;
object-fit: cover;
}

@media only screen and ( max-width: 768px ) {
img.brkts-champion-icon {
height: auto;
height: 20px;
width: 20px;
object-fit: cover;
}
}

@media ( max-width: 768px ) {
.brkts-champion-icon img {
height: auto;
height: 20px;
width: 20px;
object-fit: cover;
}
}

Expand All @@ -905,6 +908,7 @@
-ms-transform: scale( 2.5, 2.5 );
-webkit-transform: scale( 2.5, 2.5 );
transform: scale( 2.5, 2.5 );
object-fit: contain;
}
}

Expand Down

0 comments on commit 7bc6ff9

Please sign in to comment.