1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Remove local background logic

This commit is contained in:
David Zhao 2019-03-05 15:33:39 +09:00
parent aecbc31ffa
commit 7c53c7b602

View File

@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers;
namespace osu.Game.Beatmaps.Drawables namespace osu.Game.Beatmaps.Drawables
{ {
/// <summary> /// <summary>
/// Display a baetmap background from a local source, but fallback to online source if not available. /// Display a beatmap background from an online source
/// </summary> /// </summary>
public class UpdateableBeatmapBackgroundSprite : ModelBackedDrawable<BeatmapInfo> public class UpdateableBeatmapBackgroundSprite : ModelBackedDrawable<BeatmapInfo>
{ {
@ -30,14 +30,10 @@ namespace osu.Game.Beatmaps.Drawables
{ {
return new DelayedLoadUnloadWrapper(() => return new DelayedLoadUnloadWrapper(() =>
{ {
Drawable drawable; if (model?.BeatmapSet?.OnlineInfo == null)
return null;
var localBeatmap = beatmaps.GetWorkingBeatmap(model); Drawable drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
if (localBeatmap.BeatmapInfo.ID == 0 && model?.BeatmapSet?.OnlineInfo != null)
drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
else
drawable = new BeatmapBackgroundSprite(localBeatmap);
drawable.RelativeSizeAxes = Axes.Both; drawable.RelativeSizeAxes = Axes.Both;
drawable.Anchor = Anchor.Centre; drawable.Anchor = Anchor.Centre;