mirror of https://github.com/ppy/osu
Fall back to default background
This commit is contained in:
parent
7c53c7b602
commit
fc62877fdc
|
@ -30,10 +30,15 @@ protected override Drawable CreateDrawable(BeatmapInfo model)
|
|||
{
|
||||
return new DelayedLoadUnloadWrapper(() =>
|
||||
{
|
||||
if (model?.BeatmapSet?.OnlineInfo == null)
|
||||
return null;
|
||||
Drawable drawable;
|
||||
|
||||
Drawable drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
|
||||
if (model?.BeatmapSet?.OnlineInfo != null)
|
||||
drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
|
||||
else
|
||||
{
|
||||
// Use the default background if somehow an online set does not exist.
|
||||
drawable = new BeatmapBackgroundSprite(beatmaps.GetWorkingBeatmap(null));
|
||||
}
|
||||
|
||||
drawable.RelativeSizeAxes = Axes.Both;
|
||||
drawable.Anchor = Anchor.Centre;
|
||||
|
|
Loading…
Reference in New Issue