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:
commit
3ca10ac02c
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -921,7 +921,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
private void cancelExit()
|
private void cancelExit()
|
||||||
{
|
{
|
||||||
samplePlaybackDisabled.Value = false;
|
updateSampleDisabledState();
|
||||||
loader?.CancelPendingDifficultySwitch();
|
loader?.CancelPendingDifficultySwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user