Revert "Auto assign hotkeys for BeatmapOptionsButton."

This reverts commit beb0a8ff03.
This commit is contained in:
Huo Yaoyuan
2017-03-14 21:13:57 +08:00
parent e1cc74bb40
commit c939897a8a
4 changed files with 20 additions and 23 deletions

View File

@ -3,6 +3,7 @@
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -48,6 +49,8 @@ namespace osu.Game.Screens.Select.Options
set { secondLine.Text = value; }
}
public Key? HotKey;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
flash.FadeTo(0.1f, 1000, EasingTypes.OutQuint);
@ -69,6 +72,17 @@ namespace osu.Game.Screens.Select.Options
return base.OnClick(state);
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (!args.Repeat && args.Key == HotKey)
{
OnClick(state);
return true;
}
return false;
}
public override bool Contains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
public BeatmapOptionsButton()