mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +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,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
},
|
},
|
||||||
GetBackground(textures, false),
|
CreateBackground(),
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -48,7 +47,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(LocalisationEngine localisation, TextureStore textures)
|
private void load(LocalisationEngine localisation)
|
||||||
{
|
{
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
@ -57,7 +56,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
},
|
},
|
||||||
GetBackground(textures, true),
|
CreateBackground(),
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -34,23 +34,25 @@ namespace osu.Game.Overlays.Direct
|
|||||||
return icons;
|
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,
|
||||||
Anchor = Anchor.Centre,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Origin = Anchor.Centre,
|
FillMode = FillMode.Fill,
|
||||||
RelativeSizeAxes = Axes.Both,
|
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
||||||
FillMode = FillMode.Fill,
|
})
|
||||||
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
|
{
|
||||||
}) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 };
|
RelativeSizeAxes = Axes.Both,
|
||||||
}
|
TimeBeforeLoad = 300
|
||||||
|
};
|
||||||
|
|
||||||
public class Statistic : FillFlowContainer
|
public class Statistic : FillFlowContainer
|
||||||
{
|
{
|
||||||
private readonly SpriteText text;
|
private readonly SpriteText text;
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
get { return value; }
|
get { return value; }
|
||||||
@ -91,19 +93,18 @@ 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)
|
string resource = set.OnlineInfo.Covers.Card;
|
||||||
Texture = textures.Get(doubleSize ? set.OnlineInfo.Covers.Card2X : set.OnlineInfo.Covers.Card);
|
|
||||||
|
if (resource != null)
|
||||||
|
Texture = textures.Get(resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user