mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Always load high resolution for now
Also rename GetBackground to CreateBackground, since it's returning a new instance.
This commit is contained in:
parent
2c1f3de47a
commit
3f2f42d13c
@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Direct
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
},
|
||||
GetBackground(textures, false),
|
||||
CreateBackground(),
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics.Containers;
|
||||
@ -48,7 +47,7 @@ namespace osu.Game.Overlays.Direct
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LocalisationEngine localisation, TextureStore textures)
|
||||
private void load(LocalisationEngine localisation)
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
@ -57,7 +56,7 @@ namespace osu.Game.Overlays.Direct
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.Black,
|
||||
},
|
||||
GetBackground(textures, true),
|
||||
CreateBackground(),
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -34,23 +34,25 @@ namespace osu.Game.Overlays.Direct
|
||||
return icons;
|
||||
}
|
||||
|
||||
protected Drawable GetBackground(TextureStore textures, bool doubleSize)
|
||||
protected Drawable CreateBackground() => new DelayedLoadWrapper(new BeatmapSetBackgroundSprite(SetInfo)
|
||||
{
|
||||
return new DelayedLoadWrapper(new BeatmapSetBackgroundSprite(SetInfo, doubleSize)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||
}) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 };
|
||||
}
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||
})
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
TimeBeforeLoad = 300
|
||||
};
|
||||
|
||||
public class Statistic : FillFlowContainer
|
||||
{
|
||||
private readonly SpriteText text;
|
||||
|
||||
private int value;
|
||||
|
||||
public int Value
|
||||
{
|
||||
get { return value; }
|
||||
@ -91,19 +93,18 @@ namespace osu.Game.Overlays.Direct
|
||||
private class BeatmapSetBackgroundSprite : Sprite
|
||||
{
|
||||
private readonly BeatmapSetInfo set;
|
||||
private readonly bool doubleSize;
|
||||
|
||||
public BeatmapSetBackgroundSprite(BeatmapSetInfo set, bool doubleSize)
|
||||
public BeatmapSetBackgroundSprite(BeatmapSetInfo set)
|
||||
{
|
||||
this.set = set;
|
||||
this.doubleSize = doubleSize;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
if (set.OnlineInfo?.Covers?.Card != null)
|
||||
Texture = textures.Get(doubleSize ? set.OnlineInfo.Covers.Card2X : set.OnlineInfo.Covers.Card);
|
||||
string resource = set.OnlineInfo.Covers.Card;
|
||||
|
||||
if (resource != null)
|
||||
Texture = textures.Get(resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user