bUseSubMenus

bUseSubMenus

#Overview

name: bUseSubMenus

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 bUseSubMenus is to control the menu structure in the Cascade particle system editor within Unreal Engine 5. It determines whether certain menu options are presented in a flat structure or organized into submenus.

This setting variable is primarily used in the Cascade module, which is part of the Unreal Engine’s particle system editor. It’s referenced in the CascadeEmitterCanvasClient class, which is responsible for building the user interface for the Cascade editor.

The value of this variable is set in the UCascadeOptions class, which is a configuration class for Cascade editor preferences. It’s defined as a boolean property that can be edited in the editor’s configuration settings.

This variable interacts with various menu building functions, particularly in the BuildMenuWidgetEmitter() method of FCascadeEmitterCanvasClient. When bUseSubMenus is false, menu items are added directly to the main menu. When it’s true, these items are likely organized into submenus (although the submenu creation code is not shown in the provided excerpts).

Developers should be aware that changing this variable will affect the layout and organization of menus in the Cascade editor. It can impact the user experience and the ease of accessing different particle system editing options.

Best practices when using this variable include:

  1. Consider the complexity of your particle systems and the preferences of your team when deciding whether to use submenus or not.
  2. Ensure consistency across your project by setting this option at a project-wide level rather than changing it frequently.
  3. If you’re developing tools or extensions for the Cascade editor, be aware of this setting and design your UI to work well in both submenu and non-submenu modes.
  4. Document your choice for this setting in your project guidelines to ensure all team members understand the menu structure they’ll be working with.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:572, section: [/Script/UnrealEd.CascadeOptions]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/Cascade/Private/CascadeEmitterCanvasClient.cpp:1963

Scope (from outer to inner):

file
function     TSharedRef<SWidget> FCascadeEmitterCanvasClient::BuildMenuWidgetEmitter

Source code excerpt:

		// Emitter options
		{
			if (EditorOptions->bUseSubMenus == false)
			{
				MenuBuilder.BeginSection("CascadeEmitterOptionsNoSubMenus");
				{
					MenuBuilder.AddMenuEntry(FCascadeCommands::Get().RenameEmitter);
					MenuBuilder.AddMenuEntry(FCascadeCommands::Get().DuplicateEmitter);
					MenuBuilder.AddMenuEntry(FCascadeCommands::Get().DuplicateShareEmitter);

#Loc: <Workspace>/Engine/Source/Editor/Cascade/Private/CascadeEmitterCanvasClient.cpp:2006

Scope (from outer to inner):

file
function     TSharedRef<SWidget> FCascadeEmitterCanvasClient::BuildMenuWidgetEmitter

Source code excerpt:

		// Particle system
		{
			if (EditorOptions->bUseSubMenus == false)
			{
				MenuBuilder.BeginSection("CascadeParticleSystemNoSubMenus");
				{
					MenuBuilder.AddMenuEntry(FCascadeCommands::Get().SelectParticleSystem);
					MenuBuilder.AddMenuEntry(FCascadeCommands::Get().NewEmitterBefore);
					MenuBuilder.AddMenuEntry(FCascadeCommands::Get().NewEmitterAfter);

#Loc: <Workspace>/Engine/Source/Editor/Cascade/Private/CascadeEmitterCanvasClient.cpp:2049

Scope (from outer to inner):

file
function     TSharedRef<SWidget> FCascadeEmitterCanvasClient::BuildMenuWidgetEmitter

Source code excerpt:

				MenuBuilder.BeginSection("CascadeModuleDatTypes");
				{
					if (EditorOptions->bUseSubMenus == false)
					{
						// add the data type modules to the menu
						for (int32 i = 0; i < TypeDataModuleEntries.Num(); i++)
						{
							MenuBuilder.AddMenuEntry(
								FText::FromString( TypeDataModuleEntries[i] ),

#Loc: <Workspace>/Engine/Source/Editor/Cascade/Private/CascadeEmitterCanvasClient.cpp:2074

Scope (from outer to inner):

file
function     TSharedRef<SWidget> FCascadeEmitterCanvasClient::BuildMenuWidgetEmitter

Source code excerpt:

			if (ModuleEntries.Num())
			{
				if (EditorOptions->bUseSubMenus == false)
				{
					// Add each module type to menu.
					for (int32 i = 0; i < ModuleEntries.Num(); i++)
					{
						MenuBuilder.AddMenuEntry(
							FText::FromString( ModuleEntries[i] ),

#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/MVVM/ViewModels/ObjectBindingModel.cpp:561

Scope (from outer to inner):

file
namespace    UE::Sequencer
function     TSharedRef<SWidget> FObjectBindingModel::GetAddTrackMenuContent

Source code excerpt:


	//@todo need to resolve this between UMG and the level editor sequencer
	const bool bUseSubMenus = Sequencer->IsLevelEditorSequencer();

	UObject* BoundObject = Sequencer->FindSpawnedObjectOrTemplate(ObjectBindingID);

	const UClass* MainSelectionObjectClass = FindObjectClass();

	TArray<FGuid> ObjectBindings;

#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/MVVM/ViewModels/ObjectBindingModel.cpp:741

Scope (from outer to inner):

file
namespace    UE::Sequencer
function     TSharedRef<SWidget> FObjectBindingModel::GetAddTrackMenuContent

Source code excerpt:


			// If this menu data only has one property name, add the menu item
			if (Pair.Value[MenuDataIndex].PropertyPath.GetNumProperties() == 1 || !bUseSubMenus)
			{
				AddPropertyMenuItems(AddTrackMenuBuilder, KeyableSubMenuPropertyPaths, 0, -1);
				++MenuDataIndex;
			}
			// Otherwise, look to the next menu data to gather up new data
			else

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Preferences/CascadeOptions.h:26

Scope (from outer to inner):

file
class        class UCascadeOptions : public UObject

Source code excerpt:


	UPROPERTY(EditAnywhere, config, Category=Options)
	uint32 bUseSubMenus:1;

	UPROPERTY(EditAnywhere, config, Category=Options)
	uint32 bUseSpaceBarReset:1;

	UPROPERTY(EditAnywhere, config, Category=Options)
	uint32 bUseSpaceBarResetInLevel:1;