mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 14:23:14 +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("ensure playing something", () => Game.MusicController.EnsurePlayingSomething());
|
||||||
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
|
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));
|
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]
|
[Test]
|
||||||
|
@ -45,7 +45,10 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private readonly BindableList<BeatmapSetInfo> beatmapSets = new BindableList<BeatmapSetInfo>();
|
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>
|
/// <summary>
|
||||||
/// Fired when the global <see cref="WorkingBeatmap"/> has changed.
|
/// Fired when the global <see cref="WorkingBeatmap"/> has changed.
|
||||||
@ -148,7 +151,7 @@ namespace osu.Game.Overlays
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void EnsurePlayingSomething()
|
public void EnsurePlayingSomething()
|
||||||
{
|
{
|
||||||
if (IsUserPaused) return;
|
if (UserPauseRequested) return;
|
||||||
|
|
||||||
if (CurrentTrack.IsDummyDevice || beatmap.Value.BeatmapSetInfo.DeletePending)
|
if (CurrentTrack.IsDummyDevice || beatmap.Value.BeatmapSetInfo.DeletePending)
|
||||||
{
|
{
|
||||||
@ -176,7 +179,7 @@ namespace osu.Game.Overlays
|
|||||||
public bool Play(bool restart = false, bool requestedByUser = false)
|
public bool Play(bool restart = false, bool requestedByUser = false)
|
||||||
{
|
{
|
||||||
if (requestedByUser)
|
if (requestedByUser)
|
||||||
IsUserPaused = false;
|
UserPauseRequested = false;
|
||||||
|
|
||||||
if (restart)
|
if (restart)
|
||||||
CurrentTrack.Restart();
|
CurrentTrack.Restart();
|
||||||
@ -196,7 +199,7 @@ namespace osu.Game.Overlays
|
|||||||
/// </param>
|
/// </param>
|
||||||
public void Stop(bool requestedByUser = false)
|
public void Stop(bool requestedByUser = false)
|
||||||
{
|
{
|
||||||
IsUserPaused |= requestedByUser;
|
UserPauseRequested |= requestedByUser;
|
||||||
if (CurrentTrack.IsRunning)
|
if (CurrentTrack.IsRunning)
|
||||||
CurrentTrack.Stop();
|
CurrentTrack.Stop();
|
||||||
}
|
}
|
||||||
|
@ -682,7 +682,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
|
||||||
|
|
||||||
if (!track.IsRunning && (music.IsUserPaused != true || isNewTrack))
|
if (!track.IsRunning && (music.UserPauseRequested != true || isNewTrack))
|
||||||
music.Play(true);
|
music.Play(true);
|
||||||
|
|
||||||
lastTrack.SetTarget(track);
|
lastTrack.SetTarget(track);
|
||||||
|
Loading…
Reference in New Issue
Block a user