mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Allow starting maps by clicking an active panel a second time.
This commit is contained in:
@ -16,7 +16,8 @@ using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
class BeatmapPanel : Panel
|
||||
@ -25,6 +26,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
private Sprite background;
|
||||
|
||||
public Action<BeatmapPanel> GainedSelection;
|
||||
public Action<BeatmapPanel> StartRequested;
|
||||
|
||||
Color4 deselectedColour = new Color4(20, 43, 51, 255);
|
||||
|
||||
@ -45,6 +47,14 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
background.Colour = deselectedColour;
|
||||
}
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
if (State == PanelSelectedState.Selected)
|
||||
StartRequested?.Invoke(this);
|
||||
|
||||
return base.OnClick(state);
|
||||
}
|
||||
|
||||
public BeatmapPanel(BeatmapInfo beatmap)
|
||||
{
|
||||
Beatmap = beatmap;
|
||||
|
Reference in New Issue
Block a user