Merge pull request #5734 from smoogipoo/non-frame-stable-editor

Disable frame-stable playback in the editor

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-08-16 21:12:25 +09:00 committed by GitHub
commit 8258c4a80a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 1 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
@ -57,7 +58,12 @@ namespace osu.Game.Rulesets.Edit
this.drawableRuleset = drawableRuleset;
InternalChild = drawableRuleset;
}
[BackgroundDependencyLoader]
private void load()
{
drawableRuleset.FrameStablePlayback = false;
Playfield.DisplayJudgements.Value = false;
}

View File

@ -62,6 +62,15 @@ namespace osu.Game.Rulesets.UI
public override GameplayClock FrameStableClock => frameStabilityContainer.GameplayClock;
/// <summary>
/// Whether to enable frame-stable playback.
/// </summary>
internal bool FrameStablePlayback
{
get => frameStabilityContainer.FrameStablePlayback;
set => frameStabilityContainer.FrameStablePlayback = value;
}
/// <summary>
/// Invoked when a <see cref="JudgementResult"/> has been applied by a <see cref="DrawableHitObject"/>.
/// </summary>

View File

@ -24,6 +24,11 @@ namespace osu.Game.Rulesets.UI
/// </summary>
public int MaxCatchUpFrames { get; set; } = 5;
/// <summary>
/// Whether to enable frame-stable playback.
/// </summary>
internal bool FrameStablePlayback = true;
[Cached]
public GameplayClock GameplayClock { get; }
@ -113,7 +118,13 @@ namespace osu.Game.Rulesets.UI
try
{
if (firstConsumption)
if (!FrameStablePlayback)
{
manualClock.CurrentTime = newProposedTime;
requireMoreUpdateLoops = false;
return;
}
else if (firstConsumption)
{
// On the first update, frame-stability seeking would result in unexpected/unwanted behaviour.
// Instead we perform an initial seek to the proposed time.