Hide mod columns if all mods within are filtered out

This commit is contained in:
Bartłomiej Dach
2022-05-08 14:44:54 +02:00
parent 569b73cf69
commit 92ccec20d7
2 changed files with 47 additions and 11 deletions

View File

@ -55,8 +55,18 @@ namespace osu.Game.Overlays.Mods
}
}
/// <summary>
/// Determines whether this column should accept user input.
/// </summary>
public Bindable<bool> Active = new BindableBool(true);
private readonly Bindable<bool> allFiltered = new BindableBool();
/// <summary>
/// True if all of the panels in this column have been filtered out by the current <see cref="Filter"/>.
/// </summary>
public IBindable<bool> AllFiltered => allFiltered;
/// <summary>
/// List of mods marked as selected in this column.
/// </summary>
@ -339,6 +349,9 @@ namespace osu.Game.Overlays.Mods
panel.ApplyFilter(Filter);
}
allFiltered.Value = panelFlow.All(panel => panel.Filtered.Value);
Alpha = allFiltered.Value ? 0 : 1;
if (toggleAllCheckbox != null && !SelectionAnimationRunning)
{
toggleAllCheckbox.Alpha = panelFlow.Any(panel => !panel.Filtered.Value) ? 1 : 0;