diff --git a/osu.Game/Screens/Play/SaveFailedScoreButton.cs b/osu.Game/Screens/Play/SaveFailedScoreButton.cs index ed4aa96977..7eed2086ae 100644 --- a/osu.Game/Screens/Play/SaveFailedScoreButton.cs +++ b/osu.Game/Screens/Play/SaveFailedScoreButton.cs @@ -8,6 +8,7 @@ using osu.Framework.Bindables; using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Database; using osu.Game.Scoring; using osu.Game.Graphics.UserInterface; using osu.Game.Online; @@ -33,7 +34,7 @@ namespace osu.Game.Screens.Play } [BackgroundDependencyLoader] - private void load(OsuGame? game) + private void load(OsuGame? game, Player? player, RealmAccess realm) { InternalChild = button = new DownloadButton { @@ -60,6 +61,13 @@ namespace osu.Game.Screens.Play } }; + if (player != null) + { + score = realm.Run(r => r.Find(player.Score.ScoreInfo.ID)?.Detach()); + if (score != null) + state.Value = DownloadState.LocallyAvailable; + } + state.BindValueChanged(state => { switch (state.NewValue)