Disable frame-stable playback in the editor

This commit is contained in:
smoogipoo
2019-08-15 18:25:31 +09:00
parent 918701be44
commit 8c67f58e2d
3 changed files with 23 additions and 0 deletions

View File

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

View File

@ -62,6 +62,15 @@ namespace osu.Game.Rulesets.UI
public override GameplayClock FrameStableClock => frameStabilityContainer.GameplayClock; 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> /// <summary>
/// Invoked when a <see cref="JudgementResult"/> has been applied by a <see cref="DrawableHitObject"/>. /// Invoked when a <see cref="JudgementResult"/> has been applied by a <see cref="DrawableHitObject"/>.
/// </summary> /// </summary>

View File

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