1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-09 04:53:52 +08:00

Fix duplicate linq and reword comment

This commit is contained in:
Bartłomiej Dach
2023-06-18 14:03:26 +02:00
Unverified
parent a1015b4145
commit 64e96c6d82
+5 -3
View File
@@ -150,10 +150,12 @@ namespace osu.Game.Overlays.Mods
if (toggleAllCheckbox != null && !SelectionAnimationRunning)
{
toggleAllCheckbox.Alpha = availableMods.Any(panel => panel.Visible) ? 1 : 0;
bool anyPanelsVisible = availableMods.Any(panel => panel.Visible);
//Prevent checkbox from checking when column have on valid panels
if (availableMods.Any(panel => panel.Visible))
toggleAllCheckbox.Alpha = anyPanelsVisible ? 1 : 0;
// checking `anyPanelsVisible` is important since `.All()` returns `true` for empty enumerables.
if (anyPanelsVisible)
toggleAllCheckbox.Current.Value = availableMods.Where(panel => panel.Visible).All(panel => panel.Active.Value);
}
}