| 587 | } |
| 588 | |
| 589 | bool SFindInFlow::ProcessAsset(UFlowAsset* Asset, FSearchResult ParentResult, const TArray<FString>& Tokens, int32 Depth) |
| 590 | { |
| 591 | if (!Asset || !Asset->GetGraph() || Depth >= MaxSearchDepth || SearchResults.VisitedAssets.Contains(Asset)) |
| 592 | { |
| 593 | return false; |
| 594 | } |
| 595 | |
| 596 | SearchResults.VisitedAssets.Add(Asset); |
| 597 | |
| 598 | bool bAnyMatches = false; |
| 599 | |
| 600 | for (UEdGraphNode* EdNode : Asset->GetGraph()->Nodes) |
| 601 | { |
| 602 | const TMap<EFlowSearchFlags, TSet<FString>>* CategoryStrings = BuildCategoryStrings(EdNode, Depth); |
| 603 | |
| 604 | if (!CategoryStrings) |
| 605 | { |
| 606 | continue; |
| 607 | } |
| 608 | |
| 609 | EFlowSearchFlags NodeMatchedFlags = EFlowSearchFlags::None; |
| 610 | |
| 611 | for (const TPair<EFlowSearchFlags, TSet<FString>>& Pair : *CategoryStrings) |
| 612 | { |
| 613 | const TSet<FString>& StringSet = Pair.Value; |
| 614 | if (EnumHasAnyFlags(SearchFlags, Pair.Key) && StringSetMatchesSearchTokens(Tokens, StringSet)) |
| 615 | { |
| 616 | EnumAddFlags(NodeMatchedFlags, Pair.Key); |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | if (NodeMatchedFlags != EFlowSearchFlags::None) |
| 621 | { |
| 622 | FString Title = EdNode->GetNodeTitle(ENodeTitleType::ListView).ToString(); |
| 623 | if (Title.IsEmpty()) |
| 624 | { |
| 625 | Title = EdNode->GetClass()->GetName(); |
| 626 | } |
| 627 | |
| 628 | FSearchResult Result = MakeShareable(new FFindInFlowResult(Title, ParentResult, EdNode, Depth > 0, Asset)); |
| 629 | Result->MatchedFlags = NodeMatchedFlags; |
| 630 | ParentResult->Children.Add(Result); |
| 631 | |
| 632 | bAnyMatches = true; |
| 633 | } |
| 634 | |
| 635 | bAnyMatches |= RecurseIntoSubgraphsIfEnabled(EdNode, ParentResult, Tokens, Depth); |
| 636 | } |
| 637 | |
| 638 | return bAnyMatches; |
| 639 | } |
| 640 | |
| 641 | bool SFindInFlow::RecurseIntoSubgraphsIfEnabled(UEdGraphNode* EdNode, FSearchResult ParentResult, const TArray<FString>& Tokens, int32 Depth) |
| 642 | { |
nothing calls this directly
no test coverage detected