Change signature to new event handler

This commit is contained in:
ekrctb
2018-10-02 12:02:47 +09:00
parent 0d70306794
commit 99fc04c8af
110 changed files with 667 additions and 709 deletions

View File

@ -8,8 +8,7 @@ using OpenTK.Input;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.EventArgs;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.Containers;
@ -89,7 +88,7 @@ namespace osu.Game.Screens.Select
public Action HoverLost;
public Key? Hotkey;
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
Hovered?.Invoke();
light.ScaleTo(new Vector2(1, 2), Footer.TRANSITION_LENGTH, Easing.OutQuint);
@ -97,42 +96,42 @@ namespace osu.Game.Screens.Select
return true;
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
HoverLost?.Invoke();
light.ScaleTo(new Vector2(1, 1), Footer.TRANSITION_LENGTH, Easing.OutQuint);
light.FadeColour(DeselectedColour, Footer.TRANSITION_LENGTH, Easing.OutQuint);
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
protected override bool OnMouseDown(MouseDownEvent e)
{
box.FadeTo(0.3f, Footer.TRANSITION_LENGTH * 2, Easing.OutQuint);
return base.OnMouseDown(state, args);
return base.OnMouseDown(e);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
protected override bool OnMouseUp(MouseUpEvent e)
{
box.FadeOut(Footer.TRANSITION_LENGTH, Easing.OutQuint);
return base.OnMouseUp(state, args);
return base.OnMouseUp(e);
}
protected override bool OnClick(InputState state)
protected override bool OnClick(ClickEvent e)
{
box.ClearTransforms();
box.Alpha = 1;
box.FadeOut(Footer.TRANSITION_LENGTH * 3, Easing.OutQuint);
return base.OnClick(state);
return base.OnClick(e);
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
protected override bool OnKeyDown(KeyDownEvent e)
{
if (!args.Repeat && args.Key == Hotkey)
if (!e.Repeat && e.Key == Hotkey)
{
OnClick(state);
return true;
}
return base.OnKeyDown(state, args);
return base.OnKeyDown(e);
}
}
}