16 const FVector2D Location,
20 const FScopedTransaction Transaction(LOCTEXT(
"DialogueditorNewDialgueNode",
"Dialogue Editor: New Dialogue Node"));
24 verify(ParentGraph->Modify());
27 verify(FromPin->Modify());
35 ParentGraph->NotifyGraphChanged();
49 static constexpr int32 NodeDistance = 60;
57 if (
UDialogueGraphNode* GraphNode = Cast<UDialogueGraphNode>(FromPin->GetOwningNode()))
59 if (GraphNode->IsRootNode())
70 DialogueNode->SetNodeParticipantName(GraphNode->GetDialogueNode().GetNodeParticipantName());
79 DialogueNode->SetNodeParticipantName(
Dialogue->GetNodes()[0]->GetNodeParticipantName());
84 FGraphNodeCreator<UDialogueGraphNode> NodeCreator(*ParentGraph);
88 DialogueNode->SetGraphNode(GraphNode);
89 const int32 DialogueNodeIndex =
Dialogue->AddNode(DialogueNode);
93 NodeCreator.Finalize();
99 int32 XLocation = Location.X;
100 if (FromPin && FromPin->Direction == EGPD_Input)
103 const float XDelta = FMath::Abs(PinNode->NodePosX - Location.X);
105 if (XDelta < NodeDistance)
109 XLocation = PinNode->NodePosX - NodeDistance;
116 return CastChecked<UEdGraphNode>(GraphNode);