4#include "ScopedTransaction.h"
13#define LOCTEXT_NAMESPACE "ConvertSpeechNodesToSpeechSequence_DialogueGraphSchemaAction"
18 const FVector2D Location,
bool bSelectNewNode)
22 const FScopedTransaction Transaction(LOCTEXT(
"DialogueditorConvertSpeechNodesToSpeechSequence",
"Convert Speech Nodes to a Sequence Node"));
29 UDialogueGraphNode* GraphNode_SpeechSequence = FNewNode_DialogueGraphSchemaAction::SpawnGraphNodeWithDialogueNodeFromTemplate<UDialogueGraphNode>(
30 ParentGraph, UDlgNode_SpeechSequence::StaticClass(), Location, bSelectNewNode);
49 const TArray<FDlgEdge>& Children = DialogueNode_Speech.
GetNodeChildren();
51 if (Children.Num() > 0)
53 SequenceEntry.EdgeText = Children[0].GetUnformattedText();
56 SpeechSequence->Add(SequenceEntry);
80 Condition.CustomCondition = DuplicateObject(
Condition.CustomCondition, DialogueNode_SpeechSequence);
90 if (
Event.CustomEvent)
92 Event.CustomEvent = DuplicateObject(
Event.CustomEvent, DialogueNode_SpeechSequence);
104 GraphNode_SpeechSequence->
CheckAll();
107 ParentNode->CheckAll();
111 ChildNode->CheckAll();
115 Dialogue->CompileDialogueNodesFromGraphNodes();
118 ParentGraph->NotifyGraphChanged();
120 return GraphNode_SpeechSequence;
123#undef LOCTEXT_NAMESPACE
static void CopyNodeChildren(const UDialogueGraphNode *FromNode, UDialogueGraphNode *ToNode)
static void ReplaceParentConnectionsToNode(const UDialogueGraphNode *OldNode, const UDialogueGraphNode *NewNode)
static bool RemoveNode(UEdGraphNode *NodeToRemove)
static UDlgDialogue * GetDialogueForGraph(const UEdGraph *Graph)
bool HasEnterEvents() const
TArray< UDialogueGraphNode * > GetChildNodes() const
DlgNodeType * GetMutableDialogueNode()
TArray< UDialogueGraphNode * > GetParentNodes() const
const DlgNodeType & GetDialogueNode() const
void CheckAll() const override
bool HasEnterConditions() const
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
UCLASS(BlueprintType, ClassGroup = "Dialogue")
FName SpeakerState
UPROPERTY(EditAnywhere, Category = "Dialogue|Node")
const FText & GetNodeText() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UDlgNodeData * NodeData
UPROPERTY(EditAnywhere, Instanced, Category = "Dialogue|Node")
FName GetSpeakerState() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
FText Text
UPROPERTY(EditAnywhere, Category = "Dialogue|Node", Meta = (MultiLine = true))
UObject * GetNodeGenericData() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UDialogueWave * GetNodeVoiceDialogueWave() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
USoundBase * GetNodeVoiceSoundBase() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UDialogueWave * VoiceDialogueWave
UPROPERTY(EditAnywhere, Category = "Dialogue|Node", Meta = (DlgSaveOnlyReference))
UObject * GenericData
UPROPERTY(EditAnywhere, Category = "Dialogue|Node", Meta = (DlgSaveOnlyReference))
UDlgNodeData * GetNodeData() const override
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
USoundBase * VoiceSoundWave
UPROPERTY(EditAnywhere, Category = "Dialogue|Node", Meta = (DlgSaveOnlyReference))
UCLASS(BlueprintType, ClassGroup = "Dialogue")
TArray< FDlgSpeechSequenceEntry > * GetMutableNodeSpeechSequence()
void AutoGenerateInnerEdges()
virtual const TArray< FDlgEdge > & GetNodeChildren() const
Gets this nodes children (edges) as a const/mutable array.
virtual FName GetNodeParticipantName() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
virtual const TArray< FDlgEvent > & GetNodeEnterEvents() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
virtual void SetNodeEnterConditions(const TArray< FDlgCondition > &InEnterConditions)
virtual void SetNodeEnterEvents(const TArray< FDlgEvent > &InEnterEvents)
virtual const TArray< FDlgCondition > & GetNodeEnterConditions() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
TArray< UDialogueGraphNode * > SelectedGraphNodes
UEdGraphNode * PerformAction(UEdGraph *ParentGraph, UEdGraphPin *FromPin, const FVector2D Location, bool bSelectNewNode=true) override