MCPcopy Create free account
hub / github.com/MothCocoon/FlowGraph / CreateFlowPinFromProperty

Method CreateFlowPinFromProperty

Source/Flow/Private/Types/FlowPinType.cpp:43–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42#if WITH_EDITOR
43FFlowPin FFlowPinType::CreateFlowPinFromProperty(const FProperty& Property, void const* InContainer) const
44{
45 FFlowPin NewFlowPin;
46
47 if (const FFlowDataPinValue* DataPinValue = FlowStructUtils::CastStructValue<FFlowDataPinValue>(&Property, InContainer))
48 {
49 // Create the pin from a FFlowDataPinValue property wrapper
50 NewFlowPin = CreateFlowPinFromValueWrapper(Property.GetFName(), *DataPinValue);
51 }
52 else
53 {
54 // Create the pin from a native property
55 NewFlowPin.PinName = Property.GetFName();
56 NewFlowPin.SetPinTypeName(GetPinTypeName());
57
58 FLOW_ASSERT_ENUM_MAX(EFlowDataMultiType, 2);
59 if (CastField<FArrayProperty>(&Property))
60 {
61 NewFlowPin.ContainerType = EPinContainerType::Array;
62 }
63
64 UObject* SubCategoryObject = GetPinSubCategoryObjectFromProperty(&Property, InContainer, DataPinValue);
65 NewFlowPin.SetPinSubCategoryObject(SubCategoryObject);
66 }
67
68 // Common property settings for both versions
69 NewFlowPin.PinFriendlyName = Property.GetDisplayNameText();
70 NewFlowPin.PinToolTip = Property.GetToolTipText().ToString();
71
72 return NewFlowPin;
73}
74
75FFlowPin FFlowPinType::CreateFlowPinFromValueWrapper(const FName& PinName, const FFlowDataPinValue& Wrapper) const
76{

Callers 1

Calls 3

SetPinTypeNameMethod · 0.80
ToStringMethod · 0.80
GetToolTipTextMethod · 0.80

Tested by

no test coverage detected