mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Change signature to new event handler
This commit is contained in:
@ -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);
|
||||
|
@ -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));
|
||||
|
Reference in New Issue
Block a user