A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DialogueGraphFactories.cpp
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
3
4#include "K2Node.h"
5
17
18TSharedPtr<class SGraphNode> FDialogueGraphNodeFactory::CreateNode(class UEdGraphNode* InNode) const
19{
20 // Dialogue Editor Nodes
21 if (UDialogueGraphNode_Base* DialogueNode_Base = Cast<UDialogueGraphNode_Base>(InNode))
22 {
23 // Nodes
24 if (UDialogueGraphNode* DialogueNode = Cast<UDialogueGraphNode>(DialogueNode_Base))
25 {
26 if (UDialogueGraphNode_Root* DialogueStartNode = Cast<UDialogueGraphNode_Root>(DialogueNode))
27 {
28 return SNew(SDialogueGraphNode_Root, DialogueStartNode);
29 }
30
31 return SNew(SDialogueGraphNode, DialogueNode);
32 }
33
34 // Edge
35 if (UDialogueGraphNode_Edge* DialogueEdge = Cast<UDialogueGraphNode_Edge>(DialogueNode_Base))
36 {
37 return SNew(SDialogueGraphNode_Edge, DialogueEdge);
38 }
39 }
40
41 // Blueprint Editor Nodes
42 if (UK2Node* BlueprintNode_Base = Cast<UK2Node>(InNode))
43 {
44 if (UDialogueK2Node_Select* BlueprintDialogueSelectNode = Cast<UDialogueK2Node_Select>(BlueprintNode_Base))
45 {
46 return SNew(SGraphNode_DialogueK2Select, BlueprintDialogueSelectNode);
47 }
48
49 if (UDialogueK2Node_SwitchDialogueCallback* BlueprintDialogueSwitchNode = Cast<UDialogueK2Node_SwitchDialogueCallback>(BlueprintNode_Base))
50 {
51 return SNew(SGraphNode_DialogueK2Switch, BlueprintDialogueSwitchNode);
52 }
53 }
54
55 return nullptr;
56}
57
58TSharedPtr<class SGraphPin> FDialogueGraphPinFactory::CreatePin(class UEdGraphPin* Pin) const
59{
60 if (Pin->GetSchema()->IsA<UDialogueGraphSchema>())
61 {
62 return SNew(SDialogueGraphPin, Pin);
63 }
64
65 return nullptr;
66}
UCLASS(MinimalAPI, Meta=(Keywords = "Ternary If"))
TSharedPtr< class SGraphNode > CreateNode(class UEdGraphNode *InNode) const override
TSharedPtr< class SGraphPin > CreatePin(class UEdGraphPin *Pin) const override