Skip to content

Commit 31b4d49

Browse files
Fixed Format Text node not supporting the Format Text input connection (#350)
1 parent e37aadf commit 31b4d49

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Source/Flow/Private/Nodes/Graph/FlowNode_FormatText.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ FFlowDataPinResult UFlowNode_FormatText::TrySupplyDataPin(FName PinName) const
2424
if (PinName == OUTPIN_TextOutput)
2525
{
2626
FText FormattedText;
27-
const EFlowDataPinResolveResult FormatResult = TryResolveFormatText(PinName, FormattedText);
27+
const EFlowDataPinResolveResult FormatResult = TryResolveFormattedText(PinName, FormattedText);
2828

2929
if (FlowPinType::IsSuccess(FormatResult))
3030
{
@@ -39,15 +39,18 @@ FFlowDataPinResult UFlowNode_FormatText::TrySupplyDataPin(FName PinName) const
3939
return Super::TrySupplyDataPin(PinName);
4040
}
4141

42-
EFlowDataPinResolveResult UFlowNode_FormatText::TryResolveFormatText(const FName& PinName, FText& OutFormattedText) const
42+
EFlowDataPinResolveResult UFlowNode_FormatText::TryResolveFormattedText(const FName& PinName, FText& OutFormattedText) const
4343
{
44-
if (TryFormatTextWithNamedPropertiesAsParameters(FormatText, OutFormattedText))
44+
FText ResolvedFormatText = FormatText;
45+
const EFlowDataPinResolveResult ResolveResult = TryResolveDataPinValue<FFlowPinType_Text>(GET_MEMBER_NAME_CHECKED(ThisClass, FormatText), ResolvedFormatText);
46+
47+
if (TryFormatTextWithNamedPropertiesAsParameters(ResolvedFormatText, OutFormattedText))
4548
{
4649
return EFlowDataPinResolveResult::Success;
4750
}
4851
else
4952
{
50-
LogError(FString::Printf(TEXT("Could not format text '%s' with properties as parameters"), *FormatText.ToString()), EFlowOnScreenMessageType::Temporary);
53+
LogError(FString::Printf(TEXT("Could not format text '%s' with properties as parameters"), *ResolvedFormatText.ToString()), EFlowOnScreenMessageType::Temporary);
5154

5255
return EFlowDataPinResolveResult::FailedWithError;
5356
}

Source/Flow/Public/Nodes/Graph/FlowNode_FormatText.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class FLOW_API UFlowNode_FormatText : public UFlowNode_DefineProperties
3333
#endif
3434

3535
protected:
36-
EFlowDataPinResolveResult TryResolveFormatText(const FName& PinName, FText& OutFormattedText) const;
36+
EFlowDataPinResolveResult TryResolveFormattedText(const FName& PinName, FText& OutFormattedText) const;
3737

3838
public:
3939
// IFlowDataPinValueSupplierInterface

0 commit comments

Comments
 (0)