mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
Resume music to same position when exiting gameplay
This commit is contained in:
parent
8c3caed2e0
commit
e257f4ca04
@ -413,7 +413,7 @@ namespace osu.Game.Screens.Select
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, previous);
|
||||
|
||||
if (this.IsCurrentScreen() && Beatmap.Value?.Track != previous?.Track)
|
||||
ensurePlayingSelected();
|
||||
ensurePlayingSelected(true);
|
||||
|
||||
if (beatmap != null)
|
||||
{
|
||||
@ -585,18 +585,14 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Track track = Beatmap.Value.Track;
|
||||
|
||||
if (!track.IsRunning || restart)
|
||||
if (!track.IsRunning)
|
||||
{
|
||||
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
||||
|
||||
if (music != null)
|
||||
{
|
||||
// use the global music controller (when available) to cancel a potential local user paused state.
|
||||
music.SeekTo(track.RestartPoint);
|
||||
music.Play();
|
||||
}
|
||||
else
|
||||
if (restart)
|
||||
track.Restart();
|
||||
else
|
||||
track.Start();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user