MenuPriority

MenuPriority

#Overview

name: MenuPriority

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MenuPriority is to determine the position of an actor factory item in the menu hierarchy within the Unreal Engine editor. It is used to sort and organize actor creation options in the editor’s interface.

This setting variable is primarily used in the Unreal Editor subsystem, specifically within the ActorFactory class and the EditorEngine. It’s part of the UnrealEd module, which is responsible for much of the editor’s functionality.

The value of this variable is set through configuration files, as indicated by the UPROPERTY(config) decorator in the ActorFactory class definition.

MenuPriority interacts with other variables in the ActorFactory class, such as NewActorClassName and NewActorClass. It’s used in conjunction with these to define and organize the creation of new actors in the editor.

Developers must be aware that higher MenuPriority values will place the actor factory item higher in the menu list. This can significantly affect the user experience in the editor, so it should be set thoughtfully.

Best practices when using this variable include:

  1. Assigning priority values that make logical sense in the context of your project’s workflow.
  2. Avoiding extremely high or low values that might interfere with engine-defined actor factories.
  3. Maintaining consistent priority schemes across related actor factories.
  4. Documenting the priority values used in your project to ensure consistency among team members.
  5. Periodically reviewing and adjusting priorities as your project evolves to maintain an optimal editor experience.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:142, section: [/Script/UnrealEd.ActorFactory]

Location: <Workspace>/Engine/Config/BaseEditor.ini:145, section: [/Script/UnrealEd.ActorFactoryStaticMesh]

Location: <Workspace>/Engine/Config/BaseEditor.ini:148, section: [/Script/UnrealEd.ActorFactoryInteractiveFoliage]

Location: <Workspace>/Engine/Config/BaseEditor.ini:151, section: [/Script/UnrealEd.ActorFactoryPlayerStart]

Location: <Workspace>/Engine/Config/BaseEditor.ini:154, section: [/Script/UnrealEd.ActorFactoryDirectionalLight]

Location: <Workspace>/Engine/Config/BaseEditor.ini:157, section: [/Script/UnrealEd.ActorFactoryPointLight]

Location: <Workspace>/Engine/Config/BaseEditor.ini:160, section: [/Script/UnrealEd.ActorFactorySpotLight]

Location: <Workspace>/Engine/Config/BaseEditor.ini:163, section: [/Script/UnrealEd.ActorFactoryPhysicsActor]

Location: <Workspace>/Engine/Config/BaseEditor.ini:166, section: [/Script/UnrealEd.ActorFactorySkeletalMesh]

Location: <Workspace>/Engine/Config/BaseEditor.ini:169, section: [/Script/UnrealEd.ActorFactorySkeletalMeshSingleAnim]

Location: <Workspace>/Engine/Config/BaseEditor.ini:172, section: [/Script/UnrealEd.ActorFactoryAmbientSoundSimpleToggleable]

Location: <Workspace>/Engine/Config/BaseEditor.ini:175, section: [/Script/UnrealEd.ActorFactoryAmbientSoundNonLoopingToggleable]

Location: <Workspace>/Engine/Config/BaseEditor.ini:178, section: [/Script/UnrealEd.ActorFactoryAmbientSoundSimple]

Location: <Workspace>/Engine/Config/BaseEditor.ini:181, section: [/Script/UnrealEd.ActorFactoryAmbientSound]

Location: <Workspace>/Engine/Config/BaseEditor.ini:184, section: [/Script/UnrealEd.ActorFactoryAmbientSoundMovable]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/ActorFactories/ActorFactory.h:33

Scope (from outer to inner):

file
class        class UActorFactory : public UObject, public IAssetFactoryInterface

Source code excerpt:

	/** Indicates how far up the menu item should be. The higher the number, the higher up the list.*/
	UPROPERTY(config)
	int32 MenuPriority;

	/** name of actor subclass this actorfactory creates - dynamically loaded.  Overrides NewActorClass. */
	UPROPERTY(config)
	FString NewActorClassName;

	/**  AActor  subclass this ActorFactory creates. */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:974

Scope (from outer to inner):

file
function     void UEditorEngine::InitEditor
function     bool operator

Source code excerpt:

		FORCEINLINE bool operator()(const UActorFactory& A, const UActorFactory& B) const
		{
			if (B.MenuPriority == A.MenuPriority)
			{
				if (A.GetClass() != UActorFactory::StaticClass() && B.IsA(A.GetClass()))
				{
					return false;
				}
				else if (B.GetClass() != UActorFactory::StaticClass() && A.IsA(B.GetClass()))

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:991

Scope (from outer to inner):

file
function     void UEditorEngine::InitEditor
function     bool operator

Source code excerpt:

			else
			{
				return B.MenuPriority < A.MenuPriority;
			}
		}
	};
	// Sort by menu priority.
	ActorFactories.Sort(FCompareUActorFactoryByMenuPriority());