mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 07:43:01 +08:00
Merge pull request #5764 from peppy/unpause-on-selection-change
Unpause music when changing selection at song select
This commit is contained in:
commit
2137cd411f
@ -92,6 +92,15 @@ namespace osu.Game.Overlays
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start playing the current track (if not already playing).
|
||||||
|
/// </summary>
|
||||||
|
public void Play()
|
||||||
|
{
|
||||||
|
if (!IsPlaying)
|
||||||
|
TogglePause();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Toggle pause / play.
|
/// Toggle pause / play.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -359,6 +359,7 @@ namespace osu.Game.Screens.Select
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
beatmapNoDebounce = beatmap;
|
beatmapNoDebounce = beatmap;
|
||||||
|
|
||||||
performUpdateSelected();
|
performUpdateSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,10 +587,18 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
Track track = Beatmap.Value.Track;
|
Track track = Beatmap.Value.Track;
|
||||||
|
|
||||||
if ((!track.IsRunning || restart) && music?.IsUserPaused != true)
|
if (!track.IsRunning || restart)
|
||||||
{
|
{
|
||||||
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
||||||
track.Restart();
|
|
||||||
|
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
|
||||||
|
track.Restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user