diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs b/osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs index abbef52f8f..e02ba4d3ed 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenBeatmaps.cs @@ -5,7 +5,6 @@ using System.ComponentModel; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Beatmaps.Drawables; using osu.Game.Database; @@ -129,7 +128,7 @@ private void downloadTutorial() downloadTracker.Progress.BindValueChanged(progress => { - downloadTutorialButton.Current.Value = progress.NewValue; + downloadTutorialButton.SetProgress(progress.NewValue, false); if (progress.NewValue == 1) downloadTutorialButton.Complete(); @@ -152,10 +151,10 @@ void updateProgress() { double progress = (double)bundledDownloader.DownloadTrackers.Count(t => t.State.Value == DownloadState.LocallyAvailable) / bundledDownloader.DownloadTrackers.Count(); - this.TransformBindableTo(downloadBundledButton.Current, progress, 2000, Easing.OutQuint); - if (progress == 1) downloadBundledButton.Complete(); + else + downloadBundledButton.SetProgress(progress, true); } } @@ -166,8 +165,6 @@ private class ProgressRoundedButton : RoundedButton private ProgressBar progressBar = null!; - public Bindable Current => progressBar.Current; - protected override void LoadComplete() { base.LoadComplete(); @@ -189,7 +186,15 @@ public void Complete() Background.FadeColour(colours.Green, 500, Easing.OutQuint); progressBar.FillColour = colours.Green; - this.TransformBindableTo(Current, 1, 500, Easing.OutQuint); + this.TransformBindableTo(progressBar.Current, 1, 500, Easing.OutQuint); + } + + public void SetProgress(double progress, bool animated) + { + if (!Enabled.Value) + return; + + this.TransformBindableTo(progressBar.Current, progress, animated ? 500 : 0, Easing.OutQuint); } } }