From 776d92de7bbe306cea36ae1b1bd1d2e85fdf19a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 5 Jun 2026 08:57:33 +0200 Subject: [PATCH] Fix crash when trying to scope to beatmap set in multiplayer freestyle select screen with sorting/grouping mode which has difficulties split apart (#37997) Closes https://github.com/ppy/osu/issues/37995. See https://github.com/ppy/osu/blob/9727d95ad9a46ecaafd8b4fe62e68f45db607661/osu.Game/Screens/Select/SongSelect.cs#L91-L95 for why this would crash. --- .../Select/PanelBeatmapStandalone.SpreadDisplay.cs | 8 ++++++++ osu.Game/Screens/Select/PanelBeatmapStandalone.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/PanelBeatmapStandalone.SpreadDisplay.cs b/osu.Game/Screens/Select/PanelBeatmapStandalone.SpreadDisplay.cs index 1e4efe495c..1d538ccacc 100644 --- a/osu.Game/Screens/Select/PanelBeatmapStandalone.SpreadDisplay.cs +++ b/osu.Game/Screens/Select/PanelBeatmapStandalone.SpreadDisplay.cs @@ -26,6 +26,7 @@ namespace osu.Game.Screens.Select { public Bindable Beatmap { get; } = new Bindable(); public Bindable StarDifficulty { get; } = new Bindable(); + public BindableBool Selected { get; } = new BindableBool(); protected override Colour4 DimColour => Colour4.White; @@ -140,6 +141,8 @@ namespace osu.Game.Screens.Select StarDifficulty.BindValueChanged(_ => updateBeatmap()); showConvertedBeatmaps.BindValueChanged(_ => updateBeatmap()); scopedBeatmapSet.BindValueChanged(_ => updateBeatmap(), true); + Selected.BindValueChanged(_ => updateEnabled()); + scopedBeatmapSet.BindDisabledChanged(_ => updateEnabled(), true); Enabled.BindValueChanged(_ => updateAppearance(), true); FinishTransforms(true); } @@ -254,6 +257,11 @@ namespace osu.Game.Screens.Select base.OnHoverLost(e); } + private void updateEnabled() + { + Enabled.Value = Selected.Value && !scopedBeatmapSet.Disabled; + } + private void updateAppearance() { bool isInteractable = Enabled.Value && IsHovered; diff --git a/osu.Game/Screens/Select/PanelBeatmapStandalone.cs b/osu.Game/Screens/Select/PanelBeatmapStandalone.cs index 36e9c671dd..896328eefb 100644 --- a/osu.Game/Screens/Select/PanelBeatmapStandalone.cs +++ b/osu.Game/Screens/Select/PanelBeatmapStandalone.cs @@ -194,6 +194,7 @@ namespace osu.Game.Screens.Select { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, + Selected = { BindTarget = Selected }, } }, } @@ -214,7 +215,6 @@ namespace osu.Game.Screens.Select Selected.BindValueChanged(s => { Expanded.Value = s.NewValue; - spreadDisplay.Enabled.Value = s.NewValue; }, true); }