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,8 +13,7 @@ using osu.Game.Rulesets.UI;
using System;
using System.Linq;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input.EventArgs;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Mods
@ -149,20 +148,20 @@ namespace osu.Game.Overlays.Mods
public virtual Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex);
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
protected override bool OnMouseDown(MouseDownEvent e)
{
scaleContainer.ScaleTo(0.9f, 800, Easing.Out);
return base.OnMouseDown(state, args);
return base.OnMouseDown(e);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
protected override bool OnMouseUp(MouseUpEvent e)
{
scaleContainer.ScaleTo(1, 500, Easing.OutElastic);
// only trigger the event if we are inside the area of the button
if (Contains(ToScreenSpace(state.Mouse.Position - Position)))
{
switch (args.Button)
switch (e.Button)
{
case MouseButton.Left:
SelectNext(1);

View File

@ -10,8 +10,7 @@ using osu.Game.Rulesets.Mods;
using System;
using System.Linq;
using System.Collections.Generic;
using osu.Framework.Input.EventArgs;
using osu.Framework.Input.States;
using osu.Framework.Input.Events;
namespace osu.Game.Overlays.Mods
{
@ -55,16 +54,16 @@ namespace osu.Game.Overlays.Mods
private ModButton[] buttons = { };
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
protected override bool OnKeyDown(KeyDownEvent e)
{
if (ToggleKeys != null)
{
var index = Array.IndexOf(ToggleKeys, args.Key);
var index = Array.IndexOf(ToggleKeys, e.Key);
if (index > -1 && index < buttons.Length)
buttons[index].SelectNext(state.Keyboard.ShiftPressed ? -1 : 1);
}
return base.OnKeyDown(state, args);
return base.OnKeyDown(e);
}
public void DeselectAll() => DeselectTypes(buttons.Select(b => b.SelectedMod?.GetType()).Where(t => t != null));