mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge remote-tracking branch 'origin/master' into fix-more-pause-cases
# Conflicts: # osu.Game.Tests/Visual/Gameplay/TestCasePause.cs
This commit is contained in:
@ -73,6 +73,26 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
checkFrameCount(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestInitialSeekWithGameplayStart()
|
||||
{
|
||||
seekManualTo(1000);
|
||||
createStabilityContainer(30000);
|
||||
|
||||
confirmSeek(1000);
|
||||
checkFrameCount(0);
|
||||
|
||||
seekManualTo(10000);
|
||||
confirmSeek(10000);
|
||||
|
||||
checkFrameCount(1);
|
||||
|
||||
seekManualTo(130000);
|
||||
confirmSeek(130000);
|
||||
|
||||
checkFrameCount(6002);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestInitialSeek()
|
||||
{
|
||||
@ -83,7 +103,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
checkFrameCount(0);
|
||||
}
|
||||
|
||||
private void createStabilityContainer() => AddStep("create container", () => mainContainer.Child = new FrameStabilityContainer().WithChild(consumer = new ClockConsumingChild()));
|
||||
private const int max_frames_catchup = 50;
|
||||
|
||||
private void createStabilityContainer(double gameplayStartTime = double.MinValue) => AddStep("create container", () =>
|
||||
mainContainer.Child = new FrameStabilityContainer(gameplayStartTime) { MaxCatchUpFrames = max_frames_catchup }
|
||||
.WithChild(consumer = new ClockConsumingChild()));
|
||||
|
||||
private void seekManualTo(double time) => AddStep($"seek manual clock to {time}", () => manualClock.CurrentTime = time);
|
||||
|
||||
|
@ -6,6 +6,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Rulesets;
|
||||
@ -31,6 +32,14 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
base.Content.Add(content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both });
|
||||
}
|
||||
|
||||
[SetUpSteps]
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
base.SetUpSteps();
|
||||
AddStep("resume player", () => Player.GameplayClockContainer.Start());
|
||||
confirmClockRunning(true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPauseResume()
|
||||
{
|
||||
@ -197,6 +206,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
public bool FailOverlayVisible => FailOverlay.State == Visibility.Visible;
|
||||
|
||||
public bool PauseOverlayVisible => PauseOverlay.State == Visibility.Visible;
|
||||
|
||||
public override void OnEntering(IScreen last)
|
||||
{
|
||||
base.OnEntering(last);
|
||||
GameplayClockContainer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user