// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "PCGSettings.h" #include "Framework/Commands/Commands.h" #include "Styling/AppStyle.h" class UPCGSettings; class UEdGraph; struct FEdGraphSchemaAction; class FPCGEditorCommands : public TCommands { public: FPCGEditorCommands(); // ~Begin TCommands<> interface virtual void RegisterCommands() override; // ~End TCommands<> interface TSharedPtr CollapseNodes; TSharedPtr ExportNodes; TSharedPtr ConvertToStandaloneNodes; TSharedPtr Find; TSharedPtr ShowSelectedDetails; TSharedPtr PauseAutoRegeneration; TSharedPtr ForceGraphRegeneration; TSharedPtr OpenDebugObjectTreeTab; TSharedPtr RunDeterminismNodeTest; TSharedPtr RunDeterminismGraphTest; TSharedPtr EditGraphSettings; TSharedPtr ToggleGraphParams; TSharedPtr CancelExecution; TSharedPtr ToggleEnabled; TSharedPtr ToggleDebug; TSharedPtr DebugOnlySelected; TSharedPtr DisableDebugOnAllNodes; TSharedPtr ToggleInspect; TSharedPtr AddSourcePin; TSharedPtr RenameNode; TSharedPtr SelectNamedRerouteUsages; TSharedPtr SelectNamedRerouteDeclaration; TSharedPtr JumpToSource; }; struct FPCGSpawnNodeCommandInfo { explicit FPCGSpawnNodeCommandInfo(TSubclassOf PCGSettingsClass) : PCGSettingsClass(PCGSettingsClass) {} /** Optional preconfigured settings info for a specific configuration of the node. */ FPCGPreConfiguredSettingsInfo PreconfiguredInfo; /** Holds the UI Command to verify chords for this action are held. */ TSharedPtr CommandInfo; /** * Creates an action to be used for placing a node into the graph. * * @return A fully prepared action containing the information to spawn the node. */ TSharedPtr GetAction() const; /** * Gets the PCG Settings class of the spawn node action. * * @return The PCG Settings class of the spawn node action. */ UClass* GetClass() const { return PCGSettingsClass; } private: /** Type of settings class (node) to spawn. */ TSubclassOf PCGSettingsClass; }; /** Handles spawn node commands for the PCG Graph Editor. */ class FPCGEditorSpawnNodeCommands : public TCommands { public: FPCGEditorSpawnNodeCommands() : TCommands(TEXT("PCGEditorSpawnNodes"), NSLOCTEXT("PCGEditorSpawnNodes", "PCGEditorSpawnNodes", "PCG Editor - Spawn Nodes"), NAME_None, FAppStyle::GetAppStyleSetName()) {} // ~Begin TCommands<> interface virtual void RegisterCommands() override; // ~End TCommands<> interface /** * Returns a graph action assigned to the passed in chord * * @param InChord The chord to use for lookup. * @return A shared pointer to the schema action. */ TSharedPtr GetGraphActionByChord(const FInputChord& InChord) const; private: /** An array of all the possible commands for spawning nodes. */ TArray> SpawnNodeCommands; };