1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 01:21:31 +08:00

Fix wrong beatmap shown when presenting a beatmap from results screen

- Closes https://github.com/ppy/osu/issues/35023.
- Supersedes / closes https://github.com/ppy/osu/pull/35107.
This commit is contained in:
Bartłomiej Dach
2025-10-09 09:49:48 +02:00
Unverified
parent e33de9b658
commit b477790d3e
+32 -1
View File
@@ -43,6 +43,7 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
using osu.Game.Overlays.Mods;
using osu.Game.Overlays.Volume;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Screens.Footer;
@@ -63,7 +64,7 @@ namespace osu.Game.Screens.SelectV2
/// This will be gradually built upon and ultimately replace <see cref="Select.SongSelect"/> once everything is in place.
/// </summary>
[Cached(typeof(ISongSelect))]
public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, ISongSelect
public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>, ISongSelect, IHandlePresentBeatmap
{
/// <summary>
/// A debounce that governs how long after a panel is selected before the rest of song select (and the game at large)
@@ -1123,6 +1124,36 @@ namespace osu.Game.Screens.SelectV2
#endregion
#region IHandlePresentBeatmap
void IHandlePresentBeatmap.PresentBeatmap(WorkingBeatmap workingBeatmap, RulesetInfo ruleset)
{
cancelDebounceSelection();
var beatmapInfo = workingBeatmap.BeatmapInfo;
// Don't change the local ruleset if the user is on another ruleset and is showing converted beatmaps.
// Eventually we probably want to check whether conversion is actually possible for the current ruleset.
bool requiresRulesetSwitch = !beatmapInfo.Ruleset.Equals(Ruleset.Value)
&& (beatmapInfo.Ruleset.OnlineID > 0 || !showConvertedBeatmaps.Value);
if (requiresRulesetSwitch)
{
Ruleset.Value = beatmapInfo.Ruleset;
Beatmap.Value = workingBeatmap;
Logger.Log($"Completing {nameof(IHandlePresentBeatmap.PresentBeatmap)} with beatmap {workingBeatmap} ruleset {beatmapInfo.Ruleset}");
}
else
{
Beatmap.Value = workingBeatmap;
Logger.Log($"Completing {nameof(IHandlePresentBeatmap.PresentBeatmap)} with beatmap {workingBeatmap} (maintaining ruleset)");
}
}
#endregion
#region Beatmap management
[Resolved]