4#include "CoreMinimal.h"
5#include "Widgets/Docking/SDockTab.h"
13class FAssetRegistryModule;
18class UEdGraphNode_Comment;
51 const TSharedPtr<FDialogueSearchResult>& OutParentNode,
52 int32 ArgumentIndex = INDEX_NONE
62 const TSharedPtr<FDialogueSearchResult>& OutParentNode,
63 int32 ConditionIndex = INDEX_NONE,
64 FName ConditionMemberName = TEXT(
"Condition")
74 const TSharedPtr<FDialogueSearchResult>& OutParentNode,
75 int32 EventIndex = INDEX_NONE,
76 FName EventMemberName = TEXT(
"Event")
86 const TSharedPtr<FDialogueSearchResult>& OutParentNode
96 const TSharedPtr<FDialogueSearchResult>& OutParentNode
106 const TSharedPtr<FDialogueSearchResult>& OutParentNode
115 const UEdGraphNode_Comment* InCommentNode,
116 const TSharedPtr<FDialogueSearchResult>& OutParentNode
126 TSharedPtr<FDialogueSearchResult>& OutParentNode
148 void Initialize(TSharedPtr<FWorkspaceItem> ParentTabCategory =
nullptr);
156 const TSharedPtr<FDialogueSearchResult>& ParentNode,
158 const FString& CommentString
161 TSharedPtr<FDialogueSearchResult> TextNode = MakeShared<FDialogueSearchResult>(
DisplayName, ParentNode);
162 TextNode->SetCategory(Category);
163 if (!CommentString.IsEmpty())
165 TextNode->SetCommentString(CommentString);
167 ParentNode->AddChild(TextNode);
172 const TSharedPtr<FDialogueSearchResult>& ParentNode,
173 const FString& SearchString,
175 const FText& NamespaceCategory,
176 const FString& NamespaceCommentString,
177 const FText& KeyCategory,
178 const FString& KeyCommentString
181 static const FString DefaultValue = TEXT(
"");
182 bool bContainsSearchString =
false;
184 const FString CurrentFullNamespace = FTextInspector::GetNamespace(Text).Get(DefaultValue);
185 const FString CurrentKey = FTextInspector::GetKey(Text).Get(DefaultValue);
186 if (CurrentFullNamespace.Contains(SearchString))
188 bContainsSearchString =
true;
191 FText::AsCultureInvariant(CurrentFullNamespace),
193 NamespaceCommentString
196 if (CurrentKey.Contains(SearchString))
198 bContainsSearchString =
true;
201 FText::AsCultureInvariant(CurrentKey),
207 return bContainsSearchString;
static constexpr int32 MAX_GLOBAL_DIALOGUE_SEARCH_RESULTS
bool QueryEdgeNode(const FDialogueSearchFilter &SearchFilter, const UDialogueGraphNode_Edge *InEdgeNode, const TSharedPtr< FDialogueSearchResult > &OutParentNode)
FDelegateHandle OnAssetAddedHandle
void HandleOnAssetAdded(const FAssetData &InAssetData)
bool SearchForTextLocalizationData(const TSharedPtr< FDialogueSearchResult > &ParentNode, const FString &SearchString, const FText &Text, const FText &NamespaceCategory, const FString &NamespaceCommentString, const FText &KeyCategory, const FString &KeyCommentString)
TMap< FName, FDialogueSearchData > SearchMap
~FDialogueSearchManager()
TSharedPtr< FWorkspaceItem > GlobalFindResultsMenuItem
TSharedRef< SDockTab > SpawnGlobalFindResultsTab(const FSpawnTabArgs &SpawnTabArgs, int32 TabIdx)
TArray< TWeakPtr< SFindInDialogues > > GlobalFindResultsWidgets
TSharedPtr< SFindInDialogues > OpenGlobalFindResultsTab()
bool QueryDlgCondition(const FDialogueSearchFilter &SearchFilter, const FDlgCondition &InDlgCondition, const TSharedPtr< FDialogueSearchResult > &OutParentNode, int32 ConditionIndex=INDEX_NONE, FName ConditionMemberName=TEXT("Condition"))
bool QueryCommentNode(const FDialogueSearchFilter &SearchFilter, const UEdGraphNode_Comment *InCommentNode, const TSharedPtr< FDialogueSearchResult > &OutParentNode)
FText GetGlobalFindResultsTabLabel(int32 TabIdx)
FDelegateHandle OnAssetRenamedHandle
void HandleOnAssetRemoved(const FAssetData &InAssetData)
IAssetRegistry * AssetRegistry
bool QuerySingleDialogue(const FDialogueSearchFilter &SearchFilter, const UDlgDialogue *InDialogue, TSharedPtr< FDialogueSearchResult > &OutParentNode)
bool QueryGraphNode(const FDialogueSearchFilter &SearchFilter, const UDialogueGraphNode *InGraphNode, const TSharedPtr< FDialogueSearchResult > &OutParentNode)
FName GlobalFindResultsTabIDs[MAX_GLOBAL_DIALOGUE_SEARCH_RESULTS]
bool QueryDlgTextArgument(const FDialogueSearchFilter &SearchFilter, const FDlgTextArgument &InDlgTextArgument, const TSharedPtr< FDialogueSearchResult > &OutParentNode, int32 ArgumentIndex=INDEX_NONE)
FDelegateHandle OnAssetRemovedHandle
void HandleOnAssetRenamed(const FAssetData &InAssetData, const FString &InOldName)
void QueryAllDialogues(const FDialogueSearchFilter &SearchFilter, TSharedPtr< FDialogueSearchResult > &OutParentNode)
bool QueryDlgEdge(const FDialogueSearchFilter &SearchFilter, const FDlgEdge &InDlgEdge, const TSharedPtr< FDialogueSearchResult > &OutParentNode)
void Initialize(TSharedPtr< FWorkspaceItem > ParentTabCategory=nullptr)
void HandleOnAssetLoaded(UObject *InAsset)
void EnableGlobalFindResults(TSharedPtr< FWorkspaceItem > ParentTabCategory=nullptr)
FDelegateHandle OnAssetLoadedHandle
void HandleOnAssetRegistryFilesLoaded()
FDelegateHandle OnFilesLoadedHandle
TSharedPtr< FDialogueSearchResult > MakeChildTextNode(const TSharedPtr< FDialogueSearchResult > &ParentNode, const FText &DisplayName, const FText &Category, const FString &CommentString)
void DisableGlobalFindResults()
bool QueryDlgEvent(const FDialogueSearchFilter &SearchFilter, const FDlgEvent &InDlgEvent, const TSharedPtr< FDialogueSearchResult > &OutParentNode, int32 EventIndex=INDEX_NONE, FName EventMemberName=TEXT("Event"))
FDialogueSearchManager Self
TSharedPtr< SFindInDialogues > GetGlobalFindResults()
void CloseGlobalFindResults(const TSharedRef< SFindInDialogues > &FindResults)
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
TWeakObjectPtr< UDlgDialogue > Dialogue