mirror of
https://github.com/ppy/osu
synced 2025-04-01 22:48:33 +00:00
Continue confirming when rehovering if mouse is still down
This commit is contained in:
parent
d30d054b4c
commit
94d6ab1ec7
@ -57,6 +57,7 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
private Sample confirmSample;
|
private Sample confirmSample;
|
||||||
private double lastTickPlaybackTime;
|
private double lastTickPlaybackTime;
|
||||||
private AudioFilter lowPassFilter = null!;
|
private AudioFilter lowPassFilter = null!;
|
||||||
|
private bool mouseDown;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
@ -83,6 +84,7 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
{
|
{
|
||||||
BeginConfirm();
|
BeginConfirm();
|
||||||
|
mouseDown = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,14 +94,23 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
{
|
{
|
||||||
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
|
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
|
||||||
AbortConfirm();
|
AbortConfirm();
|
||||||
|
mouseDown = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
if (mouseDown)
|
||||||
|
BeginConfirm();
|
||||||
|
|
||||||
|
return base.OnHover(e);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(HoverLostEvent e)
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
{
|
{
|
||||||
base.OnHoverLost(e);
|
base.OnHoverLost(e);
|
||||||
|
|
||||||
if (!e.HasAnyButtonPressed) return;
|
if (!mouseDown) return;
|
||||||
|
|
||||||
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
|
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
|
||||||
AbortConfirm();
|
AbortConfirm();
|
||||||
|
Loading…
Reference in New Issue
Block a user