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

@ -13,7 +13,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Framework.Threading;
using osu.Game.Beatmaps;
@ -459,18 +459,18 @@ namespace osu.Game.Overlays
{
private Vector2 dragStart;
protected override bool OnDragStart(InputState state)
protected override bool OnDragStart(DragStartEvent e)
{
base.OnDragStart(state);
dragStart = state.Mouse.Position;
base.OnDragStart(e);
dragStart = e.Mouse.Position;
return true;
}
protected override bool OnDrag(InputState state)
protected override bool OnDrag(DragEvent e)
{
if (base.OnDrag(state)) return true;
if (base.OnDrag(e)) return true;
Vector2 change = state.Mouse.Position - dragStart;
Vector2 change = e.Mouse.Position - dragStart;
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
change *= change.Length <= 0 ? 0 : (float)Math.Pow(change.Length, 0.7f) / change.Length;
@ -479,10 +479,10 @@ namespace osu.Game.Overlays
return true;
}
protected override bool OnDragEnd(InputState state)
protected override bool OnDragEnd(DragEndEvent e)
{
this.MoveTo(Vector2.Zero, 800, Easing.OutElastic);
return base.OnDragEnd(state);
return base.OnDragEnd(e);
}
}
}