Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow SearchContainer implementations to manually trigger a Filter operation #5772

Merged
merged 8 commits into from
May 26, 2023
8 changes: 6 additions & 2 deletions osu.Framework/Graphics/Containers/SearchContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ protected override void Update()
{
base.Update();

if (!filterValid.IsValid)
Filter();
Filter();
Cootz marked this conversation as resolved.
Show resolved Hide resolved
}

/// <summary>
Expand All @@ -104,9 +103,14 @@ protected override void Update()
///
/// However, if <see cref="SearchContainer{T}"/> or any of its parents are hidden this will not be run.
/// If an implementation relies on filtering to become present / visible, this method can be used to force a filter.
///
/// Note that this will only run if the current filter is not in an already valid state.
/// </remarks>
protected void Filter()
{
if (filterValid.IsValid)
return;

canBeShownBindables.Clear();
performFilter();
filterValid.Validate();
Expand Down