mirror of
https://github.com/ppy/osu.git
synced 2026-05-21 03:39:53 +08:00
Merge pull request #26381 from Joehuu/flash-ongoing-operations-dialog
Flash blocking ongoing operations dialog when trying to force quit
This commit is contained in:
@@ -799,11 +799,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
});
|
||||
});
|
||||
|
||||
AddStep("attempt exit", () =>
|
||||
{
|
||||
for (int i = 0; i < 2; ++i)
|
||||
Game.ScreenStack.CurrentScreen.Exit();
|
||||
});
|
||||
AddRepeatStep("attempt force exit", () => Game.ScreenStack.CurrentScreen.Exit(), 2);
|
||||
AddUntilStep("stopped at exit confirm", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is ConfirmExitDialog);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
private readonly Vector2 ringMinifiedSize = new Vector2(20f);
|
||||
|
||||
private readonly Box flashLayer;
|
||||
private Sample flashSample = null!;
|
||||
private Sample? flashSample;
|
||||
|
||||
private readonly Container content;
|
||||
private readonly Container ring;
|
||||
@@ -267,7 +267,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
flashLayer.FadeInFromZero(80, Easing.OutQuint)
|
||||
.Then()
|
||||
.FadeOutFromOne(1500, Easing.OutQuint);
|
||||
flashSample.Play();
|
||||
flashSample?.Play();
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
@@ -25,6 +26,7 @@ using osu.Game.Input.Bindings;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Dialog;
|
||||
using osu.Game.Overlays.SkinEditor;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
@@ -390,7 +392,12 @@ namespace osu.Game.Screens.Menu
|
||||
if (requiresConfirmation)
|
||||
{
|
||||
if (dialogOverlay.CurrentDialog is ConfirmExitDialog exitDialog)
|
||||
exitDialog.PerformOkAction();
|
||||
{
|
||||
if (exitDialog.Buttons.OfType<PopupDialogOkButton>().FirstOrDefault() != null)
|
||||
exitDialog.PerformOkAction();
|
||||
else
|
||||
exitDialog.Flash();
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogOverlay.Push(new ConfirmExitDialog(() =>
|
||||
|
||||
Reference in New Issue
Block a user