mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 16:03:01 +08:00
Move WedgeBackground to its own class and improve display a bit.
This commit is contained in:
parent
622b127180
commit
1e0b7dffc0
@ -24,6 +24,7 @@ using OpenTK.Graphics;
|
|||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -35,7 +36,6 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private CarouselContainer carousel;
|
private CarouselContainer carousel;
|
||||||
private TrackManager trackManager;
|
private TrackManager trackManager;
|
||||||
private Container backgroundWedgesContainer;
|
|
||||||
|
|
||||||
private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 225);
|
private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 225);
|
||||||
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
|
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
|
||||||
@ -45,46 +45,60 @@ namespace osu.Game.Screens.Select
|
|||||||
private static readonly Vector2 BACKGROUND_BLUR = new Vector2(20);
|
private static readonly Vector2 BACKGROUND_BLUR = new Vector2(20);
|
||||||
private CancellationTokenSource initialAddSetsTask;
|
private CancellationTokenSource initialAddSetsTask;
|
||||||
|
|
||||||
|
class WedgeBackground : Container
|
||||||
|
{
|
||||||
|
public WedgeBackground()
|
||||||
|
{
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Size = new Vector2(1, 0.5f),
|
||||||
|
Colour = new Color4(0, 0, 0, 0.5f),
|
||||||
|
Shear = new Vector2(0.15f, 0),
|
||||||
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
|
},
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
RelativePositionAxes = Axes.Y,
|
||||||
|
Size = new Vector2(1, -0.5f),
|
||||||
|
Position = new Vector2(0, 1),
|
||||||
|
Colour = new Color4(0, 0, 0, 0.5f),
|
||||||
|
Shear = new Vector2(-0.15f, 0),
|
||||||
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <param name="database">Optionally provide a database to use instead of the OsuGame one.</param>
|
/// <param name="database">Optionally provide a database to use instead of the OsuGame one.</param>
|
||||||
public PlaySongSelect(BeatmapDatabase database = null)
|
public PlaySongSelect(BeatmapDatabase database = null)
|
||||||
{
|
{
|
||||||
this.database = database;
|
this.database = database;
|
||||||
|
|
||||||
const float scrollWidth = 640;
|
const float carouselWidth = 640;
|
||||||
const float bottomToolHeight = 50;
|
const float bottomToolHeight = 50;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
backgroundWedgesContainer = new Container
|
new ParallaxContainer
|
||||||
{
|
{
|
||||||
|
ParallaxAmount = 0.005f,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = Vector2.One,
|
Children = new []
|
||||||
Padding = new MarginPadding { Right = scrollWidth },
|
|
||||||
Children = new[]
|
|
||||||
{
|
{
|
||||||
new Box
|
new WedgeBackground
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = new Vector2(1, 0.5f),
|
Padding = new MarginPadding { Right = carouselWidth * 0.76f },
|
||||||
Colour = new Color4(0, 0, 0, 0.5f),
|
|
||||||
Shear = new Vector2(0.15f, 0),
|
|
||||||
EdgeSmoothness = new Vector2(2, 0),
|
|
||||||
},
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
RelativePositionAxes = Axes.Y,
|
|
||||||
Size = new Vector2(1, -0.5f),
|
|
||||||
Position = new Vector2(0, 1),
|
|
||||||
Colour = new Color4(0, 0, 0, 0.5f),
|
|
||||||
Shear = new Vector2(-0.15f, 0),
|
|
||||||
EdgeSmoothness = new Vector2(2, 0),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
carousel = new CarouselContainer
|
carousel = new CarouselContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Size = new Vector2(scrollWidth, 1),
|
Size = new Vector2(carouselWidth, 1),
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user