mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Rename usages which rely on online backing
This commit is contained in:
57
osu.Game/Beatmaps/Drawables/OnlineBeatmapSetCover.cs
Normal file
57
osu.Game/Beatmaps/Drawables/OnlineBeatmapSetCover.cs
Normal file
@ -0,0 +1,57 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
[LongRunningLoad]
|
||||
public class OnlineBeatmapSetCover : Sprite
|
||||
{
|
||||
private readonly IBeatmapSetOnlineInfo set;
|
||||
private readonly BeatmapSetCoverType type;
|
||||
|
||||
public OnlineBeatmapSetCover(IBeatmapSetOnlineInfo set, BeatmapSetCoverType type = BeatmapSetCoverType.Cover)
|
||||
{
|
||||
if (set == null)
|
||||
throw new ArgumentNullException(nameof(set));
|
||||
|
||||
this.set = set;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LargeTextureStore textures)
|
||||
{
|
||||
string resource = null;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case BeatmapSetCoverType.Cover:
|
||||
resource = set.Covers.Cover;
|
||||
break;
|
||||
|
||||
case BeatmapSetCoverType.Card:
|
||||
resource = set.Covers.Card;
|
||||
break;
|
||||
|
||||
case BeatmapSetCoverType.List:
|
||||
resource = set.Covers.List;
|
||||
break;
|
||||
}
|
||||
|
||||
if (resource != null)
|
||||
Texture = textures.Get(resource);
|
||||
}
|
||||
}
|
||||
|
||||
public enum BeatmapSetCoverType
|
||||
{
|
||||
Cover,
|
||||
Card,
|
||||
List,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user