diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index af4483251d..604c4aae28 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -24,6 +24,7 @@ using OpenTK.Graphics; using osu.Game.Screens.Play; using osu.Framework; using osu.Game.Beatmaps.Drawables; +using osu.Game.Graphics.Containers; namespace osu.Game.Screens.Select { @@ -35,7 +36,6 @@ namespace osu.Game.Screens.Select private CarouselContainer carousel; private TrackManager trackManager; - private Container backgroundWedgesContainer; private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 225); 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 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), + }, + }; + } + } + /// Optionally provide a database to use instead of the OsuGame one. public PlaySongSelect(BeatmapDatabase database = null) { this.database = database; - const float scrollWidth = 640; + const float carouselWidth = 640; const float bottomToolHeight = 50; Children = new Drawable[] { - backgroundWedgesContainer = new Container + new ParallaxContainer { + ParallaxAmount = 0.005f, RelativeSizeAxes = Axes.Both, - Size = Vector2.One, - Padding = new MarginPadding { Right = scrollWidth }, - Children = new[] + Children = new [] { - new Box + new WedgeBackground { 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), + Padding = new MarginPadding { Right = carouselWidth * 0.76f }, }, } }, carousel = new CarouselContainer { RelativeSizeAxes = Axes.Y, - Size = new Vector2(scrollWidth, 1), + Size = new Vector2(carouselWidth, 1), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, },