Use beatmap card in solo spectator screen

This commit is contained in:
Bartłomiej Dach 2021-10-24 19:44:32 +02:00
parent ec2265d5bb
commit a188d6662f
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
1 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,7 @@
using osu.Framework.Threading;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables.Cards;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
@ -20,7 +21,7 @@
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Spectator;
using osu.Game.Overlays.BeatmapListing.Panels;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets;
using osu.Game.Screens.OnlinePlay.Match.Components;
@ -52,6 +53,9 @@ public class SoloSpectator : SpectatorScreen, IPreviewTrackOwner
[Resolved]
private BeatmapModelDownloader beatmapDownloader { get; set; }
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
private Container beatmapPanelContainer;
private TriangleButton watchButton;
private SettingsCheckbox automaticDownload;
@ -73,7 +77,7 @@ public SoloSpectator([NotNull] APIUser targetUser)
}
[BackgroundDependencyLoader]
private void load(OsuColour colours, OsuConfigManager config)
private void load(OsuConfigManager config)
{
InternalChild = new Container
{
@ -88,7 +92,7 @@ private void load(OsuColour colours, OsuConfigManager config)
{
new Box
{
Colour = colours.GreySeafoamDark,
Colour = colourProvider.Background5,
RelativeSizeAxes = Axes.Both,
},
new FillFlowContainer
@ -229,7 +233,7 @@ private void showBeatmapPanel(SpectatorState state)
onlineBeatmapRequest.Success += beatmapSet => Schedule(() =>
{
this.beatmapSet = beatmapSet;
beatmapPanelContainer.Child = new GridBeatmapPanel(this.beatmapSet);
beatmapPanelContainer.Child = new BeatmapCard(this.beatmapSet);
checkForAutomaticDownload();
});