A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
DialogueSearchResult.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 "Input/Reply.h"
6
7#include "DlgDialogue.h"
9
13class UEdGraphNode_Comment;
14
15// Filter used when searching for Dialogue Data
17{
18public:
19 bool IsEmptyFilter() const
20 {
21 return SearchString.IsEmpty()
22 && bIncludeIndices == false
23 && bIncludeDialogueGUID == false
24 && bIncludeNodeGUID == false
25 && bIncludeComments == true
26 && bIncludeNumericalTypes == false
27 && bIncludeCustomObjectNames == false;
28 }
29
30public:
31 // Search term that the search items must match
32 FString SearchString;
33
34 // Include node/edge indices in search results?
35 bool bIncludeIndices = false;
36
37 // Include the Dialogue GUID in search results
39
40 // Include the Node GUID in search results
41 bool bIncludeNodeGUID = false;
42
43 // Include node comments in search results?
44 bool bIncludeComments = true;
45
46 // Include numerical data in search results like (int32, floats)?
48
49 // Include the Text localization data in search results (namespace, key)
51
52 // Include the Custom Text Argument/Condition/Event/Node Data object names
54};
55
56// Base class that matched the search results. When used by itself it is a simple text node.
57class FDialogueSearchResult : public FDlgTreeViewNode<FDialogueSearchResult>
58{
61
62public:
63 FDialogueSearchResult(const FText& InDisplayText, const TSharedPtr<Self>& InParent);
64
65 // Create an icon to represent the result
66 virtual TSharedRef<SWidget> CreateIcon() const;
67
68 // Gets the Dialogue housing all these search results. Aka the Dialogue this search result belongs to.
69 virtual TWeakObjectPtr<const UDlgDialogue> GetParentDialogue() const;
70
71 // Category:
72 FText GetCategory() const { return Category; }
73 void SetCategory(const FText& InCategory) { Category = InCategory; }
74
75 // CommentString
76 FString GetCommentString() const { return CommentString; }
77 void SetCommentString(const FString& InCommentString) { CommentString = InCommentString; }
78
79protected:
80 // The category of this node.
82
83 // Display text for comment information
85};
86
87
88// Root Node, should not be displayed.
95
96
97// Tree Node search results that represents the Dialogue.
99{
101public:
102 FDialogueSearchResult_DialogueNode(const FText& InDisplayText, const TSharedPtr<FDialogueSearchResult>& InParent);
103
104 FReply OnClick() override;
105 TWeakObjectPtr<const UDlgDialogue> GetParentDialogue() const override;
106 TSharedRef<SWidget> CreateIcon() const override;
107
108 // Dialogue:
109 void SetDialogue(TWeakObjectPtr<const UDlgDialogue> InDialogue) { Dialogue = InDialogue; }
110
111protected:
112 // The Dialogue this represents.
113 TWeakObjectPtr<const UDlgDialogue> Dialogue;
114};
115
116
117// Tree Node result that represents the GraphNode
119{
121public:
122 FDialogueSearchResult_GraphNode(const FText& InDisplayText, const TSharedPtr<FDialogueSearchResult>& InParent);
123
124 FReply OnClick() override;
125 TSharedRef<SWidget> CreateIcon() const override;
126
127 // GraphNode:
128 void SetGraphNode(TWeakObjectPtr<const UDialogueGraphNode> InGraphNode) { GraphNode = InGraphNode; }
129
130protected:
131 // The GraphNode this represents.
132 TWeakObjectPtr<const UDialogueGraphNode> GraphNode;
133};
134
135
136// Tree Node result that represents the EdgeNode
138{
140public:
141 FDialogueSearchResult_EdgeNode(const FText& InDisplayText, const TSharedPtr<FDialogueSearchResult>& InParent);
142
143 FReply OnClick() override;
144 TSharedRef<SWidget> CreateIcon() const override;
145
146 // EdgeNode:
147 void SetEdgeNode(TWeakObjectPtr<const UDialogueGraphNode_Edge> InEdgeNode) { EdgeNode = InEdgeNode; }
148
149protected:
150 // The EdgeNode this represents.
151 TWeakObjectPtr<const UDialogueGraphNode_Edge> EdgeNode;
152};
153
154// Tree Node result that represents the CommentNode
156{
158public:
159 FDialogueSearchResult_CommentNode(const FText& InDisplayText, const TSharedPtr<FDialogueSearchResult>& InParent);
160
161 FReply OnClick() override;
162 TSharedRef<SWidget> CreateIcon() const override;
163
164 // CommentNode:
165 void SetCommentNode(TWeakObjectPtr<const UEdGraphNode_Comment> InCommentNode) { CommentNode = InCommentNode; }
166
167protected:
168 // The EdgeNode this represents.
169 TWeakObjectPtr<const UEdGraphNode_Comment> CommentNode;
170};
void SetCommentNode(TWeakObjectPtr< const UEdGraphNode_Comment > InCommentNode)
FDialogueSearchResult_CommentNode(const FText &InDisplayText, const TSharedPtr< FDialogueSearchResult > &InParent)
TSharedRef< SWidget > CreateIcon() const override
TWeakObjectPtr< const UEdGraphNode_Comment > CommentNode
TSharedRef< SWidget > CreateIcon() const override
FDialogueSearchResult_DialogueNode(const FText &InDisplayText, const TSharedPtr< FDialogueSearchResult > &InParent)
void SetDialogue(TWeakObjectPtr< const UDlgDialogue > InDialogue)
TWeakObjectPtr< const UDlgDialogue > GetParentDialogue() const override
TWeakObjectPtr< const UDlgDialogue > Dialogue
void SetEdgeNode(TWeakObjectPtr< const UDialogueGraphNode_Edge > InEdgeNode)
TWeakObjectPtr< const UDialogueGraphNode_Edge > EdgeNode
TSharedRef< SWidget > CreateIcon() const override
FDialogueSearchResult_EdgeNode(const FText &InDisplayText, const TSharedPtr< FDialogueSearchResult > &InParent)
void SetGraphNode(TWeakObjectPtr< const UDialogueGraphNode > InGraphNode)
FDialogueSearchResult_GraphNode(const FText &InDisplayText, const TSharedPtr< FDialogueSearchResult > &InParent)
TWeakObjectPtr< const UDialogueGraphNode > GraphNode
TSharedRef< SWidget > CreateIcon() const override
void SetCategory(const FText &InCategory)
virtual TSharedRef< SWidget > CreateIcon() const
virtual TWeakObjectPtr< const UDlgDialogue > GetParentDialogue() const
FDialogueSearchResult(const FText &InDisplayText, const TSharedPtr< Self > &InParent)
FDialogueSearchResult Self
FString GetCommentString() const
void SetCommentString(const FString &InCommentString)