mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Allow user choice of the quick retry hotkey
This commit is contained in:
@ -8,11 +8,13 @@ using System;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Input.Bindings;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class HotkeyRetryOverlay : Container
|
||||
public class HotkeyRetryOverlay : Container, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
public Action Action;
|
||||
|
||||
@ -40,28 +42,20 @@ namespace osu.Game.Screens.Play
|
||||
};
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
public bool OnPressed(GlobalAction action)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
if (action != GlobalAction.QuickRetry) return false;
|
||||
|
||||
if (args.Key == Key.Tilde)
|
||||
{
|
||||
overlay.FadeIn(activate_delay, Easing.Out);
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(state, args);
|
||||
overlay.FadeIn(activate_delay, Easing.Out);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
|
||||
public bool OnReleased(GlobalAction action)
|
||||
{
|
||||
if (args.Key == Key.Tilde && !fired)
|
||||
{
|
||||
overlay.FadeOut(fadeout_delay, Easing.Out);
|
||||
return true;
|
||||
}
|
||||
if (action != GlobalAction.QuickRetry) return false;
|
||||
|
||||
return base.OnKeyUp(state, args);
|
||||
overlay.FadeOut(fadeout_delay, Easing.Out);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
Reference in New Issue
Block a user