Skip to content

Commit

Permalink
fix(match2): Clash Royale card display for duo opponents (#4731)
Browse files Browse the repository at this point in the history
* fix(match2): Clash Royale card display for duo opponents

* Remove whitespace
  • Loading branch information
mbergen authored Sep 14, 2024
1 parent d2a34c6 commit f29f216
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions components/match2/wikis/clashroyale/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,21 @@ function CustomMatchSummary._opponentCardsDisplay(args)
local date = args.date

local color = flip and CARD_COLOR_2 or CARD_COLOR_1
local wrapper = mw.html.create('div')
:css('flex-basis', '1px')
:css('display', 'inline-flex')
:css('flex-direction', (flip and 'row' or 'row-reverse'))
:css('align-items', 'center')

local wrapperCards = mw.html.create('div')
local sideWrapper = mw.html.create('div')
:css('display', 'flex')
:css('flex-direction', 'column')

for _, cardData in ipairs(cardDataSets) do
local wrapper = mw.html.create('div')
:css('flex-basis', '1px')
:css('display', 'inline-flex')
:css('flex-direction', (flip and 'row' or 'row-reverse'))
:css('align-items', 'center')
local wrapperCards = mw.html.create('div')
:css('display', 'flex')
:css('flex-direction', 'column')

local cardDisplays = {}
for _, card in ipairs(cardData) do
table.insert(cardDisplays, mw.html.create('div')
Expand Down Expand Up @@ -437,9 +441,11 @@ function CustomMatchSummary._opponentCardsDisplay(args)
})
wrapper:node(towerCardDisplay)
end

sideWrapper:node(wrapper)
end

return wrapper
return sideWrapper
end

return CustomMatchSummary

0 comments on commit f29f216

Please sign in to comment.