Skip to content

Revert "Keep editor in frame stable mode when possible" #26521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ public void TestSelectAfterFadedOut()
moveMouseToObject(() => slider);

AddStep("seek after end", () => EditorClock.Seek(750));
AddUntilStep("wait for seek", () => !EditorClock.IsSeeking);
AddStep("left click", () => InputManager.Click(MouseButton.Left));
AddAssert("slider not selected", () => EditorBeatmap.SelectedHitObjects.Count == 0);

AddStep("seek to visible", () => EditorClock.Seek(650));
AddUntilStep("wait for seek", () => !EditorClock.IsSeeking);
AddStep("left click", () => InputManager.Click(MouseButton.Left));
AddUntilStep("slider selected", () => EditorBeatmap.SelectedHitObjects.Single() == slider);
}
Expand Down
21 changes: 1 addition & 20 deletions osu.Game/Rulesets/Edit/DrawableEditorRulesetWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.ObjectExtensions;
Expand All @@ -27,9 +26,6 @@ internal partial class DrawableEditorRulesetWrapper<TObject> : CompositeDrawable
[Resolved]
private EditorBeatmap beatmap { get; set; } = null!;

[Resolved]
private EditorClock editorClock { get; set; } = null!;

public DrawableEditorRulesetWrapper(DrawableRuleset<TObject> drawableRuleset)
{
this.drawableRuleset = drawableRuleset;
Expand All @@ -42,6 +38,7 @@ public DrawableEditorRulesetWrapper(DrawableRuleset<TObject> drawableRuleset)
[BackgroundDependencyLoader]
private void load()
{
drawableRuleset.FrameStablePlayback = false;
Playfield.DisplayJudgements.Value = false;
}

Expand All @@ -68,22 +65,6 @@ protected override void LoadComplete()
Scheduler.AddOnce(regenerateAutoplay);
}

protected override void Update()
{
base.Update();

// Whenever possible, we want to stay in frame stability playback.
// Without doing so, we run into bugs with some gameplay elements not behaving as expected.
//
// Note that this is not using EditorClock.IsSeeking as that would exit frame stability
// on all seeks. The intention here is to retain frame stability for small seeks.
//
// I still think no gameplay elements should require frame stability in the first place, but maybe that ship has sailed already..
bool shouldBypassFrameStability = Math.Abs(drawableRuleset.FrameStableClock.CurrentTime - editorClock.CurrentTime) > 1000;

drawableRuleset.FrameStablePlayback = !shouldBypassFrameStability;
}

private void regenerateAutoplay()
{
var autoplayMod = drawableRuleset.Mods.OfType<ModAutoplay>().Single();
Expand Down