1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 08:12:56 +08:00

Remove unnecessary RunTask calls

This commit is contained in:
Dean Herbert 2020-09-08 18:26:13 +09:00
parent 14bf2ab936
commit ad5d6117c7
2 changed files with 6 additions and 18 deletions

View File

@ -39,10 +39,7 @@ namespace osu.Game.Overlays.Music
return true; return true;
case GlobalAction.MusicNext: case GlobalAction.MusicNext:
musicController.NextTrack(() => musicController.NextTrack(() => onScreenDisplay?.Display(new MusicActionToast("Next track")));
{
onScreenDisplay?.Display(new MusicActionToast("Next track"));
}).RunTask();
return true; return true;
@ -59,7 +56,7 @@ namespace osu.Game.Overlays.Music
onScreenDisplay?.Display(new MusicActionToast("Previous track")); onScreenDisplay?.Display(new MusicActionToast("Previous track"));
break; break;
} }
}).RunTask(); });
return true; return true;
} }

View File

@ -201,13 +201,8 @@ namespace osu.Game.Overlays
/// <summary> /// <summary>
/// Play the previous track or restart the current track if it's current time below <see cref="restart_cutoff_point"/>. /// Play the previous track or restart the current track if it's current time below <see cref="restart_cutoff_point"/>.
/// </summary> /// </summary>
/// <param name="onSuccess"> /// <param name="onSuccess">Invoked when the operation has been performed successfully.</param>
/// Invoked when the operation has been performed successfully. public void PreviousTrack(Action<PreviousTrackResult> onSuccess = null) => Schedule(() =>
/// 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(() =>
{ {
PreviousTrackResult res = prev(); PreviousTrackResult res = prev();
if (res != PreviousTrackResult.None) if (res != PreviousTrackResult.None)
@ -248,13 +243,9 @@ namespace osu.Game.Overlays
/// <summary> /// <summary>
/// Play the next random or playlist track. /// Play the next random or playlist track.
/// </summary> /// </summary>
/// <param name="onSuccess"> /// <param name="onSuccess">Invoked when the operation has been performed successfully.</param>
/// 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> /// <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(); bool res = next();
if (res) if (res)