1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 13:27:20 +08:00

Account for offset being applied to editor clock time in TestSceneEditorClock

This commit is contained in:
Dean Herbert 2022-08-29 16:42:50 +09:00
parent 90ff0864c0
commit 2dafa041a7
3 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Editing
AddStep("seek near end", () => EditorClock.Seek(EditorClock.TrackLength - 250));
AddUntilStep("clock stops", () => !EditorClock.IsRunning);
AddUntilStep("clock stopped at end", () => EditorClock.CurrentTime, () => Is.EqualTo(EditorClock.TrackLength));
AddUntilStep("clock stopped at end", () => EditorClock.CurrentTime - EditorClock.TotalAppliedOffset, () => Is.EqualTo(EditorClock.TrackLength));
AddStep("start clock again", () => EditorClock.Start());
AddAssert("clock looped to start", () => EditorClock.IsRunning && EditorClock.CurrentTime < 500);

View File

@ -124,7 +124,7 @@ namespace osu.Game.Beatmaps
finalClockSource.ProcessFrame();
}
private double totalAppliedOffset
public double TotalAppliedOffset
{
get
{
@ -169,7 +169,7 @@ namespace osu.Game.Beatmaps
public bool Seek(double position)
{
bool success = decoupledClock.Seek(position - totalAppliedOffset);
bool success = decoupledClock.Seek(position - TotalAppliedOffset);
finalClockSource.ProcessFrame();
return success;

View File

@ -158,6 +158,8 @@ namespace osu.Game.Screens.Edit
public double CurrentTime => underlyingClock.CurrentTime;
public double TotalAppliedOffset => underlyingClock.TotalAppliedOffset;
public void Reset()
{
ClearTransforms();