Navigation
API > API/Developer > API/Developer/ToolMenus
| Name | UToolMenus |
| Type | class |
| Header File | /Engine/Source/Developer/ToolMenus/Public/ToolMenus.h |
| Include Path | #include "ToolMenus.h" |
Syntax
UCLASS (MinimalAPI, Config=EditorPerProjectUserSettings)
class UToolMenus : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UToolMenus
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UToolMenus() |
ToolMenus.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FEditMenuDelegate | TBaseDelegate_OneParam< void, class UToolMenu * > | Delegate that opens a menu editor | ToolMenus.h |
| FGenerateWidgetEvent | TMulticastDelegate_TwoParams< void, const FName InName, const FToolMenuContext &InMenuContext > | ToolMenus.h | |
| FOnStringCommandExecuted | TMulticastDelegate_TwoParams< void, FName MenuName, FName TypeName > | ToolMenus.h | |
| FShouldDisplayExtensionPoints | TBaseDelegate_NoParams< bool > | Displaying extension points is for debugging menus | ToolMenus.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bHasShutDown | bool | ToolMenus.h | |
| InternalStartupCallbackHandle | TOptional< FDelegateHandle > | ToolMenus.h | |
| Singleton | UToolMenus * | ToolMenus.h | |
| StartupCallbacks | FSimpleMulticastDelegate | ToolMenus.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| EditMenuDelegate | FEditMenuDelegate | ToolMenus.h | ||
| EditMenuIcon | FSlateIcon | Icon to display in menus for command to open menu editor | ToolMenus.h | |
| EditToolbarIcon | FSlateIcon | Icon to display in toolbars for command to open menu editor | ToolMenus.h | |
| OnPostGenerateWidget | FGenerateWidgetEvent | Called after we generate a menu widget. | ToolMenus.h | |
| OnPreGenerateWidget | FGenerateWidgetEvent | Called before we generate a menu widget. | ToolMenus.h | |
| OnStringCommandExecuted | FOnStringCommandExecuted | Called when we execute a string command. Useful for analytics | ToolMenus.h | |
| ShouldDisplayExtensionPoints | FShouldDisplayExtensionPoints | ToolMenus.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCleanupStaleWidgetsNextTick | bool | ToolMenus.h | ||
| bCleanupStaleWidgetsNextTickGC | bool | ToolMenus.h | ||
| bEditMenusMode | bool | ToolMenus.h | ||
| bNextTickTimerIsSet | bool | ToolMenus.h | ||
| bRefreshWidgetsNextTick | bool | ToolMenus.h | ||
| bSuppressRefreshWidgetsRequests | bool | ToolMenus.h | ||
| CustomizedMenus | TArray< FCustomizedToolMenu > | ToolMenus.h |
|
|
| GeneratedMenuWidgets | TMap< FName, TSharedPtr< FGeneratedToolMenuWidgets > > | ToolMenus.h | ||
| MenuProfiles | TMap< FName, FToolMenuProfileMap > | ToolMenus.h |
|
|
| Menus | TMap< FName, TObjectPtr< UToolMenu > > | ToolMenus.h | ||
| MenuSubstitutionsDuringGenerate | TMap< FName, FName > | Allow substituting one menu for another during generate but not during find or extend | ToolMenus.h |
|
| OwnerStack | TArray< FToolMenuOwner > | ToolMenus.h | ||
| RuntimeCustomizedMenus | TArray< FCustomizedToolMenu > | Transient customizations made during runtime that will not be saved | ToolMenus.h | |
| RuntimeMenuProfiles | TMap< FName, FToolMenuProfileMap > | Transient profiles made during runtime that will not be saved | ToolMenus.h | |
| SetTimerForNextTickDelegate | FSimpleDelegate | ToolMenus.h | ||
| StringCommandHandlers | TMap< FName, FToolMenuExecuteString > | ToolMenus.h | ||
| WidgetObjectReferences | TMap< TWeakPtr< FMultiBox >, TArray< TObjectPtr< const UObject > > > | ToolMenus.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddEntry
(
const FName MenuName, |
Registers an entry for a menu's section | ToolMenus.h | |
FCustomizedToolMenu * AddMenuCustomization
(
const FName InName |
Find or add customization settings for a menu | ToolMenus.h | |
FToolMenuProfile * AddMenuProfile
(
const FName InMenuName, |
Find or add a specific profile for a menu | ToolMenus.h | |
void AddMenuSubstitutionDuringGenerate
(
const FName OriginalMenu, |
Substitute one menu for another during generate but not during find or extend | ToolMenus.h | |
FCustomizedToolMenu * AddRuntimeMenuCustomization
(
const FName InName |
Find or add runtime customization settings for a menu | ToolMenus.h | |
FToolMenuProfile * AddRuntimeMenuProfile
(
const FName InMenuName, |
Find or add a specific runtime only profile for a menu | ToolMenus.h | |
void AddSection
(
const FName MenuName, |
Registers a section for a menu | ToolMenus.h | |
| Bake final menu including calls to construction delegates, sorting, and customization | ToolMenus.h | ||
void AssignSetTimerForNextTickDelegate
(
const FSimpleDelegate& InDelegate |
Sets delegate to setup timer for deferred one off ticks | ToolMenus.h | |
virtual void BeginDestroy() |
ToolMenus.h | ||
void CleanupStaleWidgetsNextTick
(
bool bGarbageCollect |
Release references to UObjects of widgets that have been deleted. | ToolMenus.h | |
TArray< UToolMenu * > CollectHierarchy
(
const FName Name |
Returns list of menus starting with root parent | ToolMenus.h | |
FToolMenuOwner CurrentOwner() |
For advanced use cases | ToolMenus.h | |
UToolMenu * ExtendMenu
(
const FName Name |
Extends a menu without registering the menu or claiming ownership of it. | ToolMenus.h |
|
UToolMenu * FindMenu
(
const FName Name |
Finds an existing menu that has been registered or extended. | ToolMenus.h |
|
FCustomizedToolMenu * FindMenuCustomization
(
const FName InName |
Find customization settings for a menu | ToolMenus.h | |
int32 FindMenuCustomizationIndex
(
const FName InName |
Find index of customization settings for a menu | ToolMenus.h | |
FToolMenuProfile * FindMenuProfile
(
const FName InMenuName, |
Find a specific profile for a menu | ToolMenus.h | |
FCustomizedToolMenu * FindRuntimeMenuCustomization
(
const FName InName |
Find runtime customization settings for a menu | ToolMenus.h | |
FToolMenuProfile * FindRuntimeMenuProfile
(
const FName InMenuName, |
Find a specific runtime only profile for a menu | ToolMenus.h | |
UToolMenu * GenerateMenu
(
const FName Name, |
Create a finalized menu that combines all parents used to generate a widget. | ToolMenus.h | |
UToolMenu * GenerateMenuAsBuilder
(
const UToolMenu* InMenu, |
Create a finalized menu based on a custom crafted menu. Advanced special use cases only. | ToolMenus.h | |
| Generate either a menu or submenu ready for editing | ToolMenus.h | ||
| Generates sub menu by entry name in the given generated menu parent | ToolMenus.h | ||
TSharedRef< SWidget > GenerateWidget
(
const TArray< UToolMenu* >& Hierarchy, |
Generate widget from a hierarchy of menus. For advanced specialized use cases. | ToolMenus.h | |
TSharedRef< SWidget > GenerateWidget
(
const FName Name, |
Generate widget from a registered menu. Most common function used to generate new menu widgets. | ToolMenus.h | |
TSharedRef< SWidget > GenerateWidget
(
UToolMenu* GeneratedMenu |
Generate widget from a final collapsed menu. For advanced specialized use cases. | ToolMenus.h | |
bool GetEditMenusMode() |
When true, adds command to open edit menu dialog to each menu | ToolMenus.h | |
void HandleNextTick() |
Timer function used to consolidate multiple duplicate requests into a single frame. | ToolMenus.h | |
bool IsMenuRegistered
(
const FName Name |
Determines if a menu has already been registered. | ToolMenus.h |
|
void RefreshAllWidgets() |
Rebuilds all currently generated widgets next tick. | ToolMenus.h |
|
bool RefreshMenuWidget
(
const FName Name |
Rebuilds all widgets generated from a specific menu. | ToolMenus.h |
|
UToolMenu * RegisterMenu
(
FName Name, |
Registers a menu by name | ToolMenus.h |
|
void RegisterStringCommandHandler
(
const FName InName, |
Registers a new type of string based command handler. | ToolMenus.h | |
void RemoveAllCustomizations() |
Remove all menu customizations for all menus | ToolMenus.h | |
void RemoveCustomization
(
const FName InName |
Remove customization for a menu | ToolMenus.h | |
void RemoveEntry
(
const FName MenuName, |
Removes a menu entry from a given menu and section | ToolMenus.h |
|
void RemoveMenu
(
const FName MenuName |
Unregisters a menu by name | ToolMenus.h |
|
void RemoveSection
(
const FName MenuName, |
Removes a section from a given menu | ToolMenus.h |
|
void RemoveSubstitutionDuringGenerate
(
const FName InMenu |
Remove substitute one menu for another during generate | ToolMenus.h | |
void SaveCustomizations() |
Save menu customizations to ini files | ToolMenus.h | |
void SetEditMenusMode
(
bool bEnable |
Enables adding command to open edit menu dialog to each menu | ToolMenus.h | |
void SetSectionLabel
(
const FName MenuName, |
Sets a section's displayed label text. | ToolMenus.h |
|
void SetSectionPosition
(
const FName MenuName, |
Sets where to insert a section into a menu when generating relative to other section names. | ToolMenus.h |
|
void UnregisterOwnerByName
(
FName InOwnerName |
Removes all entries that were registered under a specific owner name | ToolMenus.h |
|
void UnregisterRuntimeMenuCustomizationOwner
(
const FName InOwnerName |
Unregister runtime customization settings for a specific owner name | ToolMenus.h | |
void UnregisterRuntimeMenuProfileOwner
(
const FName InOwnerName |
Unregister runtime profile settings for a specific owner name | ToolMenus.h | |
void UnregisterStringCommandHandler
(
const FName InName |
Removes a string based command handler. | ToolMenus.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool AddMenuEntryObject
(
UToolMenuEntryScript* MenuEntryObject |
Registers menu entry object from blueprint/script | ToolMenus.h |
|
static void AddReferencedObjects
(
UObject* InThis, |
ToolMenus.h | ||
static TAttribute< EVisibility > CalculateToolbarVisibility
(
UToolMenu* Menu, |
ToolMenus.h | ||
static bool CanSafelyRouteCall() |
Returns true if safe to call into script | ToolMenus.h | |
static FUIAction ConvertScriptObjectToUIAction
(
UToolMenuEntryScript* ScriptObject, |
ToolMenus.h | ||
static FUIAction ConvertUIAction
(
const FToolMenuEntry& Block, |
Converts a string command to a FUIAction | ToolMenus.h | |
static FUIAction ConvertUIAction
(
const FToolUIActionChoice& Choice, |
ToolMenus.h | ||
static FUIAction ConvertUIAction
(
const FToolUIAction& Actions, |
ToolMenus.h | ||
static FUIAction ConvertUIAction
(
const FToolDynamicUIAction& Actions, |
ToolMenus.h | ||
static void ExecuteStringCommand
(
const FToolMenuStringCommand StringCommand, |
ToolMenus.h | ||
static UObject * FindContext
(
const FToolMenuContext& InContext, |
Finds a context object of a given class if it exists | ToolMenus.h |
|
static UToolMenus * Get() |
ToolMenus.h |
|
|
static bool IsToolMenuUIEnabled () |
Returns true if slate initialized and editor GUI is being used. | ToolMenus.h | |
static FName JoinMenuPaths
(
const FName Base, |
Join two paths together | ToolMenus.h | |
static void ModifyEntryForEditDialog
(
FToolMenuEntry& Entry |
ToolMenus.h | ||
static void PrivateStartupCallback() |
ToolMenus.h | ||
static FDelegateHandle RegisterStartupCallback
(
const FSimpleMulticastDelegate::FDelegate& InDelegate |
Delays menu registration until safe and ready Will not trigger if Slate does not end up being enabled after loading Will not trigger when running commandlet, game, dedicated server or client only | ToolMenus.h | |
static bool RemoveMenuEntryObject
(
UToolMenuEntryScript* MenuEntryObject |
Unregisters menu entry object from blueprint/script | ToolMenus.h |
|
static bool SplitMenuPath
(
const FName MenuPath, |
Break apart a menu path into components | ToolMenus.h | |
static UToolMenus * TryGet() |
Try to get UToolMenus without forcing ToolMenus module to load. | ToolMenus.h | |
static void UnregisterOwner
(
FToolMenuOwner Owner |
Unregister everything associated with the given owner without forcing ToolMenus module to load. | ToolMenus.h | |
static void UnregisterPrivateStartupCallback() |
ToolMenus.h | ||
static void UnRegisterStartupCallback
(
FDelegateUserObjectConst UserPointer |
Unregister a startup callback delegate by pointer | ToolMenus.h | |
static void UnRegisterStartupCallback
(
FDelegateHandle InHandle |
Unregister a startup callback delegate by handle | ToolMenus.h |