mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:52:57 +08:00
Seek to first hitobject when entering editor
This commit is contained in:
parent
6805c029e7
commit
e904928314
@ -69,6 +69,14 @@ namespace osu.Game.Screens.Edit
|
||||
clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false };
|
||||
clock.ChangeSource(sourceClock);
|
||||
|
||||
if (Beatmap.Value.Beatmap.HitObjects.Count > 0)
|
||||
{
|
||||
double targetTime = Beatmap.Value.Beatmap.HitObjects[0].StartTime;
|
||||
double beatLength = Beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(targetTime).BeatLength;
|
||||
|
||||
clock.Seek(Math.Max(0, targetTime - beatLength));
|
||||
}
|
||||
|
||||
dependencies.CacheAs<IFrameBasedClock>(clock);
|
||||
dependencies.CacheAs<IAdjustableClock>(clock);
|
||||
dependencies.Cache(beatDivisor);
|
||||
|
Loading…
Reference in New Issue
Block a user