protected override Drawable CreateDrawable(BeatmapInfo model)
        {
            return(new DelayedLoadUnloadWrapper(() => {
                Drawable drawable;

                var localBeatmap = beatmaps.GetWorkingBeatmap(model);

                if (localBeatmap.BeatmapInfo.ID == 0 && model?.BeatmapSet?.OnlineInfo != null)
                {
                    drawable = new BeatmapSetCover(model.BeatmapSet);
                }
                else
                {
                    drawable = new BeatmapBackgroundSprite(localBeatmap);
                }

                drawable.RelativeSizeAxes = Axes.Both;
                drawable.Anchor = Anchor.Centre;
                drawable.Origin = Anchor.Centre;
                drawable.FillMode = FillMode.Fill;
                drawable.OnLoadComplete = d => d.FadeInFromZero(400);

                return drawable;
            }, 500, 10000));
        }
Пример #2
0
        protected override Drawable CreateDrawable(BeatmapInfo model)
        {
            Drawable drawable;

            var localBeatmap = beatmaps.GetWorkingBeatmap(model);

            if (model?.BeatmapSet?.OnlineInfo != null)
            {
                drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
            }
            else if (localBeatmap.BeatmapInfo.ID != 0)
            {
                // Fall back to local background if one exists
                drawable = new BeatmapBackgroundSprite(localBeatmap);
            }
            else
            {
                // Use the default background if somehow an online set does not exist and we don't have a local copy.
                drawable = new BeatmapBackgroundSprite(beatmaps.DefaultBeatmap);
            }

            drawable.RelativeSizeAxes = Axes.Both;
            drawable.Anchor           = Anchor.Centre;
            drawable.Origin           = Anchor.Centre;
            drawable.FillMode         = FillMode.Fill;
            drawable.OnLoadComplete   = d => d.FadeInFromZero(400);

            return(drawable);
        }