1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-19 13:07:20 +08:00

Add cancel event to ProgressNotification

This commit is contained in:
Dean Herbert 2017-08-24 20:15:45 +09:00
parent 3c10b2d3d9
commit 9c82593c9e

View File

@ -152,11 +152,14 @@ namespace osu.Game.Overlays.Notifications
break;
case ProgressNotificationState.Active:
case ProgressNotificationState.Queued:
State = ProgressNotificationState.Cancelled;
if (CancelRequested?.Invoke() != false)
State = ProgressNotificationState.Cancelled;
break;
}
}
public Func<bool> CancelRequested { get; set; }
/// <summary>
/// The function to post completion notifications back to.
/// </summary>