mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 08:33:55 +09:00
Fix metronome speed not adjusted on different playback rates
This commit is contained in:
@ -10,6 +10,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Timing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -28,6 +29,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
private Drawable weight;
|
private Drawable weight;
|
||||||
private Drawable stick;
|
private Drawable stick;
|
||||||
|
|
||||||
|
private IAdjustableClock metronomeClock;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider overlayColourProvider { get; set; }
|
private OverlayColourProvider overlayColourProvider { get; set; }
|
||||||
|
|
||||||
@ -192,6 +195,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
Y = -3,
|
Y = -3,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Clock = new FramedClock(metronomeClock = new StopwatchClock(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
private double beatLength;
|
private double beatLength;
|
||||||
@ -216,6 +221,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
if (BeatSyncSource.ControlPoints == null || BeatSyncSource.Clock == null)
|
if (BeatSyncSource.ControlPoints == null || BeatSyncSource.Clock == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
metronomeClock.Rate = IsBeatSyncedWithTrack ? BeatSyncSource.Clock.Rate : 1;
|
||||||
|
|
||||||
timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);
|
timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);
|
||||||
|
|
||||||
if (beatLength != timingPoint.BeatLength)
|
if (beatLength != timingPoint.BeatLength)
|
||||||
|
Reference in New Issue
Block a user