mirror of
https://github.com/ppy/osu
synced 2025-03-22 19:06:58 +00:00
Merge pull request #6406 from Joehuu/resume-music-gameplay-exit
Resume music to same position when exiting gameplay
This commit is contained in:
commit
d547f9cc68
@ -413,7 +413,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, previous);
|
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, previous);
|
||||||
|
|
||||||
if (this.IsCurrentScreen() && Beatmap.Value?.Track != previous?.Track)
|
if (this.IsCurrentScreen() && Beatmap.Value?.Track != previous?.Track)
|
||||||
ensurePlayingSelected();
|
ensurePlayingSelected(true);
|
||||||
|
|
||||||
if (beatmap != null)
|
if (beatmap != null)
|
||||||
{
|
{
|
||||||
@ -585,18 +585,14 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
Track track = Beatmap.Value.Track;
|
Track track = Beatmap.Value.Track;
|
||||||
|
|
||||||
if (!track.IsRunning || restart)
|
if (!track.IsRunning)
|
||||||
{
|
{
|
||||||
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
||||||
|
|
||||||
if (music != null)
|
if (restart)
|
||||||
{
|
|
||||||
// use the global music controller (when available) to cancel a potential local user paused state.
|
|
||||||
music.SeekTo(track.RestartPoint);
|
|
||||||
music.Play();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
track.Restart();
|
track.Restart();
|
||||||
|
else
|
||||||
|
track.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user