Add "Select" action

Allows progressing forwards in the interface
This commit is contained in:
Dean Herbert
2018-07-03 18:37:21 +09:00
parent 5f33ab579e
commit 5fc17bacf3
6 changed files with 44 additions and 30 deletions

View File

@ -11,7 +11,6 @@ using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Threading;
using osu.Game.Graphics;
@ -139,26 +138,15 @@ namespace osu.Game.Screens.Menu
sampleBack = audio.Sample.Get(@"Menu/button-back-select");
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Repeat) return false;
switch (args.Key)
{
case Key.Space:
logo?.TriggerOnClick(state);
return true;
}
return false;
}
public bool OnPressed(GlobalAction action)
{
switch (action)
{
case GlobalAction.Back:
return goBack();
case GlobalAction.Select:
logo?.TriggerOnClick();
return true;
default:
return false;
}