Add ability to abort dangerous dialog button on hover lost

This commit is contained in:
Joseph Madamba 2023-02-09 21:28:51 -08:00
parent 65bb3a5cad
commit d30d054b4c
2 changed files with 11 additions and 1 deletions

View File

@ -102,7 +102,7 @@ namespace osu.Game.Graphics.Containers
/// </summary>
protected void AbortConfirm()
{
if (!AllowMultipleFires && Fired) return;
if (!confirming || (!AllowMultipleFires && Fired)) return;
confirming = false;
Fired = false;

View File

@ -95,6 +95,16 @@ namespace osu.Game.Overlays.Dialog
}
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
if (!e.HasAnyButtonPressed) return;
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
AbortConfirm();
}
private void progressChanged(ValueChangedEvent<double> progress)
{
if (progress.NewValue < progress.OldValue) return;