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:
parent
3c10b2d3d9
commit
9c82593c9e
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user