diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index a2855d55b5..9f2424028c 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -21,6 +21,7 @@ using osu.Game.Beatmaps.Drawable; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Beatmaps; using osu.Framework.GameModes; +using osu.Game.Graphics; namespace osu.Game.GameModes.Play { @@ -30,12 +31,12 @@ namespace osu.Game.GameModes.Play private BeatmapDatabase database; private BeatmapGroup selectedBeatmapGroup; private BeatmapInfo selectedBeatmapInfo; - // TODO: use currently selected track as bg - protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); private ScrollContainer scrollContainer; + private Button playButton; private FlowContainer beatmapSetFlow; private TrackManager trackManager; private Container wedgeContainer; + private Sprite background; /// Optionally provide a database to use instead of the OsuGame one. public PlaySongSelect(BeatmapDatabase database = null) @@ -44,13 +45,22 @@ namespace osu.Game.GameModes.Play const float scrollWidth = 640; const float bottomToolHeight = 50; + const float topToolHeight = 50; Children = new Drawable[] { + background = new Sprite { + RelativeSizeAxes = Axes.Both, + RelativePositionAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = Vector2.One, + Alpha = 0.5f, + }, wedgeContainer = new Container { RelativeSizeAxes = Axes.Both, Size = Vector2.One, - Padding = new MarginPadding { Right = scrollWidth - 200 }, + Padding = new MarginPadding { Right = scrollWidth - 200, Bottom = bottomToolHeight, Top = topToolHeight }, Children = new[] { new Box @@ -81,7 +91,7 @@ namespace osu.Game.GameModes.Play { beatmapSetFlow = new FlowContainer { - Padding = new MarginPadding { Left = 25, Top = 25, Bottom = 25 + bottomToolHeight }, + Padding = new MarginPadding { Left = 25, Top = topToolHeight, Bottom = 25 + bottomToolHeight }, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FlowDirection.VerticalOnly, @@ -103,7 +113,7 @@ namespace osu.Game.GameModes.Play Size = Vector2.One, Colour = new Color4(0, 0, 0, 0.5f), }, - new Button + playButton = new Button { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, @@ -116,6 +126,18 @@ namespace osu.Game.GameModes.Play PreferredPlayMode = playMode.Value }), }, + new Button + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + RelativeSizeAxes = Axes.Y, + Width = 100, + Text = "Back", + Colour = new Color4(238, 51, 153, 255), + Action = delegate { + Exit(); + } + } } } }; @@ -206,6 +228,7 @@ namespace osu.Game.GameModes.Play if (!beatmap.Equals(Beatmap?.BeatmapInfo)) { Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); + background.Texture = Beatmap.Background; } ensurePlayingSelected(); @@ -276,8 +299,10 @@ namespace osu.Game.GameModes.Play private void addBeatmapSets() { - foreach (var beatmapSet in database.Query()) - addBeatmapSet(beatmapSet); + if (database.Query().Count() > 0) + foreach (var beatmapSet in database.Query()) + addBeatmapSet(beatmapSet); + else playButton.Dispose(); // not sure about this } } }