Implemented beatmap options overlay

This commit is contained in:
DrabWeb
2017-03-02 08:40:55 -04:00
parent 35c920d04b
commit b856fb5991
10 changed files with 422 additions and 4 deletions

View File

@ -28,6 +28,7 @@ using OpenTK.Input;
using System.Collections.Generic;
using osu.Framework.Threading;
using osu.Game.Overlays;
using osu.Game.Overlays.BeatmapOptions;
namespace osu.Game.Screens.Select
{
@ -52,6 +53,7 @@ namespace osu.Game.Screens.Select
private List<BeatmapGroup> beatmapGroups;
private BeatmapOptionsOverlay beatmapOptions;
private Footer footer;
OsuScreen player;
@ -125,6 +127,20 @@ namespace osu.Game.Screens.Select
Right = 20,
},
},
beatmapOptions = new BeatmapOptionsOverlay
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
OnRemoveFromUnplayed = null,
OnClearLocalScores = null,
OnEdit = null,
OnDelete = promptDelete,
Margin = new MarginPadding
{
Bottom = 50,
},
},
footer = new Footer
{
OnBack = Exit,
@ -144,7 +160,7 @@ namespace osu.Game.Screens.Select
footer.AddButton(@"mods", colours.Yellow, null);
footer.AddButton(@"random", colours.Green, carousel.SelectRandom);
footer.AddButton(@"options", colours.Blue, null);
footer.AddButton(@"options", colours.Blue, beatmapOptions.ToggleVisibility);
if (osuGame != null)
{
@ -394,6 +410,12 @@ namespace osu.Game.Screens.Select
filterChanged();
}
private void promptDelete()
{
if (Beatmap != null)
dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap));
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
switch (args.Key)
@ -404,9 +426,7 @@ namespace osu.Game.Screens.Select
case Key.Delete:
if (state.Keyboard.ShiftPressed)
{
if (Beatmap != null)
dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap));
promptDelete();
return true;
}
break;