5#include "UObject/ObjectMacros.h"
13#include "DialogueGraphNode.generated.h"
16class DialogueGraphNode_Edge;
18class UGraphNodeContextMenuContext;
72 void PostLoad() override;
79 void PostEditImport() override;
86 void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
92 void PostEditChangeChainProperty(struct FPropertyChangedChainEvent& PropertyChangedEvent) override;
103 bool Modify(
bool bAlwaysMarkDirty = true) override;
110 FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
113 FText GetTooltipText() const override;
114 FString GetDocumentationExcerptName() const override;
117 bool CanDuplicateNode()
const override {
return !IsRootNode(); }
120 bool CanUserDeleteNode()
const override {
return !IsRootNode(); }
123 void PrepareForCopying()
override;
131 void NodeConnectionListChanged()
override
133 CheckDialogueNodeSyncWithGraphNode(
true);
134 ApplyCompilerWarnings();
138 void PinConnectionListChanged(UEdGraphPin* Pin)
override;
141#if ENGINE_MINOR_VERSION >= 24
142 void GetNodeContextMenuActions(UToolMenu* Menu, UGraphNodeContextMenuContext* Context)
const override;
144 void GetContextMenuActions(
const FGraphNodeContextMenuBuilder& Context)
const override;
152 void AutowireNewNode(UEdGraphPin* FromPin)
override;
157 bool CanHaveInputConnections()
const override {
return NodeIndex != INDEX_NONE && !IsRootNode(); }
160 bool CanHaveOutputConnections()
const override {
return !IsEndNode(); }
163 bool HasOutputConnectionToNode(
const UEdGraphNode* TargetNode)
const override;
166 FLinearColor GetNodeBackgroundColor()
const override;
169 void PostCopyNode()
override;
172 void CheckAll()
const override
176 check(IsDialogueNodeSet());
177 CheckDialogueNodeIndexMatchesNode();
178 CheckDialogueNodeSyncWithGraphNode(
true);
183 virtual bool IsRootNode()
const {
return false; }
190 bool IsEndNode()
const {
return DialogueNode->IsA<
UDlgNode_End>(); }
193 bool IsSpeechNode()
const {
return DialogueNode->IsA<
UDlgNode_Speech>(); }
196 bool IsVirtualParentNode()
const
210 bool IsSelectorFirstNode()
const
221 bool IsSelectorRandomNode()
const
235 bool HasEnterConditions()
const
241 bool HasEnterEvents()
const
243 return DialogueNode ? DialogueNode->HasAnyEnterEvents() :
false;
247 bool HasVoicePropertiesSet()
const;
250 bool HasGenericDataSet()
const;
253 int32 GetNodeDepth()
const {
return NodeDepth; }
256 void SetNodeDepth(int32 NewNodeDepth) { NodeDepth = NewNodeDepth; }
259 virtual void SetDialogueNode(
UDlgNode* InNode)
261 DialogueNode = InNode;
262 DialogueNode->SetFlags(RF_Transactional);
263 DialogueNode->SetGraphNode(
this);
268 virtual void SetDialogueNodeIndex(int32 InIndex)
270 check(InIndex > INDEX_NONE);
276 FIntPoint GetDefaultEdgePosition()
const {
return GetPosition() + FIntPoint(5, 5); }
283 void SetDialogueNodeDataChecked(int32 InIndex,
UDlgNode* InNode);
286 template <
typename DlgNodeType>
287 const DlgNodeType& GetDialogueNode()
const {
return *CastChecked<DlgNodeType>(DialogueNode); }
290 template <
typename DlgNodeType>
291 DlgNodeType* GetMutableDialogueNode() {
return CastChecked<DlgNodeType>(DialogueNode); }
294 const UDlgNode& GetDialogueNode()
const {
return *DialogueNode; }
295 UDlgNode* GetMutableDialogueNode()
const {
return DialogueNode; }
298 bool IsDialogueNodeSet()
const {
return DialogueNode !=
nullptr; }
301 virtual int32 GetDialogueNodeIndex()
const {
return NodeIndex; }
304 int32 GetChildEdgeIndexForChildNodeIndex(int32 ChildNodeIndex)
const;
307 void SetEdgeTargetIndexAt(int32 EdgeIndex, int32 NewTargetIndex);
310 void SetEdgeTextAt(int32 EdgeIndex,
const FText& NewText);
314 void SetEdges(
const TArray<FDlgEdge>& InEdges);
318 void UpdateEdgesFromDialogueNode();
321 void ApplyCompilerWarnings();
324 int32 EstimateNodeWidth()
const;
327 void CheckDialogueNodeIndexMatchesNode()
const;
330 void CheckDialogueNodeSyncWithGraphNode(
bool bStrictCheck =
false)
const;
333 TArray<UDialogueGraphNode*> GetParentNodes()
const;
336 TArray<UDialogueGraphNode*> GetChildNodes()
const;
339 TArray<UDialogueGraphNode_Edge*> GetParentEdgeNodes(
bool bCheckChild =
true)
const;
342 TArray<UDialogueGraphNode_Edge*> GetChildEdgeNodes(
bool bCheckParent =
true)
const;
351 void SortChildrenBasedOnXLocation();
354 bool GetForceHideNode()
const {
return bForceHideNode; }
357 void SetForceHideNode(
bool bHide) { bForceHideNode = bHide; }
360 bool ShouldDrawNode()
const {
return !bForceHideNode; }
363 static FName GetMemberNameDialogueNode() {
return GET_MEMBER_NAME_CHECKED(
UDialogueGraphNode, DialogueNode); }
364 static FName GetMemberNameNodeIndex() {
return GET_MEMBER_NAME_CHECKED(
UDialogueGraphNode, NodeIndex); }
369 virtual void CreateInputPin()
371 static const FName PinName(TEXT(
"Input Pin"));
372 FCreatePinParams PinParams;
373 PinParams.Index = INDEX_PIN_Input;
378 virtual void CreateOutputPin()
380 static const FName PinName(TEXT(
"Output Pin"));
381 FCreatePinParams PinParams;
382 PinParams.Index = INDEX_PIN_Output;
386 GetOutputPin()->bNotConnectable = IsEndNode();
390 void RegisterListeners()
override;
397 void OnDialogueNodePropertyChanged(
const FPropertyChangedEvent& PropertyChangedEvent, int32 EdgeIndexChanged);
400 void ResetDialogueNodeOwner();
407 bool DoesEdgeMatchEdgeIndex(
const FDlgEdge& Edge, int32 EdgeIndex, FString& OutMessage)
const;
411 UPROPERTY(EditAnywhere, Instanced, Category = DialogueGraphNode, Meta = (ShowOnlyInnerProperties))
415 UPROPERTY(VisibleAnywhere, Category = DialogueGraphNode)
416 int32 NodeIndex = INDEX_NONE;
420 int32 NodeDepth = INDEX_NONE;
425 bool bForceHideNode = false;
static constexpr int32 INDEX_PIN_Output
virtual FIntPoint GetPosition() const
UEdGraphPin * GetOutputPin() const
static constexpr int32 INDEX_PIN_Input
void CheckDialogueNodeIndexMatchesNode() const
virtual void CreateInputPin()
int32 EstimateNodeWidth() const
bool HasParentEdgeNode(const UDialogueGraphNode_Edge *ParentEdgeToFind) const
void UpdateEdgesFromDialogueNode()
bool DoesEdgeMatchEdgeIndex(const FDlgEdge &Edge, int32 EdgeIndex, FString &OutMessage) const
void SortChildrenBasedOnXLocation()
void PinConnectionListChanged(UEdGraphPin *Pin) override
bool CanUserDeleteNode() const override
UDlgNode * GetMutableDialogueNode() const
void SetDialogueNodeDataChecked(int32 InIndex, UDlgNode *InNode)
bool HasEnterEvents() const
virtual int32 GetDialogueNodeIndex() const
void SetNodeDepth(int32 NewNodeDepth)
bool CanHaveOutputConnections() const override
bool IsSelectorNode() const
void CheckDialogueNodeSyncWithGraphNode(bool bStrictCheck=false) const
void AutowireNewNode(UEdGraphPin *FromPin) override
virtual void SetDialogueNode(UDlgNode *InNode)
void SetForceHideNode(bool bHide)
int32 GetChildEdgeIndexForChildNodeIndex(int32 ChildNodeIndex) const
int32 GetNodeDepth() const
virtual void CreateOutputPin()
void NodeConnectionListChanged() override
static FName GetMemberNameDialogueNode()
void SetEdgeTextAt(int32 EdgeIndex, const FText &NewText)
TArray< UDialogueGraphNode * > GetChildNodes() const
bool CanDuplicateNode() const override
bool HasVoicePropertiesSet() const
bool ShouldDrawNode() const
bool IsSelectorFirstNode() const
void OnDialogueNodePropertyChanged(const FPropertyChangedEvent &PropertyChangedEvent, int32 EdgeIndexChanged)
int32 NodeDepth
UPROPERTY()
bool HasChildEdgeNode(const UDialogueGraphNode_Edge *ChildEdgeToFind) const
DlgNodeType * GetMutableDialogueNode()
TArray< UDialogueGraphNode * > GetParentNodes() const
bool CanHaveInputConnections() const override
FIntPoint GetDefaultEdgePosition() const
static FName GetMemberNameNodeIndex()
virtual void SetDialogueNodeIndex(int32 InIndex)
FLinearColor GetNodeBackgroundColor() const override
int32 NodeIndex
UPROPERTY(VisibleAnywhere, Category = DialogueGraphNode)
bool HasOutputConnectionToNode(const UEdGraphNode *TargetNode) const override
bool IsVirtualParentNode() const
bool HasGenericDataSet() const
bool IsDialogueNodeSet() const
const DlgNodeType & GetDialogueNode() const
void CheckAll() const override
void PostEditChangeProperty(FPropertyChangedEvent &PropertyChangedEvent) override
void RegisterListeners() override
void PostCopyNode() override
virtual bool IsRootNode() const
TArray< UDialogueGraphNode_Edge * > GetChildEdgeNodes(bool bCheckParent=true) const
void PostEditImport() override
void ResetDialogueNodeOwner()
bool IsSelectorRandomNode() const
TArray< UDialogueGraphNode_Edge * > GetParentEdgeNodes(bool bCheckChild=true) const
FText GetNodeTitle(ENodeTitleType::Type TitleType) const override
void GetContextMenuActions(const FGraphNodeContextMenuBuilder &Context) const override
void PostEditChangeChainProperty(struct FPropertyChangedChainEvent &PropertyChangedEvent) override
const FDiffNodeEdgeLinkedToPinResult FindDifferenceBetweenNodeEdgesAndLinkedToPins() const
bool GetForceHideNode() const
bool IsSpeechNode() const
UDlgNode * DialogueNode
UPROPERTY(EditAnywhere, Instanced, Category = DialogueGraphNode, Meta = (ShowOnlyInnerProperties))
bool IsSpeechSequenceNode() const
bool Modify(bool bAlwaysMarkDirty=true) override
FString GetDocumentationExcerptName() const override
const UDlgNode & GetDialogueNode() const
void PrepareForCopying() override
void ApplyCompilerWarnings()
FText GetTooltipText() const override
bool HasEnterConditions() const
void SetEdgeTargetIndexAt(int32 EdgeIndex, int32 NewTargetIndex)
void SetEdges(const TArray< FDlgEdge > &InEdges)
static const FName PIN_CATEGORY_Output
static const FName PIN_CATEGORY_Input
UCLASS(BlueprintType, ClassGroup = "Dialogue")
UCLASS(BlueprintType, ClassGroup = "Dialogue")
EDlgNodeSelectorType GetSelectorType() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UCLASS(BlueprintType, ClassGroup = "Dialogue")
virtual bool IsVirtualParent() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
UCLASS(BlueprintType, ClassGroup = "Dialogue")
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
virtual bool HasAnyEnterEvents() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
virtual bool HasAnyEnterConditions() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Node")
@ EDGE_NOT_MATCHING_INDEX
@ LENGTH_MISMATCH_ONE_MORE_EDGE
@ LENGTH_MISMATCH_ONE_MORE_PIN_CONNECTION