mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 13:45:59 +08:00
Merge pull request #10657 from smoogipoo/rename-isuserpaused
Rename IsUserPaused -> UserPauseRequested
This commit is contained in:
commit
1ab609fa2f
@ -22,9 +22,9 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
{
|
||||
AddStep("ensure playing something", () => Game.MusicController.EnsurePlayingSomething());
|
||||
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
|
||||
AddAssert("music paused", () => !Game.MusicController.IsPlaying && Game.MusicController.IsUserPaused);
|
||||
AddAssert("music paused", () => !Game.MusicController.IsPlaying && Game.MusicController.UserPauseRequested);
|
||||
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
|
||||
AddAssert("music resumed", () => Game.MusicController.IsPlaying && !Game.MusicController.IsUserPaused);
|
||||
AddAssert("music resumed", () => Game.MusicController.IsPlaying && !Game.MusicController.UserPauseRequested);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -45,7 +45,10 @@ namespace osu.Game.Overlays
|
||||
|
||||
private readonly BindableList<BeatmapSetInfo> beatmapSets = new BindableList<BeatmapSetInfo>();
|
||||
|
||||
public bool IsUserPaused { get; private set; }
|
||||
/// <summary>
|
||||
/// Whether the user has requested the track to be paused. Use <see cref="IsPlaying"/> to determine whether the track is still playing.
|
||||
/// </summary>
|
||||
public bool UserPauseRequested { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the global <see cref="WorkingBeatmap"/> has changed.
|
||||
@ -148,7 +151,7 @@ namespace osu.Game.Overlays
|
||||
/// </summary>
|
||||
public void EnsurePlayingSomething()
|
||||
{
|
||||
if (IsUserPaused) return;
|
||||
if (UserPauseRequested) return;
|
||||
|
||||
if (CurrentTrack.IsDummyDevice || beatmap.Value.BeatmapSetInfo.DeletePending)
|
||||
{
|
||||
@ -176,7 +179,7 @@ namespace osu.Game.Overlays
|
||||
public bool Play(bool restart = false, bool requestedByUser = false)
|
||||
{
|
||||
if (requestedByUser)
|
||||
IsUserPaused = false;
|
||||
UserPauseRequested = false;
|
||||
|
||||
if (restart)
|
||||
CurrentTrack.Restart();
|
||||
@ -196,7 +199,7 @@ namespace osu.Game.Overlays
|
||||
/// </param>
|
||||
public void Stop(bool requestedByUser = false)
|
||||
{
|
||||
IsUserPaused |= requestedByUser;
|
||||
UserPauseRequested |= requestedByUser;
|
||||
if (CurrentTrack.IsRunning)
|
||||
CurrentTrack.Stop();
|
||||
}
|
||||
|
@ -682,7 +682,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
||||
|
||||
if (!track.IsRunning && (music.IsUserPaused != true || isNewTrack))
|
||||
if (!track.IsRunning && (music.UserPauseRequested != true || isNewTrack))
|
||||
music.Play(true);
|
||||
|
||||
lastTrack.SetTarget(track);
|
||||
|
Loading…
Reference in New Issue
Block a user