2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class FDragConnection : public FGraphEditorDragDropAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
2014-04-02 18:09:23 -04:00
|
|
|
DRAG_DROP_OPERATOR_TYPE(FDragConnection, FGraphEditorDragDropAction)
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-05-15 17:34:14 -04:00
|
|
|
static TSharedRef<FDragConnection> New(const TSharedRef<SGraphPanel>& InGraphPanel, const TArray< TSharedRef<SGraphPin> >& InStartingPins, bool bInShiftOperation);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// FDragDropOperation interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void OnDrop( bool bDropWasHandled, const FPointerEvent& MouseEvent ) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End of FDragDropOperation interface
|
|
|
|
|
|
|
|
|
|
// FGraphEditorDragDropAction interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void HoverTargetChanged() override;
|
|
|
|
|
virtual FReply DroppedOnPin(FVector2D ScreenPosition, FVector2D GraphPosition) override;
|
|
|
|
|
virtual FReply DroppedOnPanel(const TSharedRef< SWidget >& Panel, FVector2D ScreenPosition, FVector2D GraphPosition, UEdGraph& Graph) override;
|
|
|
|
|
virtual void OnDragBegin(const TSharedRef<class SGraphPin>& InPin) override;
|
|
|
|
|
virtual void OnDragged(const class FDragDropEvent& DragDropEvent) override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End of FGraphEditorDragDropAction interface
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Function to check validity of graph pins in the StartPins list. This check helps to prevent processing graph pins which are outdated.
|
|
|
|
|
*/
|
2014-05-15 17:34:14 -04:00
|
|
|
virtual void ValidateGraphPinList(TArray<UEdGraphPin*>& OutValidPins);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
typedef FGraphEditorDragDropAction Super;
|
|
|
|
|
|
2014-06-18 15:58:03 -04:00
|
|
|
// Constructor: Make sure to call Construct() after factorying one of these
|
2014-05-15 17:34:14 -04:00
|
|
|
FDragConnection(const TSharedRef<SGraphPanel>& InGraphPanel, const TArray< TSharedRef<SGraphPin> >& InStartingPins, bool bInShiftOperation);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
TSharedPtr<SGraphPanel> GraphPanel;
|
|
|
|
|
TArray< TSharedRef<SGraphPin> > StartingPins;
|
2014-05-15 17:34:14 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Offset information for the decorator widget */
|
2014-05-15 17:34:14 -04:00
|
|
|
FVector2D DecoratorAdjust;
|
|
|
|
|
|
|
|
|
|
/** Was shift pressed when the drag started? */
|
|
|
|
|
bool bShiftOperation;
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|