ContentBrowser.HideSaveCollectionButton
ContentBrowser.HideSaveCollectionButton
#Overview
name: ContentBrowser.HideSaveCollectionButton
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Hide the Content Browser button to save search as a dynamic collection.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ContentBrowser.HideSaveCollectionButton is to control the visibility of the “Save As Collection” button in the Content Browser of Unreal Engine 5’s editor interface. This setting is specifically related to the Content Browser’s functionality for managing collections.
This setting variable is primarily used in the Content Browser module of Unreal Engine 5. Based on the callsites, it’s implemented in the SCollectionView class, which is part of the Content Browser’s user interface.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through the console or configuration files. It’s initialized as false by default.
The associated variable bHideSaveCollectionButton directly interacts with ContentBrowser.HideSaveCollectionButton. They share the same value, with bHideSaveCollectionButton being the actual boolean variable used in the code logic.
Developers must be aware that this variable is currently implemented as a workaround. The comment suggests that it’s meant to hide the “Save As Collection” buttons until collections support the AliasDataSource. This implies that the feature might be temporary or subject to change in future updates of Unreal Engine.
Best practices when using this variable include:
- Consider it as a temporary solution and be prepared for potential changes in future engine versions.
- Use it cautiously, as hiding UI elements might affect user experience and workflow.
- If modifying this setting, ensure to test the Content Browser thoroughly to understand its impact on collection management functionality.
Regarding the associated variable bHideSaveCollectionButton:
The purpose of bHideSaveCollectionButton is to directly control the visibility of the “Save As Collection” button in the Content Browser’s user interface.
This variable is used within the SCollectionView class in the Content Browser module. It directly affects the creation of the context menu for collections.
The value of bHideSaveCollectionButton is set by the ContentBrowser.HideSaveCollectionButton console variable.
It interacts directly with the ContentBrowser.HideSaveCollectionButton setting, serving as the actual boolean flag used in conditional statements.
Developers should be aware that this variable directly impacts the user interface of the Content Browser. When set to true, it prevents the “Save As Dynamic Collection” submenu from being created in the collection context menu.
Best practices for using bHideSaveCollectionButton include:
- Avoid directly modifying this variable in code; instead, use the ContentBrowser.HideSaveCollectionButton console variable to control its value.
- Be cautious when changing its value, as it directly affects user interaction with collections in the Content Browser.
- Consider this variable’s state when developing or modifying features related to collection management in the Content Browser.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SCollectionView.cpp:74
Scope: file
Source code excerpt:
// Workaround to hide Save As Collection buttons until collections support the AliasDataSource
bool bHideSaveCollectionButton = false;
FAutoConsoleVariableRef CVarHideSaveSearchButton(TEXT("ContentBrowser.HideSaveCollectionButton"), bHideSaveCollectionButton, TEXT("Hide the Content Browser button to save search as a dynamic collection."));
namespace CollectionViewFilter
{
void GetBasicStrings(const FCollectionItem& InCollection, TArray<FString>& OutBasicStrings)
{
#Associated Variable and Callsites
This variable is associated with another variable named bHideSaveCollectionButton
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SCollectionView.cpp:73
Scope: file
Source code excerpt:
// Workaround to hide Save As Collection buttons until collections support the AliasDataSource
bool bHideSaveCollectionButton = false;
FAutoConsoleVariableRef CVarHideSaveSearchButton(TEXT("ContentBrowser.HideSaveCollectionButton"), bHideSaveCollectionButton, TEXT("Hide the Content Browser button to save search as a dynamic collection."));
namespace CollectionViewFilter
{
void GetBasicStrings(const FCollectionItem& InCollection, TArray<FString>& OutBasicStrings)
{
#Loc: <Workspace>/Engine/Source/Editor/ContentBrowser/Private/SCollectionView.cpp:849
Scope (from outer to inner):
file
function void SCollectionView::MakeSaveDynamicCollectionMenu
Source code excerpt:
}
if (!bHideSaveCollectionButton)
{
CollectionContextMenu->MakeSaveDynamicCollectionSubMenu(MenuBuilder, InQueryString);
}
FWidgetPath WidgetPath;
if (FSlateApplication::Get().GeneratePathToWidgetUnchecked(AsShared(), WidgetPath, EVisibility::All)) // since the collection window can be hidden, we need to manually search the path with a EVisibility::All instead of the default EVisibility::Visible