Use 2x size covers in list view

This commit is contained in:
DrabWeb 2017-06-07 12:15:11 -03:00
parent ddc4d45ae8
commit d541006134
3 changed files with 8 additions and 6 deletions

View File

@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Direct
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black, Colour = Color4.Black,
}, },
GetBackground(textures), GetBackground(textures, false),
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Direct
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black, Colour = Color4.Black,
}, },
GetBackground(textures), GetBackground(textures, true),
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -34,9 +34,9 @@ namespace osu.Game.Overlays.Direct
return icons; return icons;
} }
protected Drawable GetBackground(TextureStore textures) protected Drawable GetBackground(TextureStore textures, bool doubleSize)
{ {
return new AsyncLoadWrapper(new BeatmapSetBackgroundSprite(SetInfo) return new AsyncLoadWrapper(new BeatmapSetBackgroundSprite(SetInfo, doubleSize)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -90,17 +90,19 @@ namespace osu.Game.Overlays.Direct
private class BeatmapSetBackgroundSprite : Sprite private class BeatmapSetBackgroundSprite : Sprite
{ {
private readonly BeatmapSetInfo set; private readonly BeatmapSetInfo set;
private readonly bool doubleSize;
public BeatmapSetBackgroundSprite(BeatmapSetInfo set) public BeatmapSetBackgroundSprite(BeatmapSetInfo set, bool doubleSize)
{ {
this.set = set; this.set = set;
this.doubleSize = doubleSize;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TextureStore textures) private void load(TextureStore textures)
{ {
if (set.OnlineInfo?.Covers?.Card != null) if (set.OnlineInfo?.Covers?.Card != null)
Texture = textures.Get(set.OnlineInfo.Covers.Card); Texture = textures.Get(doubleSize ? set.OnlineInfo.Covers.Card2x : set.OnlineInfo.Covers.Card);
} }
} }
} }