mirror of
https://github.com/osukey/osukey.git
synced 2025-05-14 18:17:22 +09:00
Merge pull request #9731 from peppy/fix-multiple-tracks-playing
Fix next track starting occasionally starting before previous one is paused
This commit is contained in:
commit
a413f5f0dc
@ -236,8 +236,8 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
if (beatmap is Bindable<WorkingBeatmap> working)
|
if (beatmap is Bindable<WorkingBeatmap> working)
|
||||||
working.Value = beatmaps.GetWorkingBeatmap(playable.Beatmaps.First(), beatmap.Value);
|
working.Value = beatmaps.GetWorkingBeatmap(playable.Beatmaps.First(), beatmap.Value);
|
||||||
beatmap.Value.Track.Restart();
|
|
||||||
|
|
||||||
|
restartTrack();
|
||||||
return PreviousTrackResult.Previous;
|
return PreviousTrackResult.Previous;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,13 +262,21 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
if (beatmap is Bindable<WorkingBeatmap> working)
|
if (beatmap is Bindable<WorkingBeatmap> working)
|
||||||
working.Value = beatmaps.GetWorkingBeatmap(playable.Beatmaps.First(), beatmap.Value);
|
working.Value = beatmaps.GetWorkingBeatmap(playable.Beatmaps.First(), beatmap.Value);
|
||||||
beatmap.Value.Track.Restart();
|
|
||||||
|
restartTrack();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void restartTrack()
|
||||||
|
{
|
||||||
|
// if not scheduled, the previously track will be stopped one frame later (see ScheduleAfterChildren logic in GameBase).
|
||||||
|
// we probably want to move this to a central method for switching to a new working beatmap in the future.
|
||||||
|
Schedule(() => beatmap.Value.Track.Restart());
|
||||||
|
}
|
||||||
|
|
||||||
private WorkingBeatmap current;
|
private WorkingBeatmap current;
|
||||||
|
|
||||||
private TrackChangeDirection? queuedDirection;
|
private TrackChangeDirection? queuedDirection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user