bUseLegacyLayout

bUseLegacyLayout

#Overview

name: bUseLegacyLayout

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bUseLegacyLayout is to control the layout and behavior of the Blueprint Palette in Unreal Engine’s editor. This variable determines whether the Blueprint Palette should use a legacy layout or a newer, more feature-rich layout.

This setting variable is primarily used in the Kismet module, which is part of Unreal Engine’s editor subsystem. Specifically, it affects the Blueprint editor and its palette functionality.

The value of this variable is typically set in the GEditorIni configuration file, under the “BlueprintEditor.Palette” section. It can be retrieved using the GConfig->GetBool() function, as seen in the provided code snippets.

Several other variables and components interact with bUseLegacyLayout:

  1. UBlueprintPaletteFavorites: The visibility of favorite toggles is affected by this setting.
  2. FBlueprintLibraryPaletteCommands: Context menu entries are generated differently based on this setting.
  3. SBlueprintFavoritesPalette and SBlueprintLibraryPalette: These components are constructed and laid out differently depending on the value of bUseLegacyLayout.

Developers should be aware that:

  1. Changing this setting affects the user interface and functionality of the Blueprint Palette.
  2. It may impact user experience and workflow, especially for users accustomed to a specific layout.
  3. Some features, like favorites and filtering, may behave differently or be unavailable in the legacy layout.

Best practices when using this variable include:

  1. Clearly communicating to users which layout is in use and how to switch between them.
  2. Ensuring that all relevant functionality is accessible regardless of the chosen layout.
  3. Testing both layouts thoroughly when making changes to the Blueprint Palette system.
  4. Considering user feedback and preferences when deciding whether to default to the legacy or new layout.
  5. Documenting any differences in functionality or user interaction between the two layouts.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:190, section: [BlueprintEditor.Palette]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintActionMenu.cpp:167

Scope (from outer to inner):

file
class        class SBlueprintActionFavoriteToggle : public SCompoundWidget
function     EVisibility IsVisible

Source code excerpt:

	{
		bool bNoFavorites = false;
		GConfig->GetBool(TEXT("BlueprintEditor.Palette"), TEXT("bUseLegacyLayout"), bNoFavorites, GEditorIni);

		UBlueprintPaletteFavorites const* const BlueprintFavorites = GetDefault<UEditorPerProjectUserSettings>()->BlueprintFavorites;

		EVisibility CurrentVisibility = EVisibility::Hidden;
		if (!bNoFavorites && BlueprintFavorites && BlueprintFavorites->CanBeFavorited(ActionPtr.Pin()))
		{

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintLibraryPalette.cpp:229

Scope (from outer to inner):

file
function     void SBlueprintLibraryPalette::Construct

Source code excerpt:

	SuperArgs._ShowFavoriteToggles = true;

	bUseLegacyLayout = InArgs._UseLegacyLayout.Get();

	SBlueprintSubPalette::Construct(SuperArgs, InBlueprintEditor);
}

/*******************************************************************************
* SBlueprintLibraryPalette Private Methods

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintLibraryPalette.cpp:242

Scope (from outer to inner):

file
function     void SBlueprintLibraryPalette::CollectAllActions

Source code excerpt:

{
	FString RootCategory = SBlueprintLibraryPaletteUtils::LibraryCategoryName;
	if (bUseLegacyLayout)
	{
		RootCategory = TEXT("");
	}
	
	FBlueprintActionContext FilterContext;
	FilterContext.Blueprints.Add(GetBlueprint());

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintLibraryPalette.cpp:270

Scope (from outer to inner):

file
function     TSharedRef<SVerticalBox> SBlueprintLibraryPalette::ConstructHeadingWidget

Source code excerpt:

	SAssignNew(ClassPickerToolTip, SToolTip).Text(LOCTEXT("ClassFilter", "Filter the available nodes by class."));

	if (bUseLegacyLayout)
	{
		SuperHeading = SNew(SVerticalBox).ToolTipText(InToolTip);
	}

	SuperHeading->AddSlot()
		.AutoHeight()

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintLibraryPalette.cpp:358

Scope (from outer to inner):

file
function     void SBlueprintLibraryPalette::GenerateContextMenuEntries

Source code excerpt:

void SBlueprintLibraryPalette::GenerateContextMenuEntries(FMenuBuilder& MenuBuilder) const
{
	if (!bUseLegacyLayout)
	{
		FBlueprintLibraryPaletteCommands const& PaletteCommands = FBlueprintLibraryPaletteCommands::Get();

		MenuBuilder.BeginSection("Favorites");
		{
			TSharedPtr<FEdGraphSchemaAction> SelectedAction = GetSelectedAction();

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintLibraryPalette.h:87

Scope (from outer to inner):

file
class        class SBlueprintLibraryPalette : public SBlueprintSubPalette

Source code excerpt:


	/** Used to help ease the transition for users who like the old format */
	bool bUseLegacyLayout;

	/** Class we want to see content of */
	TWeakObjectPtr<UClass> FilterClass;

	/** Combo button used to choose class to filter */
	TSharedPtr<SComboButton> FilterComboButton;

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SBlueprintPalette.cpp:2235

Scope (from outer to inner):

file
function     void SBlueprintPalette::Construct

Source code excerpt:

	GConfig->GetFloat(*BlueprintPalette::ConfigSection, *BlueprintPalette::LibraryHeightConfigKey, LibraryHeightRatio, GEditorPerProjectIni);

	bool bUseLegacyLayout = false;
	GConfig->GetBool(*BlueprintPalette::ConfigSection, TEXT("bUseLegacyLayout"), bUseLegacyLayout, GEditorIni);

	SlowTask.EnterProgressFrame();
	TSharedRef<SWidget> FavoritesContent = SNew(SBlueprintFavoritesPalette, InBlueprintEditor);

	SlowTask.EnterProgressFrame();
	TSharedRef<SWidget> LibraryContent = SNew(SBlueprintLibraryPalette, InBlueprintEditor)
		.UseLegacyLayout(bUseLegacyLayout);

	if (bUseLegacyLayout)
	{
		LibraryWrapper = LibraryContent;

		this->ChildSlot
		[
			LibraryContent