mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:53:22 +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>
|
||||
/// Toggle pause / play.
|
||||
/// </summary>
|
||||
|
@ -359,6 +359,7 @@ namespace osu.Game.Screens.Select
|
||||
return;
|
||||
|
||||
beatmapNoDebounce = beatmap;
|
||||
|
||||
performUpdateSelected();
|
||||
}
|
||||
|
||||
@ -586,10 +587,18 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Track track = Beatmap.Value.Track;
|
||||
|
||||
if ((!track.IsRunning || restart) && music?.IsUserPaused != true)
|
||||
if (!track.IsRunning || restart)
|
||||
{
|
||||
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