Use beatmap cards in beatmap listing overlay

This commit is contained in:
Bartłomiej Dach 2021-10-23 16:55:05 +02:00
parent 84a36ab4a9
commit 0f9ebe3d5d
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 7 additions and 8 deletions

View File

@ -119,7 +119,7 @@ namespace osu.Game.Overlays.BeatmapListing
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider) private void load(OverlayColourProvider colourProvider)
{ {
sortControlBackground.Colour = colourProvider.Background5; sortControlBackground.Colour = colourProvider.Background4;
} }
public void Search(string query) public void Search(string query)

View File

@ -15,12 +15,11 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Audio; using osu.Game.Audio;
using osu.Game.Beatmaps.Drawables.Cards;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays.BeatmapListing; using osu.Game.Overlays.BeatmapListing;
using osu.Game.Overlays.BeatmapListing.Panels;
using osu.Game.Resources.Localisation.Web; using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -34,7 +33,7 @@ namespace osu.Game.Overlays
private Drawable currentContent; private Drawable currentContent;
private Container panelTarget; private Container panelTarget;
private FillFlowContainer<BeatmapPanel> foundContent; private FillFlowContainer<BeatmapCard> foundContent;
private NotFoundDrawable notFoundContent; private NotFoundDrawable notFoundContent;
private SupporterRequiredDrawable supporterRequiredContent; private SupporterRequiredDrawable supporterRequiredContent;
private BeatmapListingFilterControl filterControl; private BeatmapListingFilterControl filterControl;
@ -69,7 +68,7 @@ namespace osu.Game.Overlays
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = ColourProvider.Background4, Colour = ColourProvider.Background5,
}, },
panelTarget = new Container panelTarget = new Container
{ {
@ -79,7 +78,7 @@ namespace osu.Game.Overlays
Padding = new MarginPadding { Horizontal = 20 }, Padding = new MarginPadding { Horizontal = 20 },
Children = new Drawable[] Children = new Drawable[]
{ {
foundContent = new FillFlowContainer<BeatmapPanel>(), foundContent = new FillFlowContainer<BeatmapCard>(),
notFoundContent = new NotFoundDrawable(), notFoundContent = new NotFoundDrawable(),
supporterRequiredContent = new SupporterRequiredDrawable(), supporterRequiredContent = new SupporterRequiredDrawable(),
} }
@ -136,7 +135,7 @@ namespace osu.Game.Overlays
return; return;
} }
var newPanels = searchResult.Results.Select<APIBeatmapSet, BeatmapPanel>(b => new GridBeatmapPanel(b) var newPanels = searchResult.Results.Select(b => new BeatmapCard(b)
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
@ -152,7 +151,7 @@ namespace osu.Game.Overlays
} }
// spawn new children with the contained so we only clear old content at the last moment. // spawn new children with the contained so we only clear old content at the last moment.
var content = new FillFlowContainer<BeatmapPanel> var content = new FillFlowContainer<BeatmapCard>
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,