mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Fix tests and implementation
This commit is contained in:
parent
dd9b9a18ac
commit
e44062b77a
@ -17,7 +17,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class EditorClock : DecoupleableInterpolatingFramedClock
|
public class EditorClock : DecoupleableInterpolatingFramedClock
|
||||||
{
|
{
|
||||||
public Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
//public Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
|
public double TrackLength;
|
||||||
|
|
||||||
public ControlPointInfo ControlPointInfo;
|
public ControlPointInfo ControlPointInfo;
|
||||||
|
|
||||||
@ -27,15 +29,15 @@ namespace osu.Game.Screens.Edit
|
|||||||
{
|
{
|
||||||
this.beatDivisor = beatDivisor;
|
this.beatDivisor = beatDivisor;
|
||||||
|
|
||||||
Beatmap.BindTo(beatmap);
|
ControlPointInfo = beatmap.Value.Beatmap.ControlPointInfo;
|
||||||
|
TrackLength = beatmap.Value.Track.Length;
|
||||||
ControlPointInfo = Beatmap.Value.Beatmap.ControlPointInfo;
|
|
||||||
}
|
}
|
||||||
public EditorClock(ControlPointInfo controlPointInfo, BindableBeatDivisor beatDivisor)
|
public EditorClock(ControlPointInfo controlPointInfo, double trackLength, BindableBeatDivisor beatDivisor)
|
||||||
{
|
{
|
||||||
this.beatDivisor = beatDivisor;
|
this.beatDivisor = beatDivisor;
|
||||||
|
|
||||||
ControlPointInfo = controlPointInfo;
|
ControlPointInfo = controlPointInfo;
|
||||||
|
TrackLength = trackLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -123,7 +125,8 @@ namespace osu.Game.Screens.Edit
|
|||||||
if (seekTime > nextTimingPoint?.Time)
|
if (seekTime > nextTimingPoint?.Time)
|
||||||
seekTime = nextTimingPoint.Time;
|
seekTime = nextTimingPoint.Time;
|
||||||
|
|
||||||
seekTime = Math.Min(Math.Max(0, seekTime), Beatmap.Value.Track.Length); // Ensure the sought point is within the song's length
|
// Ensure the sought point is within the boundaries
|
||||||
|
seekTime = Math.Min(Math.Max(0, seekTime), TrackLength);
|
||||||
Seek(seekTime);
|
Seek(seekTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
protected EditorClockTestCase()
|
protected EditorClockTestCase()
|
||||||
{
|
{
|
||||||
Clock = new EditorClock(new ControlPointInfo(), BeatDivisor) { IsCoupled = false };
|
Clock = new EditorClock(new ControlPointInfo(), 5000, BeatDivisor) { IsCoupled = false };
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user