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

@ -99,6 +99,7 @@ namespace osu.Game.Overlays.Direct
attachDownload(downloadRequest);
beatmaps.BeatmapDownloadBegan += attachDownload;
beatmaps.ItemAdded += setAdded;
}
public override bool DisposeOnDeathRemoval => true;
@ -107,6 +108,7 @@ namespace osu.Game.Overlays.Direct
{
base.Dispose(isDisposing);
beatmaps.BeatmapDownloadBegan -= attachDownload;
beatmaps.ItemAdded -= setAdded;
}
protected override void Update()
@ -171,6 +173,12 @@ namespace osu.Game.Overlays.Direct
};
}
private void setAdded(BeatmapSetInfo s)
{
if (s.OnlineBeatmapSetID == SetInfo.OnlineBeatmapSetID)
progressBar.FadeOut(500);
}
protected override void LoadComplete()
{
base.LoadComplete();