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

@ -61,20 +61,23 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
Action = () =>
{
if (!downloader.Download())
if (downloader.DownloadState.Value == BeatmapSetDownloader.DownloadStatus.Downloading)
{
Content.MoveToX(-5, 50, Easing.OutSine).Then()
.MoveToX(5, 100, Easing.InOutSine).Then()
.MoveToX(-5, 100, Easing.InOutSine).Then()
.MoveToX(0, 50, Easing.InSine);
return;
}
downloader.Download();
};
downloader.Downloaded.ValueChanged += d =>
downloader.DownloadState.ValueChanged += d =>
{
if (d)
if (d == BeatmapSetDownloader.DownloadStatus.Downloaded)
this.FadeOut(200);
else
else if (d == BeatmapSetDownloader.DownloadStatus.NotDownloaded)
this.FadeIn(200);
};
}