mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add ability to seek between control points in editor using down/up arrows
Matches stable. Addresses #21376.
This commit is contained in:
@ -25,6 +25,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
beatmap.ControlPointInfo.Clear();
|
||||
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 });
|
||||
beatmap.ControlPointInfo.Add(2000, new TimingControlPoint { BeatLength = 500 });
|
||||
beatmap.ControlPointInfo.Add(20000, new TimingControlPoint { BeatLength = 500 });
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
@ -116,6 +117,26 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
pressAndCheckTime(Key.Right, 3000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSeekBetweenControlPoints()
|
||||
{
|
||||
AddStep("seek to 0", () => EditorClock.Seek(0));
|
||||
AddAssert("time is 0", () => EditorClock.CurrentTime == 0);
|
||||
|
||||
// already at first control point, noop
|
||||
pressAndCheckTime(Key.Down, 0);
|
||||
|
||||
pressAndCheckTime(Key.Up, 2000);
|
||||
|
||||
pressAndCheckTime(Key.Up, 20000);
|
||||
// at last control point, noop
|
||||
pressAndCheckTime(Key.Up, 20000);
|
||||
|
||||
pressAndCheckTime(Key.Down, 2000);
|
||||
pressAndCheckTime(Key.Down, 0);
|
||||
pressAndCheckTime(Key.Down, 0);
|
||||
}
|
||||
|
||||
private void pressAndCheckTime(Key key, double expectedTime)
|
||||
{
|
||||
AddStep($"press {key}", () => InputManager.Key(key));
|
||||
|
Reference in New Issue
Block a user