BeatmapSetDownloadButton -> BeatmapSetDownloader

Allows it to integrate better with existing buttons, like HeaderButton.
This commit is contained in:
DrabWeb
2018-06-04 20:12:43 -03:00
parent 4bdc1fb781
commit 698a42f145
2 changed files with 26 additions and 27 deletions

View File

@ -5,19 +5,22 @@ using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Direct
{
public class DownloadButton : BeatmapSetDownloadButton
public class DownloadButton : OsuClickableContainer
{
private readonly SpriteIcon icon;
public DownloadButton(BeatmapSetInfo set, bool noVideo = false) : base(set, noVideo)
public DownloadButton(BeatmapSetInfo set, bool noVideo = false)
{
BeatmapSetDownloader downloader;
Children = new Drawable[]
{
downloader = new BeatmapSetDownloader(set, noVideo),
icon = new SpriteIcon
{
Anchor = Anchor.Centre,
@ -27,7 +30,9 @@ namespace osu.Game.Overlays.Direct
},
};
Downloaded.ValueChanged += e =>
Action = downloader.Download;
downloader.Downloaded.ValueChanged += e =>
{
if (e)
this.FadeOut(200);