1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 00:53:10 +08:00

Merge pull request #19063 from Joehuu/fix-samples-cancel-exit

Fix editor playing object samples while paused after cancelling exit
This commit is contained in:
Dan Balasescu 2022-07-12 12:51:27 +09:00 committed by GitHub
commit 3ca10ac02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -6,11 +6,13 @@
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Overlays;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose.Components.Timeline; using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
@ -23,7 +25,9 @@ namespace osu.Game.Tests.Visual.Editing
[Test] [Test]
public void TestCantExitWithoutSaving() public void TestCantExitWithoutSaving()
{ {
AddUntilStep("Wait for dialog overlay load", () => ((Drawable)Game.Dependencies.Get<IDialogOverlay>()).IsLoaded);
AddRepeatStep("Exit", () => InputManager.Key(Key.Escape), 10); AddRepeatStep("Exit", () => InputManager.Key(Key.Escape), 10);
AddAssert("Sample playback disabled", () => Editor.SamplePlaybackDisabled.Value);
AddAssert("Editor is still active screen", () => Game.ScreenStack.CurrentScreen is Editor); AddAssert("Editor is still active screen", () => Game.ScreenStack.CurrentScreen is Editor);
} }

View File

@ -921,7 +921,7 @@ namespace osu.Game.Screens.Edit
private void cancelExit() private void cancelExit()
{ {
samplePlaybackDisabled.Value = false; updateSampleDisabledState();
loader?.CancelPendingDifficultySwitch(); loader?.CancelPendingDifficultySwitch();
} }