1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 19:00:07 +08:00

Reset preview track when stopping instead

This commit is contained in:
Joseph Madamba
2023-02-13 22:39:34 -08:00
Unverified
parent 7f7e72705f
commit ea624b8ad0
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -98,6 +98,9 @@ namespace osu.Game.Audio
Track.Stop();
// Ensure the track is reset immediately on stopping, so the next time it is started it has a correct time value.
Track.Seek(0);
Stopped?.Invoke();
}
@@ -75,9 +75,9 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
Playing.BindValueChanged(updateState, true);
}
protected override void UpdateAfterChildren()
protected override void Update()
{
base.UpdateAfterChildren();
base.Update();
if (Playing.Value && previewTrack != null && previewTrack.TrackLoaded)
progress.Value = previewTrack.CurrentTime / previewTrack.Length;