Update direct panel download button for new design

- Add a download failed event to BeatmapManager
- Make DownloadButton aware of all 3 possible download states
- Change button appearance based on each state
This commit is contained in:
naoey
2018-07-03 19:13:42 +05:30
parent 8ecd235820
commit 2a0b1f3615
6 changed files with 149 additions and 36 deletions

View File

@ -45,6 +45,11 @@ namespace osu.Game.Beatmaps
/// </summary>
public event Action<DownloadBeatmapSetRequest> BeatmapDownloadBegan;
/// <summary>
/// Fired when a beatmap download is interrupted, due to user cancellation or other failures.
/// </summary>
public event Action<DownloadBeatmapSetRequest> BeatmapDownloadFailed;
/// <summary>
/// A default representation of a WorkingBeatmap to use when no beatmap is available.
/// </summary>
@ -175,6 +180,8 @@ namespace osu.Game.Beatmaps
request.Failure += error =>
{
BeatmapDownloadFailed?.Invoke(request);
if (error is OperationCanceledException) return;
downloadNotification.State = ProgressNotificationState.Cancelled;