diff --git a/osu.Game.Tests/Visual/Editing/TestSceneSubmissionStageProgress.cs b/osu.Game.Tests/Visual/Editing/TestSceneSubmissionStageProgress.cs index ee22cbda71..2dc9077a14 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneSubmissionStageProgress.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneSubmissionStageProgress.cs @@ -68,6 +68,25 @@ namespace osu.Game.Tests.Visual.Editing progress.SetInProgress(incrementingProgress += RNG.NextSingle(0.08f)); }, 0, true); }); + AddStep("increase progress slowly then fail", () => + { + incrementingProgress = 0; + + ScheduledDelegate? task = null; + + task = Scheduler.AddDelayed(() => + { + if (incrementingProgress >= 1) + { + progress.SetFailed("nope"); + // ReSharper disable once AccessToModifiedClosure + task?.Cancel(); + return; + } + + progress.SetInProgress(incrementingProgress += RNG.NextSingle(0.001f)); + }, 0, true); + }); AddUntilStep("wait for completed", () => incrementingProgress >= 1); AddStep("completed", () => progress.SetCompleted()); diff --git a/osu.Game/Screens/Edit/Submission/SubmissionStageProgress.cs b/osu.Game/Screens/Edit/Submission/SubmissionStageProgress.cs index 8af4e3fe52..e7f8ff933d 100644 --- a/osu.Game/Screens/Edit/Submission/SubmissionStageProgress.cs +++ b/osu.Game/Screens/Edit/Submission/SubmissionStageProgress.cs @@ -263,6 +263,7 @@ namespace osu.Game.Screens.Edit.Submission iconContainer.Colour = colours.Red1; iconContainer.FlashColour(Colour4.White, 1000, Easing.OutQuint); errorSample?.Play(); + progressSampleChannel?.Stop(); break; case StageStatusType.Canceled: @@ -274,6 +275,7 @@ namespace osu.Game.Screens.Edit.Submission iconContainer.Colour = colours.Gray8; iconContainer.FlashColour(Colour4.White, 1000, Easing.OutQuint); cancelSample?.Play(); + progressSampleChannel?.Stop(); break; } }