-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix daily challenge not showing a replay button in results screen #29057
Fix daily challenge not showing a replay button in results screen #29057
Conversation
Generally after looking this over from fifty sides (that's what happens with eldritch abstract entity hierarchies with everything overloaded to crap) I think this may be fine, and the nullcheck was just overeager application of NRT (blames back to da953b3). However I am slightly unnerved by some stuff diff --git a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs
index aac29ad269..5e2161c251 100644
--- a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs
+++ b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs
@@ -88,6 +88,8 @@ private void load(OsuGame? game, ScoreModelDownloader scoreDownloader)
State.ValueChanged -= exportWhenReady;
downloadTracker?.RemoveAndDisposeImmediately();
+ downloadTracker = null;
+ State.SetDefault();
if (score.NewValue != null)
{
just to make sure that if score changes from non-null to null, then the That could be worth a test case. Something like this is enough to show what I mean: diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs
index 5b32f380b9..061e8ea7e1 100644
--- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs
+++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs
@@ -117,6 +117,9 @@ public void TestButtonWithReplayStartsDownload()
AddAssert("state entered downloading", () => downloadStarted);
AddUntilStep("state left downloading", () => downloadFinished);
+
+ AddStep("change score to null", () => downloadButton.Score.Value = null);
+ AddUntilStep("state changed to unknown", () => downloadButton.State.Value, () => Is.EqualTo(DownloadState.Unknown));
}
[Test]
In theory if you have a download button in |
…ne screens Struck me as weird when reviewing ppy#29057. Like sure, that PR adds the replay button, but it's a bit terrible that clicking the button quits the daily challenge screen and you're back at main menu when done watching...? Also extended to cover playlists and multiplayer, which have the same issue.
The results screen pushed by
DailyChallenge
always load with a null selected score, so the replay download button never gets added. There's no reason not to have the replay download button visible when there's no score selected, so just...add it?Failing test coverage was reverted due to out-of-scope issues (see discord).
Before:
After: