1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-13 21:13:39 +08:00

Add flag to allow backwards seeks in tests

This commit is contained in:
Dean Herbert
2024-02-29 20:34:38 +08:00
Unverified
parent 3a780e2b67
commit 4184a5c1ef
12 changed files with 61 additions and 11 deletions
+20
View File
@@ -81,6 +81,19 @@ namespace osu.Game.Rulesets.UI
public override IFrameStableClock FrameStableClock => frameStabilityContainer;
private bool allowBackwardsSeeks;
public override bool AllowBackwardsSeeks
{
get => allowBackwardsSeeks;
set
{
allowBackwardsSeeks = value;
if (frameStabilityContainer != null)
frameStabilityContainer.AllowBackwardsSeeks = value;
}
}
private bool frameStablePlayback = true;
internal override bool FrameStablePlayback
@@ -178,6 +191,7 @@ namespace osu.Game.Rulesets.UI
InternalChild = frameStabilityContainer = new FrameStabilityContainer(GameplayStartTime)
{
FrameStablePlayback = FrameStablePlayback,
AllowBackwardsSeeks = AllowBackwardsSeeks,
Children = new Drawable[]
{
FrameStableComponents,
@@ -463,6 +477,12 @@ namespace osu.Game.Rulesets.UI
/// </summary>
internal abstract bool FrameStablePlayback { get; set; }
/// <summary>
/// When a replay is not attached, we usually block any backwards seeks.
/// This will bypass the check. Should only be used for tests.
/// </summary>
public abstract bool AllowBackwardsSeeks { get; set; }
/// <summary>
/// The mods which are to be applied.
/// </summary>