mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
BeatmapSetCover can display other types of covers now
This commit is contained in:
parent
7b1083b824
commit
fe7f9cccaa
@ -11,21 +11,44 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
public class BeatmapSetCover : Sprite
|
public class BeatmapSetCover : Sprite
|
||||||
{
|
{
|
||||||
private readonly BeatmapSetInfo set;
|
private readonly BeatmapSetInfo set;
|
||||||
public BeatmapSetCover(BeatmapSetInfo set)
|
private readonly BeatmapSetCoverType type;
|
||||||
|
|
||||||
|
public BeatmapSetCover(BeatmapSetInfo set, BeatmapSetCoverType type = BeatmapSetCoverType.Cover)
|
||||||
{
|
{
|
||||||
if (set == null)
|
if (set == null)
|
||||||
throw new ArgumentNullException(nameof(set));
|
throw new ArgumentNullException(nameof(set));
|
||||||
|
|
||||||
this.set = set;
|
this.set = set;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textures)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
string resource = set.OnlineInfo.Covers.Cover;
|
string resource = null;
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case BeatmapSetCoverType.Cover:
|
||||||
|
resource = set.OnlineInfo.Covers.Cover;
|
||||||
|
break;
|
||||||
|
case BeatmapSetCoverType.Card:
|
||||||
|
resource = set.OnlineInfo.Covers.Card;
|
||||||
|
break;
|
||||||
|
case BeatmapSetCoverType.List:
|
||||||
|
resource = set.OnlineInfo.Covers.List;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (resource != null)
|
if (resource != null)
|
||||||
Texture = textures.Get(resource);
|
Texture = textures.Get(resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum BeatmapSetCoverType
|
||||||
|
{
|
||||||
|
Cover,
|
||||||
|
Card,
|
||||||
|
List,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user