mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Implemented beatmap options overlay
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user