| 787 | } |
| 788 | |
| 789 | void SFindInFlow::AppendPropertyValues(const void* Container, const UStruct* Struct, const UObject* ParentObject, TMap<EFlowSearchFlags, TSet<FString>>& SearchFlagToStringMap, int32 Depth) const |
| 790 | { |
| 791 | int32 MaxDepth = 1; |
| 792 | if (const UFlowGraphEditorSettings* Settings = GetDefault<UFlowGraphEditorSettings>()) |
| 793 | { |
| 794 | MaxDepth = Settings->DefaultMaxSearchDepth; |
| 795 | } |
| 796 | |
| 797 | if (!Container || !Struct || !ParentObject || Depth >= MaxDepth) |
| 798 | { |
| 799 | return; |
| 800 | } |
| 801 | |
| 802 | for (TFieldIterator<FProperty> It(Struct, EFieldIteratorFlags::IncludeSuper); It; ++It) |
| 803 | { |
| 804 | FProperty* Prop = *It; |
| 805 | if (!Prop->HasAnyPropertyFlags(CPF_Edit | CPF_SimpleDisplay | CPF_AdvancedDisplay | CPF_BlueprintVisible | CPF_Config)) |
| 806 | { |
| 807 | continue; |
| 808 | } |
| 809 | |
| 810 | const void* ValuePtr = Prop->ContainerPtrToValuePtr<void>(Container); |
| 811 | |
| 812 | if (EnumHasAnyFlags(SearchFlags, EFlowSearchFlags::PropertyNames)) |
| 813 | { |
| 814 | TSet<FString>& PropertyNamesSet = SearchFlagToStringMap.FindOrAdd(EFlowSearchFlags::PropertyNames); |
| 815 | |
| 816 | const FString DisplayName = Prop->GetMetaData(TEXT("DisplayName")); |
| 817 | |
| 818 | if (!DisplayName.IsEmpty()) |
| 819 | { |
| 820 | PropertyNamesSet.Add(DisplayName); |
| 821 | } |
| 822 | |
| 823 | PropertyNamesSet.Add(Prop->GetName()); |
| 824 | } |
| 825 | |
| 826 | if (EnumHasAnyFlags(SearchFlags, EFlowSearchFlags::PropertyValues)) |
| 827 | { |
| 828 | TSet<FString>& PropertyValuesSet = SearchFlagToStringMap.FindOrAdd(EFlowSearchFlags::PropertyValues); |
| 829 | |
| 830 | FString ValueStr; |
| 831 | UObject* MutableParentObject = const_cast<UObject*>(ParentObject); |
| 832 | Prop->ExportText_InContainer(0, ValueStr, Container, nullptr, MutableParentObject, PPF_None); |
| 833 | ValueStr = ValueStr.Replace(TEXT("\""), TEXT("")).TrimStartAndEnd(); |
| 834 | |
| 835 | PropertyValuesSet.Add(ValueStr); |
| 836 | } |
| 837 | |
| 838 | if (EnumHasAnyFlags(SearchFlags, EFlowSearchFlags::Tooltips)) |
| 839 | { |
| 840 | TSet<FString>& TooltipsSet = SearchFlagToStringMap.FindOrAdd(EFlowSearchFlags::Tooltips); |
| 841 | TooltipsSet.Add(Prop->GetMetaData(TEXT("ToolTip"))); |
| 842 | } |
| 843 | |
| 844 | if (FStructProperty* StructProp = CastField<FStructProperty>(Prop)) |
| 845 | { |
| 846 | // Recurse into structs (no depth penalty) |