mirror of https://github.com/ppy/osu
Remove unnecessary RunTask calls
This commit is contained in:
parent
14bf2ab936
commit
ad5d6117c7
|
@ -39,10 +39,7 @@ public bool OnPressed(GlobalAction action)
|
|||
return true;
|
||||
|
||||
case GlobalAction.MusicNext:
|
||||
musicController.NextTrack(() =>
|
||||
{
|
||||
onScreenDisplay?.Display(new MusicActionToast("Next track"));
|
||||
}).RunTask();
|
||||
musicController.NextTrack(() => onScreenDisplay?.Display(new MusicActionToast("Next track")));
|
||||
|
||||
return true;
|
||||
|
||||
|
@ -59,7 +56,7 @@ public bool OnPressed(GlobalAction action)
|
|||
onScreenDisplay?.Display(new MusicActionToast("Previous track"));
|
||||
break;
|
||||
}
|
||||
}).RunTask();
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -201,13 +201,8 @@ public bool TogglePause()
|
|||
/// <summary>
|
||||
/// Play the previous track or restart the current track if it's current time below <see cref="restart_cutoff_point"/>.
|
||||
/// </summary>
|
||||
/// <param name="onSuccess">
|
||||
/// Invoked when the operation has been performed successfully.
|
||||
/// The result isn't returned directly to the caller because
|
||||
/// the operation is scheduled and isn't performed immediately.
|
||||
/// </param>
|
||||
/// <returns>A <see cref="ScheduledDelegate"/> of the operation.</returns>
|
||||
public ScheduledDelegate PreviousTrack(Action<PreviousTrackResult> onSuccess = null) => Schedule(() =>
|
||||
/// <param name="onSuccess">Invoked when the operation has been performed successfully.</param>
|
||||
public void PreviousTrack(Action<PreviousTrackResult> onSuccess = null) => Schedule(() =>
|
||||
{
|
||||
PreviousTrackResult res = prev();
|
||||
if (res != PreviousTrackResult.None)
|
||||
|
@ -248,13 +243,9 @@ private PreviousTrackResult prev()
|
|||
/// <summary>
|
||||
/// Play the next random or playlist track.
|
||||
/// </summary>
|
||||
/// <param name="onSuccess">
|
||||
/// Invoked when the operation has been performed successfully.
|
||||
/// The result isn't returned directly to the caller because
|
||||
/// the operation is scheduled and isn't performed immediately.
|
||||
/// </param>
|
||||
/// <param name="onSuccess">Invoked when the operation has been performed successfully.</param>
|
||||
/// <returns>A <see cref="ScheduledDelegate"/> of the operation.</returns>
|
||||
public ScheduledDelegate NextTrack(Action onSuccess = null) => Schedule(() =>
|
||||
public void NextTrack(Action onSuccess = null) => Schedule(() =>
|
||||
{
|
||||
bool res = next();
|
||||
if (res)
|
||||
|
|
Loading…
Reference in New Issue