Add basic handling of download failures

This commit is contained in:
Dean Herbert
2022-07-19 19:01:23 +09:00
parent f6de76e057
commit 17046b0553
3 changed files with 69 additions and 14 deletions

View File

@ -90,12 +90,9 @@ namespace osu.Game.Screens.Select.Carousel
},
});
TooltipText = "Update beatmap with online changes";
Action = () =>
{
beatmapDownloader.Download(beatmapSetInfo);
attachExistingDownload();
};
}
@ -116,7 +113,15 @@ namespace osu.Game.Screens.Select.Carousel
Enabled.Value = false;
TooltipText = string.Empty;
download.DownloadProgressed += progress => progressFill.ResizeWidthTo(progress, 100);
download.DownloadProgressed += progress => progressFill.ResizeWidthTo(progress, 100, Easing.OutQuint);
download.Failure += _ => attachExistingDownload();
}
else
{
Enabled.Value = true;
TooltipText = "Update beatmap with online changes";
progressFill.ResizeWidthTo(0, 100, Easing.OutQuint);
}
}