-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26382 from peppy/editor-more-frame-stable
Keep editor in frame stable mode when possible
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
osu.Game.Rulesets.Osu.Tests/Editor/TestSceneEditorAutoplayFastStreams.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// 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.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Testing; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osu.Game.Rulesets.Osu.Objects.Drawables; | ||
using osu.Game.Tests.Beatmaps; | ||
using osu.Game.Tests.Visual; | ||
|
||
namespace osu.Game.Rulesets.Osu.Tests.Editor | ||
{ | ||
/// <summary> | ||
/// This test covers autoplay working correctly in the editor on fast streams. | ||
/// Might seem like a weird test, but frame stability being toggled can cause autoplay to operation incorrectly. | ||
/// This is clearly a bug with the autoplay algorithm, but is worked around at an editor level for now. | ||
/// </summary> | ||
public partial class TestSceneEditorAutoplayFastStreams : EditorTestScene | ||
{ | ||
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) | ||
{ | ||
var testBeatmap = new TestBeatmap(ruleset, false); | ||
testBeatmap.HitObjects.AddRange(new[] | ||
{ | ||
new HitCircle { StartTime = 500 }, | ||
new HitCircle { StartTime = 530 }, | ||
new HitCircle { StartTime = 560 }, | ||
new HitCircle { StartTime = 590 }, | ||
new HitCircle { StartTime = 620 }, | ||
}); | ||
|
||
return testBeatmap; | ||
} | ||
|
||
protected override Ruleset CreateEditorRuleset() => new OsuRuleset(); | ||
|
||
[Test] | ||
public void TestAllHit() | ||
{ | ||
AddStep("start playback", () => EditorClock.Start()); | ||
AddUntilStep("wait for all hit", () => | ||
{ | ||
DrawableHitCircle[] hitCircles = Editor.ChildrenOfType<DrawableHitCircle>().OrderBy(s => s.HitObject.StartTime).ToArray(); | ||
return hitCircles.Length == 5 && hitCircles.All(h => h.IsHit); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters