A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DialogueGraph.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
5#include "EdGraph/EdGraph.h"
6
7#include "DlgDialogue.h"
8
9#include "DialogueGraph.generated.h"
10
11class UDlgNode;
17
18UCLASS()
19class UDialogueGraph : public UEdGraph
20{
22
23public:
24 // Begin UObject Interface.
34 bool Modify(bool bAlwaysMarkDirty = true) override;
35
36 // Begin UEdGraph
38 bool RemoveGraphNode(UEdGraphNode* NodeToRemove);
39
40 // Begin Own methods
42 UDlgDialogue* GetDialogue() const
43 {
44 // Unreal engine magic, get the object that owns this graph, that is our Dialogue.
45 return CastChecked<UDlgDialogue>(GetOuter());
46 }
47
49 UDialogueGraphNode_Root* GetRootGraphNode() const;
50
52 const TArray<UEdGraphNode*>& GetAllGraphNodes() const { return Nodes; }
53
55 TArray<UDialogueGraphNode_Base*> GetAllBaseDialogueGraphNodes() const;
56
58 TArray<UDialogueGraphNode*> GetAllDialogueGraphNodes() const;
59
61 TArray<UDialogueGraphNode_Edge*> GetAllEdgeDialogueGraphNodes() const;
62
64 void CreateGraphNodesFromDialogue();
65
67 void LinkGraphNodesFromDialogue() const;
68
70 void AutoPositionGraphNodes() const;
71
73 void RemoveAllNodes();
74
76 const UDialogueGraphSchema* GetDialogueGraphSchema() const;
77
78private:
79 UDialogueGraph(const FObjectInitializer& ObjectInitializer);
80
81 // Link the specified node to all it's children
82 void LinkGraphNodeToChildren(
83 const TArray<UDlgNode*>& NodesDialogue,
84 const UDlgNode& NodeDialogue,
85 UDialogueGraphNode* NodeGraph
86 ) const;
87};
bool RemoveGraphNode(UEdGraphNode *NodeToRemove)
const TArray< UEdGraphNode * > & GetAllGraphNodes() const
UDialogueGraph(const FObjectInitializer &ObjectInitializer)
UDlgDialogue * GetDialogue() const
void LinkGraphNodesFromDialogue() const
UDialogueGraphNode_Root * GetRootGraphNode() const
void LinkGraphNodeToChildren(const TArray< UDlgNode * > &NodesDialogue, const UDlgNode &NodeDialogue, UDialogueGraphNode *NodeGraph) const
bool Modify(bool bAlwaysMarkDirty=true) override
const UDialogueGraphSchema * GetDialogueGraphSchema() const
TArray< UDialogueGraphNode_Edge * > GetAllEdgeDialogueGraphNodes() const
void AutoPositionGraphNodes() const
TArray< UDialogueGraphNode_Base * > GetAllBaseDialogueGraphNodes() const
TArray< UDialogueGraphNode * > GetAllDialogueGraphNodes() const
void CreateGraphNodesFromDialogue()
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
Definition DlgDialogue.h:85
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
Definition DlgNode.h:40