Auto assign hotkeys for BeatmapOptionsButton.

This commit is contained in:
Huo Yaoyuan
2017-03-14 20:36:11 +08:00
parent 35a60a8f7d
commit beb0a8ff03
4 changed files with 23 additions and 20 deletions

View File

@ -3,7 +3,6 @@
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -49,8 +48,6 @@ 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);
@ -72,17 +69,6 @@ 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()