Skip to content

Commit

Permalink
Merge pull request ppy#18202 from smoogipoo/workaround-freemod-perfor…
Browse files Browse the repository at this point in the history
…mance

Workaround bad performance when selecting all freemods
  • Loading branch information
peppy authored May 10, 2022
2 parents 886a481 + 8ccf2ee commit 5af18f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion osu.Game/Overlays/Mods/ModSelectScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ protected override void LoadComplete()

State.BindValueChanged(_ => samplePlaybackDisabled.Value = State.Value == Visibility.Hidden, true);

((IBindable<IReadOnlyList<Mod>>)modSettingsArea.SelectedMods).BindTo(SelectedMods);
// 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<IReadOnlyList<Mod>>)modSettingsArea.SelectedMods).BindTo(SelectedMods);

SelectedMods.BindValueChanged(val =>
{
Expand Down

0 comments on commit 5af18f9

Please sign in to comment.