From 2b7eeadac0fbf52419050fbd8e4fe69ff93de893 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 10 May 2022 14:48:41 +0900 Subject: [PATCH 1/2] Workaround bad performance when selecting all freemods --- osu.Game/Overlays/Mods/ModSelectScreen.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModSelectScreen.cs b/osu.Game/Overlays/Mods/ModSelectScreen.cs index 16975cfd1d..1c629b7a4f 100644 --- a/osu.Game/Overlays/Mods/ModSelectScreen.cs +++ b/osu.Game/Overlays/Mods/ModSelectScreen.cs @@ -192,7 +192,8 @@ namespace osu.Game.Overlays.Mods State.BindValueChanged(_ => samplePlaybackDisabled.Value = State.Value == Visibility.Hidden, true); - ((IBindable>)modSettingsArea.SelectedMods).BindTo(SelectedMods); + if (customisationButton != null) + ((IBindable>)modSettingsArea.SelectedMods).BindTo(SelectedMods); SelectedMods.BindValueChanged(val => { From 8ccf2ee0759e58e14d8544c32297e410a8c5fb5e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 10 May 2022 15:07:08 +0900 Subject: [PATCH 2/2] Add inline comment --- osu.Game/Overlays/Mods/ModSelectScreen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Overlays/Mods/ModSelectScreen.cs b/osu.Game/Overlays/Mods/ModSelectScreen.cs index 1c629b7a4f..912c09f05c 100644 --- a/osu.Game/Overlays/Mods/ModSelectScreen.cs +++ b/osu.Game/Overlays/Mods/ModSelectScreen.cs @@ -192,6 +192,8 @@ namespace osu.Game.Overlays.Mods State.BindValueChanged(_ => samplePlaybackDisabled.Value = State.Value == Visibility.Hidden, true); + // This is an optimisation to prevent refreshing the available settings controls when it can be + // reasonably assumed that the settings panel is never to be displayed (e.g. FreeModSelectScreen). if (customisationButton != null) ((IBindable>)modSettingsArea.SelectedMods).BindTo(SelectedMods);