Add support card size tab control to beatmap listing

This commit is contained in:
Bartłomiej Dach
2021-11-27 17:53:57 +01:00
parent 1876617d8e
commit d0427ec85f
2 changed files with 26 additions and 10 deletions

View File

@ -33,7 +33,7 @@ namespace osu.Game.Overlays
private Drawable currentContent;
private Container panelTarget;
private FillFlowContainer<BeatmapCardNormal> foundContent;
private FillFlowContainer<BeatmapCard> foundContent;
private NotFoundDrawable notFoundContent;
private SupporterRequiredDrawable supporterRequiredContent;
private BeatmapListingFilterControl filterControl;
@ -78,7 +78,7 @@ namespace osu.Game.Overlays
Padding = new MarginPadding { Horizontal = 20 },
Children = new Drawable[]
{
foundContent = new FillFlowContainer<BeatmapCardNormal>(),
foundContent = new FillFlowContainer<BeatmapCard>(),
notFoundContent = new NotFoundDrawable(),
supporterRequiredContent = new SupporterRequiredDrawable(),
}
@ -135,11 +135,11 @@ namespace osu.Game.Overlays
return;
}
var newPanels = searchResult.Results.Select(b => new BeatmapCardNormal(b)
var newPanels = searchResult.Results.Select(b => BeatmapCard.Create(b, filterControl.CardSize.Value).With(card =>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
});
card.Anchor = Anchor.TopCentre;
card.Origin = Anchor.TopCentre;
}));
if (filterControl.CurrentPage == 0)
{
@ -152,7 +152,7 @@ namespace osu.Game.Overlays
// spawn new children with the contained so we only clear old content at the last moment.
// reverse ID flow is required for correct Z-ordering of the cards' expandable content (last card should be front-most).
var content = new ReverseChildIDFillFlowContainer<BeatmapCardNormal>
var content = new ReverseChildIDFillFlowContainer<BeatmapCard>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,