1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 22:22:54 +08:00

Fix metronome speed not adjusted on different playback rates

This commit is contained in:
Salman Ahmed 2022-05-28 04:05:24 +03:00
parent 5eb16ff46c
commit e12d188dad

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Framework.Utils;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
@ -28,6 +29,8 @@ namespace osu.Game.Screens.Edit.Timing
private Drawable weight;
private Drawable stick;
private IAdjustableClock metronomeClock;
[Resolved]
private OverlayColourProvider overlayColourProvider { get; set; }
@ -192,6 +195,8 @@ namespace osu.Game.Screens.Edit.Timing
Y = -3,
},
};
Clock = new FramedClock(metronomeClock = new StopwatchClock(true));
}
private double beatLength;
@ -216,6 +221,8 @@ namespace osu.Game.Screens.Edit.Timing
if (BeatSyncSource.ControlPoints == null || BeatSyncSource.Clock == null)
return;
metronomeClock.Rate = IsBeatSyncedWithTrack ? BeatSyncSource.Clock.Rate : 1;
timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);
if (beatLength != timingPoint.BeatLength)