1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 07:32:58 +08:00

Merge pull request #20682 from peppy/fix-show-score-from-song-select

Fix clicking a leaderboard score at song select transtiioning briefly to main menu
This commit is contained in:
Dan Balasescu 2022-10-11 17:16:16 +09:00 committed by GitHub
commit 6cdc9b2662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -563,6 +563,15 @@ namespace osu.Game
// This should be able to be performed from song select, but that is disabled for now
// due to the weird decoupled ruleset logic (which can cause a crash in certain filter scenarios).
//
// As a special case, if the beatmap and ruleset already match, allow immediately displaying the score from song select.
// This is guaranteed to not crash, and feels better from a user's perspective (ie. if they are clicking a score in the
// song select leaderboard).
IEnumerable<Type> validScreens =
Beatmap.Value.BeatmapInfo.Equals(databasedBeatmap) && Ruleset.Value.Equals(databasedScore.ScoreInfo.Ruleset)
? new[] { typeof(SongSelect) }
: Array.Empty<Type>();
PerformFromScreen(screen =>
{
Logger.Log($"{nameof(PresentScore)} updating beatmap ({databasedBeatmap}) and ruleset ({databasedScore.ScoreInfo.Ruleset}) to match score");
@ -580,7 +589,7 @@ namespace osu.Game
screen.Push(new SoloResultsScreen(databasedScore.ScoreInfo, false));
break;
}
});
}, validScreens: validScreens);
}
public override Task Import(params ImportTask[] imports)