mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 02:23:10 +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:
commit
6cdc9b2662
@ -563,6 +563,15 @@ namespace osu.Game
|
|||||||
|
|
||||||
// This should be able to be performed from song select, but that is disabled for now
|
// 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).
|
// 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 =>
|
PerformFromScreen(screen =>
|
||||||
{
|
{
|
||||||
Logger.Log($"{nameof(PresentScore)} updating beatmap ({databasedBeatmap}) and ruleset ({databasedScore.ScoreInfo.Ruleset}) to match score");
|
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));
|
screen.Push(new SoloResultsScreen(databasedScore.ScoreInfo, false));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
}, validScreens: validScreens);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task Import(params ImportTask[] imports)
|
public override Task Import(params ImportTask[] imports)
|
||||||
|
Loading…
Reference in New Issue
Block a user