mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into comments_api
This commit is contained in:
@ -98,20 +98,13 @@ 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>
|
||||
/// <returns>Whether the operation was successful.</returns>
|
||||
public bool TogglePause()
|
||||
public bool Play(bool restart = false)
|
||||
{
|
||||
var track = current?.Track;
|
||||
|
||||
IsUserPaused = false;
|
||||
|
||||
if (track == null)
|
||||
{
|
||||
if (beatmap.Disabled)
|
||||
@ -121,16 +114,38 @@ namespace osu.Game.Overlays
|
||||
return true;
|
||||
}
|
||||
|
||||
if (track.IsRunning)
|
||||
{
|
||||
IsUserPaused = true;
|
||||
track.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (restart)
|
||||
track.Restart();
|
||||
else if (!IsPlaying)
|
||||
track.Start();
|
||||
IsUserPaused = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop playing the current track and pause at the current position.
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
var track = current?.Track;
|
||||
|
||||
IsUserPaused = true;
|
||||
if (track?.IsRunning == true)
|
||||
track.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggle pause / play.
|
||||
/// </summary>
|
||||
/// <returns>Whether the operation was successful.</returns>
|
||||
public bool TogglePause()
|
||||
{
|
||||
var track = current?.Track;
|
||||
|
||||
if (track?.IsRunning == true)
|
||||
Stop();
|
||||
else
|
||||
Play();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
default:
|
||||
var userRequest = new GetUsersRequest(); // TODO filter arguments!
|
||||
userRequest.Success += response => updateUsers(response.Select(r => r.User));
|
||||
userRequest.Success += res => updateUsers(res.Users.Select(r => r.User));
|
||||
API.Queue(getUsersRequest = userRequest);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user