Navigation
API > API/Editor > API/Editor/UnrealEd
Inheritance Hierarchy
- FGCObject
- FEditorUndoClient
- TSharedFromThis
- FEditorModeTools
- FAssetEditorModeManager
- IPersonaEditorModeManager
- FWidgetModeManager
References
| Module | UnrealEd |
| Header | /Engine/Source/Editor/UnrealEd/Public/EditorModeManager.h |
| Include | #include "EditorModeManager.h" |
Syntax
class FEditorModeTools :
public FGCObject,
public FEditorUndoClient,
public TSharedFromThis< FEditorModeTools >
Remarks
A helper class to store the state of the various editor modes.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< TObjectPtr< UEdMode > > | ActiveScriptableModes | A list of active editor modes. | |
| bool | bHideViewportUI | If true, the viewports will hide all UI overlays | |
| bool | bSelectionHasSceneComponent | If true the current selection has a scene component | |
| bool | bShowWidget | If 1, draw the widget and let the user interact with it. | |
| FVector | CachedLocation | ||
| TArray< FEditorModeID > | DefaultModeIDs | List of default modes for this tool. These must all be compatible with each other. | |
| FVector | GridBase | ||
| FString | InfoString | Draws in the top level corner of all FEditorViewportClient windows (can be used to relay info to the user). | |
| TObjectPtr< UModeManagerInteractiveToolsContext > | InteractiveToolsContext | ||
| UE::Widget::EWidgetMode | OverrideWidgetMode | If the widget mode is being overridden, this will be != WM_None. | |
| TMap< FEditorModeID, TObjectPtr< UEdMode > > | PendingDeactivateModes | A list of previously active editor modes that we will potentially recycle | |
| FVector | PivotLocation | ||
| bool | PivotShown | ||
| TMap< FEditorModeID, TObjectPtr< UEdMode > > | RecycledScriptableModes | A list of previously active editor modes that we will potentially recycle | |
| bool | SnappedActor | ||
| FVector | SnappedLocation | ||
| bool | Snapping | ||
| TWeakPtr< IToolkitHost > | ToolkitHost | The host of the toolkits created by these modes | |
| float | TranslateRotate2DAngle | The angles for the 2d translate rotate widget | |
| float | TranslateRotateXAxisAngle | The angle for the translate rotate widget | |
| UE::Widget::EWidgetMode | WidgetMode | The mode that the editor viewport widget is in. | |
| float | WidgetScale | Scale Factor for Widget |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Activates the default modes defined by this class. | ||
| void | ActivateMode
(
FEditorModeID InID, |
Activates an editor mode. | |
| void | |||
| void | |||
| void | ActorsDuplicatedNotify
(
TArray< AActor* >& InPreDuplicateSelection, |
||
| void | |||
| void | AddDefaultMode
(
const FEditorModeID DefaultModeID |
Adds a new default mode to this tool's list of default modes. | |
| bool | |||
| bool | True if we should allow widget movetrue if we should allow widget move | ||
| bool | BoxSelect
(
FBox& InBox, |
Notifies all active modes of box selection attempts | |
| void | BroadcastCoordSystemChanged
(
ECoordSystem InCoordSystem |
Broadcasts the CoordSystemChangedEvent event | |
| void | BroadcastEditorModeIDChanged
(
const FEditorModeID& ModeID, |
Broadcasts the EditorModeIDChanged event | |
| void | BroadcastWidgetModeChanged
(
UE::Widget::EWidgetMode InWidgetMode |
Broadcasts the WidgetModeChanged event | |
| bool | CanAutoSave () |
Sets the active Modes ToolBar Palette Tab to the named Palettereturns true if all active EdModes are OK with an AutoSave happening now | |
| bool | Check with modes to see if the widget mode can be cycled | ||
| bool | CapturedMouseMove
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes of captured mouse movement | |
| bool | ComputeBoundingBoxForViewportFocus
(
AActor* Actor, |
Allows editor modes to override the bounding box used to focus the viewport on a selection | |
| void | Cycle the widget mode, forwarding queries to modesUsed to cycle widget modes | ||
| void | Deactivates all modes, note some modes can never be deactivated. | ||
| void | DeactivateMode
(
FEditorModeID InID |
Deactivates an editor mode. | |
| void | DeactivateModeAtIndex
(
int32 Index |
||
| void | DestroyMode
(
FEditorModeID InID |
Deactivate the mode and entirely purge it from memory. Used when a mode type is unregistered | |
| bool | True if we should disallow mouse delta tracking. | ||
| void | DrawActiveModes
(
const FSceneView* InView, |
Draws all active modesDraws all active mode components | |
| void | DrawBrackets
(
FEditorViewportClient* ViewportClient, |
||
| void | DrawHUD
(
FEditorViewportClient* InViewportClient, |
Draws the HUD for all active modes | |
| bool | EndTracking
(
FEditorViewportClient* InViewportClient, |
Mouse tracking interface. Passes tracking messages to all active modes | |
| bool | EnsureNotInMode
(
FEditorModeID ModeID, |
Returns true if the current mode is not the specified ModeID. Also optionally warns the user. | |
| void | |||
| void | Exits the given editor mode | ||
| void | ForEachEdMode
(
TFunctionRef< bool(InterfaceToCastTo*)> InCallback |
||
| void | ForEachEdMode
(
TFunctionRef< bool(UEdMode*)> InCalllback |
||
| bool | FrustumSelect
(
const FConvexVolume& InFrustum, |
Notifies all active modes of frustum selection attempts | |
| EEditAction::Type | |||
| EEditAction::Type | |||
| EEditAction::Type | |||
| EEditAction::Type | |||
| EEditAction::Type | |||
| const FEdMode * | GetActiveMode
(
FEditorModeID InID |
Returns a pointer to an active mode specified by the passed in ID If the editor mode is not active, NULL is returned | |
| FEdMode * | GetActiveMode
(
FEditorModeID InID |
Returns a pointer to an active mode specified by the passed in ID If the editor mode is not active, NULL is returned | |
| const SpecificModeType * | GetActiveModeTyped
(
FEditorModeID InID |
||
| SpecificModeType * | GetActiveModeTyped
(
FEditorModeID InID |
||
| UEdMode * | GetActiveScriptableMode
(
FEditorModeID InID |
||
| const FModeTool * | GetActiveTool
(
FEditorModeID InID |
Returns the active tool of the passed in editor mode. | |
| ECoordSystem | GetCoordSystem
(
bool bGetRawValue |
Returns the current CoordSystem | |
| bool | GetCursor
(
EMouseCursor::Type& OutCursor |
Get a cursor to override the default with, if any | |
| FMatrix | |||
| FMatrix | |||
| UTypedElementSelectionSet * | Returns the selection set for the toolkit host. (i.e. the selection set for the level editor) | ||
| FEditorViewportClient * | Returns the currently focused viewport client | ||
| FEditorViewportClient * | Returns the currently hovered viewport client | ||
| UModeManagerInteractiveToolsContext * | |||
| FMatrix | |||
| bool | GetOverrideCursorVisibility
(
bool& bWantsOverride, |
Get override cursor visibility settings | |
| bool | GetPivotForOrbit
(
FVector& OutPivot |
Get a pivot point specified by any active modes around which the camera should orbit | |
| USelection * | Returns the set of selected actors. | ||
| USelection * | Returns the set of selected components. | ||
| USelection * | |||
| bool | |||
| TSharedPtr< IToolkitHost > | Returns the host for toolkits created via modes from this mode manager | ||
| UTexture2D * | |||
| EAxisList::Type | GetWidgetAxisToDraw
(
UE::Widget::EWidgetMode InWidgetMode |
Gets the widget axis to be drawn | |
| FVector | Returns a good location to draw the widget at. | ||
| UE::Widget::EWidgetMode | Retrieves the current widget mode, taking overrides into account. | ||
| float | Get Widget ScaleGet Scale On The Widget | ||
| UWorld * | GetWorld () |
Returns the world that is being edited by this mode manager | |
| bool | HandleClick
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes of mouse click messages. | |
| bool | Check if toolkit host exists | ||
| bool | InputAxis
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes of axis movement | |
| bool | InputDelta
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes of any change in mouse movement | |
| bool | InputKey
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes of keyboard input | |
| bool | IsDefaultMode
(
const FEditorModeID ModeID |
Returns whether or not the provided mode ID is a default mode | |
| bool | Returns true if the default modes are active. | ||
| bool | IsModeActive
(
FEditorModeID InID |
Returns true if the passed in editor mode is active | |
| bool | IsOnlyActiveMode
(
FEditorModeID InMode |
||
| bool | IsOnlyVisibleActiveMode
(
FEditorModeID InMode |
||
| bool | IsOperationSupportedForCurrentAsset
(
EAssetOperation InOperation |
Returns true if all active EdModes are OK support operation on current asset | |
| bool | IsSelectionAllowed
(
AActor* InActor, |
||
| bool | IsSelectionHandled
(
AActor* InActor, |
||
| bool | |||
| bool | IsTracking () |
||
| bool | Is the viewport UI hidden? | ||
| void | LoadConfig () |
Loads the state that was saved in the INI file | |
| void | Load Widget Settings from Ini file | ||
| bool | LostFocus
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes that a viewport has lost focus | |
| void | Notifies all active modes that a map change has occured | ||
| bool | MouseEnter
(
FEditorViewportClient* InViewportClient, |
||
| bool | MouseLeave
(
FEditorViewportClient* InViewportClient, |
||
| bool | MouseMove
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes that the mouse has moved | |
| FCoordSystemChangedEvent & | |||
| FEditorModeIDChangedEvent & | |||
| void | OnEditorSelectionChanged
(
UObject* NewSelection |
Delegate handlers | |
| void | |||
| void | OnModeUnregistered
(
FEditorModeID ModeID |
Removes the mode ID from the tools manager when a mode is unregistered | |
| bool | Called by Editors when they are about to close | ||
| FWidgetModeChangedEvent & | |||
| void | OnWorldCleanup
(
UWorld* InWorld, |
Handles the notification when a world is going through GC to clean up any modes pending deactivation. | |
| bool | PostConvertMouseMovement
(
FEditorViewportClient* InViewportClient |
Called after converting mouse movement to drag/rot | |
| bool | PreConvertMouseMovement
(
FEditorViewportClient* InViewportClient |
Called before converting mouse movement to drag/rot | |
| bool | ProcessCapturedMouseMoves
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes of all captured mouse movement | |
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | ReceivedFocus
(
FEditorViewportClient* InViewportClient, |
Notifies all active modes that a viewport has received focus | |
| void | |||
| void | RemoveDefaultMode
(
const FEditorModeID DefaultModeID |
Removes a default mode | |
| void | Render
(
const FSceneView* InView, |
Renders all active modes | |
| void | RestoreSelection
(
FName SelectionStoreKey |
Restores the selection to the state that was stored using the given key. | |
| void | SaveConfig () |
Saves the current state to the INI file | |
| void | Save Widget Settings to Ini file | ||
| bool | Whether or not the current selection has a scene component selected | ||
| void | SelectNone () |
Notifies all active modes to empty their selections | |
| void | SetCoordSystem
(
ECoordSystem NewCoordSystem |
Sets the current CoordSystem | |
| void | SetCurrentWidgetAxis
(
EAxisList::Type NewAxis |
Sets the current widget axis | |
| void | SetDefaultMode
(
const FEditorModeID DefaultModeID |
Set the default editor mode for these tools | |
| void | SetHideViewportUI
(
bool bInHideViewportUI |
Sets the hide viewport UI state | |
| void | SetPivotLocation
(
const FVector& Location, |
Sets the pivot locations | |
| void | SetShowWidget
(
bool InShowWidget |
||
| void | SetToolkitHost
(
TSharedRef< IToolkitHost > Host |
Sets the host for toolkits created via modes from this mode manager (can only be called once) | |
| void | SetWidgetMode
(
UE::Widget::EWidgetMode InWidgetMode |
Changes the current widget mode. | |
| void | SetWidgetModeOverride
(
UE::Widget::EWidgetMode InWidgetMode |
Allows you to temporarily override the widget mode. | |
| void | SetWidgetScale
(
float InScale |
Set Scale On The Widget | |
| bool | True if brush vertices should be drawn | ||
| bool | ShouldDrawBrushWireframe
(
AActor* InActor |
True if the passed in brush actor should be drawn in wireframe | |
| bool | SnapRotatorToGridOverride
(
FRotator& InRotation |
||
| bool | StartTracking
(
FEditorViewportClient* InViewportClient, |
Mouse tracking interface. Passes tracking messages to all active modes | |
| void | StoreSelection
(
FName SelectionStoreKey, |
Stores the current selection under the given key, and clears the current selection state if requested. | |
| bool | TestAllModes
(
TFunctionRef< bool(UEdMode*)> InCalllback, |
||
| void | Tick
(
FEditorViewportClient* ViewportClient, |
Ticks all active modes | |
| void | |||
| bool | True if any active mode uses a transform widget | ||
| bool | UsesTransformWidget
(
UE::Widget::EWidgetMode CheckMode |
True if any active mode uses the passed in transform widget |
Overridden from FGCObject
| Type | Name | Description | |
|---|---|---|---|
| void | AddReferencedObjects
(
FReferenceCollector& Collector |
Pure virtual that must be overloaded by the inheriting class. | |
| FString | Overload this method to report a name for your referencer |
Overridden from FEditorUndoClient
| Type | Name | Description | |
|---|---|---|---|
| void | PostRedo
(
bool bSuccess |
Signal that client should run any PostRedo code | |
| void | PostUndo
(
bool bSuccess |
Begin FEditorUndoClient. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FCoordSystemChangedEvent | Delegate type for triggering when coordinate system changed | ||
| FEditorModeIDChangedEvent | Multicast delegate for OnModeEntered and OnModeExited callbacks. | ||
| FWidgetModeChangedEvent | Delegate type for triggering when widget mode changed |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| void | DeactivateOtherVisibleModes
(
FEditorModeID InMode |
This function is redundant, and is handled as part of a call to ActivateMode. | |
| bool | Individual toolkit hosts, such as the level editor, should handle determining if they show a mode toolbox for hosted toolkits. |