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

@ -16,7 +16,7 @@ using System.ComponentModel;
using osu.Game.Graphics;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using RectangleF = osu.Framework.Graphics.Primitives.RectangleF;
using Container = osu.Framework.Graphics.Containers.Container;
@ -175,12 +175,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override bool OnClick(ClickEvent e) => true;
protected override void OnFocus(InputState state)
protected override void OnFocus(FocusEvent e)
{
if (form != null) GetContainingInputManager().ChangeFocus(form);
base.OnFocus(state);
base.OnFocus(e);
}
private class LoginForm : FillFlowContainer
@ -244,9 +244,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override bool OnClick(ClickEvent e) => true;
protected override void OnFocus(InputState state)
protected override void OnFocus(FocusEvent e)
{
Schedule(() => { GetContainingInputManager().ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
}

View File

@ -5,7 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
@ -124,18 +124,18 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private bool isDragging;
protected override bool OnDragStart(InputState state)
protected override bool OnDragStart(DragStartEvent e)
{
isDragging = true;
return base.OnDragStart(state);
return base.OnDragStart(e);
}
protected override bool OnDragEnd(InputState state)
protected override bool OnDragEnd(DragEndEvent e)
{
isDragging = false;
Current.TriggerChange();
return base.OnDragEnd(state);
return base.OnDragEnd(e);
}
public override string TooltipText => Current.Disabled ? "Enable raw input to adjust sensitivity" : Current.Value.ToString(@"0.##x");

View File

@ -12,8 +12,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.EventArgs;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;
@ -168,25 +167,25 @@ namespace osu.Game.Overlays.Settings
public string TooltipText => "Revert to default";
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
protected override bool OnMouseDown(MouseDownEvent e) => true;
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) => true;
protected override bool OnMouseUp(MouseUpEvent e) => true;
protected override bool OnClick(InputState state)
protected override bool OnClick(ClickEvent e)
{
if (bindable != null && !bindable.Disabled)
bindable.SetDefault();
return true;
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
hovering = true;
UpdateState();
return false;
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
hovering = false;
UpdateState();

View File

@ -9,7 +9,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Framework.Threading;
using osu.Game.Overlays.Toolbar;
@ -55,25 +55,25 @@ namespace osu.Game.Overlays.Settings
private ScheduledDelegate expandEvent;
private ExpandedState state;
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
queueExpandIfHovering();
return true;
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
expandEvent?.Cancel();
lastHoveredButton = null;
State = ExpandedState.Contracted;
base.OnHoverLost(state);
base.OnHoverLost(e);
}
protected override bool OnMouseMove(InputState state)
protected override bool OnMouseMove(MouseMoveEvent e)
{
queueExpandIfHovering();
return base.OnMouseMove(state);
return base.OnMouseMove(e);
}
private class SidebarScrollContainer : ScrollContainer

View File

@ -10,7 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -109,22 +109,22 @@ namespace osu.Game.Overlays.Settings
selectionIndicator.Colour = colours.Yellow;
}
protected override bool OnClick(InputState state)
protected override bool OnClick(ClickEvent e)
{
Action?.Invoke(section);
return base.OnClick(state);
return base.OnClick(e);
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
Background.FadeTo(0.4f, 200);
return base.OnHover(state);
return base.OnHover(e);
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
Background.FadeTo(0, 200);
base.OnHoverLost(state);
base.OnHoverLost(e);
}
}
}