diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index ad0c0717ac..abbcec5094 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays private Container dragContainer; private Container playerContainer; - public bool UserRequestedPause { get; private set; } + public bool IsUserPaused { get; private set; } [Resolved] private Bindable beatmap { get; set; } @@ -159,7 +159,7 @@ namespace osu.Game.Overlays Origin = Anchor.Centre, Scale = new Vector2(1.4f), IconScale = new Vector2(1.4f), - Action = play, + Action = togglePause, Icon = FontAwesome.Regular.PlayCircle, }, nextButton = new MusicIconButton @@ -278,7 +278,7 @@ namespace osu.Game.Overlays } } - private void play() + private void togglePause() { var track = current?.Track; @@ -289,12 +289,16 @@ namespace osu.Game.Overlays return; } - UserRequestedPause = track.IsRunning; - if (track.IsRunning) + { + IsUserPaused = true; track.Stop(); + } else + { track.Start(); + IsUserPaused = false; + } } private void prev() diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 6e1c471c1a..93c413452d 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -193,7 +193,7 @@ namespace osu.Game.Screens.Menu //we may have consumed our preloaded instance, so let's make another. preloadSongSelect(); - if (Beatmap.Value.Track != null && !musicController.UserRequestedPause) + if (Beatmap.Value.Track != null && !musicController.IsUserPaused) Beatmap.Value.Track.Start(); } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index dd115e04d4..085232b27f 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -573,7 +573,7 @@ namespace osu.Game.Screens.Select { Track track = Beatmap.Value.Track; - if ((!track.IsRunning || restart) && !musicController.UserRequestedPause) + if ((!track.IsRunning || restart) && !musicController.IsUserPaused) { track.RestartPoint = Beatmap.Value.Metadata.PreviewTime; track.Restart();