mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09: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 = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false };
|
||||||
clock.ChangeSource(sourceClock);
|
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<IFrameBasedClock>(clock);
|
||||||
dependencies.CacheAs<IAdjustableClock>(clock);
|
dependencies.CacheAs<IAdjustableClock>(clock);
|
||||||
dependencies.Cache(beatDivisor);
|
dependencies.Cache(beatDivisor);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user