Files
UnrealEngineUWP/Engine/Source/Editor/GraphEditor/Private/DragConnection.h
Michael Noland 6046bb9cc9 Blueprints: Add reroute nodes to help organize wires
- Clean up FDragConnection construction and add a factory function in SGraphPin to extend it for some pins
- Clean up arguments to FOnGetContextMenuFor in SGraphPanel
- Various modifications to SGraphPin to permit implementation of wire knots/reroute nodes
#codereview nick.whiting

[CL 2074801 by Michael Noland in Main branch]
2014-05-15 17:34:14 -04:00

44 lines
1.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
class FDragConnection : public FGraphEditorDragDropAction
{
public:
DRAG_DROP_OPERATOR_TYPE(FDragConnection, FGraphEditorDragDropAction)
static TSharedRef<FDragConnection> New(const TSharedRef<SGraphPanel>& InGraphPanel, const TArray< TSharedRef<SGraphPin> >& InStartingPins, bool bInShiftOperation);
// FDragDropOperation interface
virtual void OnDrop( bool bDropWasHandled, const FPointerEvent& MouseEvent ) OVERRIDE;
// End of FDragDropOperation interface
// FGraphEditorDragDropAction interface
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;
// 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.
*/
virtual void ValidateGraphPinList(TArray<UEdGraphPin*>& OutValidPins);
protected:
typedef FGraphEditorDragDropAction Super;
FDragConnection(const TSharedRef<SGraphPanel>& InGraphPanel, const TArray< TSharedRef<SGraphPin> >& InStartingPins, bool bInShiftOperation);
protected:
TSharedPtr<SGraphPanel> GraphPanel;
TArray< TSharedRef<SGraphPin> > StartingPins;
/** Offset information for the decorator widget */
FVector2D DecoratorAdjust;
/** Was shift pressed when the drag started? */
bool bShiftOperation;
};