Navigation
API > API/Editor > API/Editor/ClassViewer > API/Editor/ClassViewer/IClassViewerFilter
Description
Can be optionally implemented to gather additional filter flags. If present, these will be added into the View Options menu where they can be toggled on/off by the user.
Example: In the following case, we define a custom filter option to allow the user to toggle the entire filter on/off. This is synced with a global config setting (MyFilterConfigSettings->bIsCustomFilterEnabled) that is checked at filtering time.
void FMyCustomClassFilter::GetFilterOptions(TArray
OutFilterOptions.Add(MyFilterOption); }
void FMyCustomClassFilter::OnOptionChanged(bool bIsEnabled) { // Updates the filter's config setting whenever the user changes the option. MyFilterConfigSettings->bIsCustomFilterEnabled = bIsEnabled; }
bool FMyCustomClassFilter::IsClassAllowed(...) { if(!MyFilterConfigSettings->bIsCustomFilterEnabled) { // Filter is disabled; always allow the class. return true; }
// ... }
| Name | GetFilterOptions |
| Type | function |
| Header File | /Engine/Source/Editor/ClassViewer/Public/ClassViewerFilter.h |
| Include Path | #include "ClassViewerFilter.h" |
virtual void GetFilterOptions
(
TArray< TSharedRef< FClassViewerFilterOption > > & OutFilterOptions
)
Parameters
| Name | Remarks |
|---|---|
| OutFilterOptions | On output, contains the set of options to be added into the filter menu. The Class Viewer requires these to be allocated so that each option can be safely referenced by each menu item widget in the View Options menu. |