// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Input/DragAndDrop.h" #include "Input/Reply.h" #include "Widgets/SWidget.h" #include "GraphEditorDragDropAction.h" class SGraphNode; class SGraphPanel; class UEdGraph; class GRAPHEDITOR_API FDragNode : public FGraphEditorDragDropAction { public: DRAG_DROP_OPERATOR_TYPE(FDragNode, FGraphEditorDragDropAction) static TSharedRef New(const TSharedRef& InGraphPanel, const TSharedRef& InDraggedNode); static TSharedRef New(const TSharedRef& InGraphPanel, const TArray< TSharedRef >& InDraggedNodes); // FGraphEditorDragDropAction interface virtual void HoverTargetChanged() override; virtual FReply DroppedOnNode(FVector2D ScreenPosition, FVector2D GraphPosition) override; virtual FReply DroppedOnPanel( const TSharedRef< SWidget >& Panel, FVector2D ScreenPosition, FVector2D GraphPosition, UEdGraph& Graph) override; //virtual void OnDragBegin( const TSharedRef& InPin) override; virtual void OnDragged (const class FDragDropEvent& DragDropEvent ) override; // End of FGraphEditorDragDropAction interface const TArray< TSharedRef > & GetNodes() const; virtual bool IsValidOperation() const; protected: typedef FGraphEditorDragDropAction Super; UEdGraphNode* GetGraphNodeForSGraphNode(TSharedRef& SNode); protected: /** graph panel */ TSharedPtr GraphPanel; /** our dragged nodes*/ TArray< TSharedRef > DraggedNodes; /** Offset information for the decorator widget */ FVector2D DecoratorAdjust; /** if we can drop our node here*/ bool bValidOperation; };