Allow top-level menu key pressed to progress the osu! logo

This commit is contained in:
Dean Herbert
2019-09-22 20:30:58 +09:00
parent cdf29b0952
commit fc1d49631a
2 changed files with 19 additions and 3 deletions

View File

@ -14,6 +14,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Threading;
@ -180,6 +181,20 @@ namespace osu.Game.Screens.Menu
State = ButtonSystemState.Initial;
}
protected override bool OnKeyDown(KeyDownEvent e)
{
if (State == ButtonSystemState.Initial)
{
if (buttonsTopLevel.Any(b => e.PressedKeys.Contains(b.TriggerKey)))
{
logo.Click();
return true;
}
}
return base.OnKeyDown(e);
}
public bool OnPressed(GlobalAction action)
{
switch (action)