From 35ec55c1f6df3d9ded611c6cd8afb3f696c101ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 30 Jul 2023 16:41:33 +0900 Subject: [PATCH 1/2] Don't queue export replay operations if button is disabled --- osu.Game/Screens/Ranking/ReplayDownloadButton.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs index a5b33e584d..aa734d2077 100644 --- a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs @@ -117,11 +117,17 @@ namespace osu.Game.Screens.Ranking return true; case GlobalAction.ExportReplay: - State.BindValueChanged(exportWhenReady, true); - - // start the import via button - if (State.Value != DownloadState.LocallyAvailable) + if (State.Value == DownloadState.LocallyAvailable) + { + State.BindValueChanged(exportWhenReady, true); + } + else + { + // A download needs to be performed before we can export this replay. button.TriggerClick(); + if (button.Enabled.Value) + State.BindValueChanged(exportWhenReady, true); + } return true; } From 6d5b3617b3cf8af702573d0443c7f0da276834c6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 30 Jul 2023 16:41:45 +0900 Subject: [PATCH 2/2] Remove pending export operation if active score is changed --- osu.Game/Screens/Ranking/ReplayDownloadButton.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs index aa734d2077..b6166e97f6 100644 --- a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs @@ -83,6 +83,10 @@ namespace osu.Game.Screens.Ranking Score.BindValueChanged(score => { + // An export may be pending from the last score. + // Reset this to meet user expectations (a new score which has just been switched to shouldn't export) + State.ValueChanged -= exportWhenReady; + downloadTracker?.RemoveAndDisposeImmediately(); if (score.NewValue != null)