Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Editor/UnrealEd/Public/Tools/InteractiveToolsCommands.h |
Include |
#include "Tools/InteractiveToolsCommands.h" |
template<typename CommandContextType>
class TInteractiveToolCommands : public TCommands< CommandContextType >
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<MyToolX> to the input list for all your Tools
add a member TSharedPtr<FUICommandList> 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 | Description | ||
---|---|---|---|
|
ActionCommands |
||
|
SharedActionCommands |
Support for sharing common commands between Tools where the commands are not shared across Tool Modes (and hence not in FStandardToolModeCommands)List FToolActionCommands for standard Tool Actions |
Name | Description | |
---|---|---|
|
TInteractiveToolCommands |
Forwarding constructor |
Name | Description | ||
---|---|---|---|
|
BindCommandsForCurrentTool ( |
Bind any of the registered UICommands to the given Tool, if they are compatible. |
|
|
FindOrCreateSharedCommand ( |
Find or Create a UICommand for a standard Tool Action, that will be shared across Tools |
|
|
TSharedPtr< ... |
FindStandardCommand ( |
Query FStandardToolModeCommands to find an existing command/hotkey for this standard tool action |
|
GetToolDefaultObjectList ( |
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. |
|
|
IntializeStandardToolAction ( |
Create a suitable FInteractiveToolAction for the standard Tool Action, ie with suitable command name and description strings and hotkeys. |
|
|
RegisterUIToolCommand ( |
Utility function that registeres a Tool Aciton as a UICommand |
|
|
UnbindActiveCommands ( |
Unbind all of the currently-registered commands |
Name | Description | ||
---|---|---|---|
|
RegisterCommands() |
Initialize commands. |
Name |
Description |
|
---|---|---|
|
FToolActionCommand |
List of pairs of known Tool Actions and their associated UICommands. |