Navigation
API > API/Editor > API/Editor/UnrealEd
TInteractiveToolCommands is a base class that handles connecting up Tool Actions (ie the FInteractiveToolAction provided by a UInteractiveTool) to the UnrealEditor Command system, which allows for remappable hotkeys, etc
Usage is as follows:
- in your EdMode Module, create a subclass-instance of this, say FMyToolCommands and call FMyToolCommands::Register() in your ::StartupModule() function
- subclass must implement GetToolDefaultObjectList(), here you just add GetMutableDefault
to the input list for all your Tools - add a member TSharedPtr
UICommandList; to your EdMode impl - when you start a new Tool, call FMyToolCommands::Get().BindCommandsForCurrentTool(UICommandList, NewTool)
- when you end a Tool, call FMyToolCommands::Get().UnbindActiveCommands()
- in your EdModeImpl::InputKey override, call UICommandList->ProcessCommandBindings()
| Name | TInteractiveToolCommands |
| Type | class |
| Header File | /Engine/Source/Editor/UnrealEd/Public/Tools/InteractiveToolsCommands.h |
| Include Path | #include "Tools/InteractiveToolsCommands.h" |
Syntax
template<typename CommandContextType>
class TInteractiveToolCommands :
public TCommands< CommandContextType > ,
public UE::IInteractiveToolCommandsInterface
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → FBindingContext → TCommands → TInteractiveToolCommands
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Forwarding constructor | Tools/InteractiveToolsCommands.h |
Structs
| Name | Remarks |
|---|---|
| FToolActionCommand | List of pairs of known Tool Actions and their associated UICommands. |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void GetToolDefaultObjectList
(
TArray< UInteractiveTool* >& ToolCDOs |
Interface that subclasses need to implement RegisterCommands() needs actual UInteractiveTool instances for all the Tools that want to provide Actions which will be connected to hotkeys. | Tools/InteractiveToolsCommands.h |
Overridden from TCommands
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void RegisterCommands () |
Initialize commands. | Tools/InteractiveToolsCommands.h |
Overridden from IInteractiveToolCommandsInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BindCommandsForCurrentTool
(
TSharedPtr< FUICommandList > UICommandList, |
Bind any of the registered UICommands to the given Tool, if they are compatible. | Tools/InteractiveToolsCommands.h | |
virtual void UnbindActiveCommands
(
TSharedPtr< FUICommandList > UICommandList |
Unbind all of the currently-registered commands | Tools/InteractiveToolsCommands.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool FindOrCreateSharedCommand
(
EStandardToolActions ActionID, |
Find or Create a UICommand for a standard Tool Action, that will be shared across Tools | Tools/InteractiveToolsCommands.h | |
virtual TSharedPtr< FUICommandInfo > FindStandardCommand
(
EStandardToolActions ToolActionID |
Query FStandardToolModeCommands to find an existing command/hotkey for this standard tool action | Tools/InteractiveToolsCommands.h | |
virtual bool IntializeStandardToolAction
(
EStandardToolActions ActionID, |
Create a suitable FInteractiveToolAction for the standard Tool Action, ie with suitable command name and description strings and hotkeys. | Tools/InteractiveToolsCommands.h | |
void RegisterUIToolCommand
(
const FInteractiveToolAction& ToolAction, |
Utility function that registeres a Tool Aciton as a UICommand | Tools/InteractiveToolsCommands.h |