mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:42:57 +08:00
Fix duplicate linq and reword comment
This commit is contained in:
parent
a1015b4145
commit
64e96c6d82
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user