From 4a688c832e28d118abcd40405360a8c937deab5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20S=C3=B6nnichsen?= Date: Thu, 25 Dec 2025 22:43:51 +0100 Subject: [PATCH] Exposed methods to public to enable flow node status display in runtime debuggers --- Source/Flow/Private/Nodes/FlowNode.cpp | 22 +++++++++++----------- Source/Flow/Private/Nodes/FlowNodeBase.cpp | 2 +- Source/Flow/Public/Nodes/FlowNode.h | 5 +++-- Source/Flow/Public/Nodes/FlowNodeBase.h | 7 +++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Source/Flow/Private/Nodes/FlowNode.cpp b/Source/Flow/Private/Nodes/FlowNode.cpp index 048339277..07de6e358 100644 --- a/Source/Flow/Private/Nodes/FlowNode.cpp +++ b/Source/Flow/Private/Nodes/FlowNode.cpp @@ -1042,17 +1042,6 @@ FString UFlowNode::GetProgressAsString(const float Value) return FString::Printf(TEXT("%.*f"), 2, Value); } -#if WITH_EDITOR -UFlowNode* UFlowNode::GetInspectedInstance() const -{ - if (const UFlowAsset* FlowInstance = GetFlowAsset()->GetInspectedInstance()) - { - return FlowInstance->GetNode(GetGuid()); - } - - return nullptr; -} - FString UFlowNode::GetStatusStringForNodeAndAddOns() const { FString CombinedStatusString = GetStatusString(); @@ -1079,6 +1068,17 @@ FString UFlowNode::GetStatusStringForNodeAndAddOns() const return CombinedStatusString; } +#if WITH_EDITOR +UFlowNode* UFlowNode::GetInspectedInstance() const +{ + if (const UFlowAsset* FlowInstance = GetFlowAsset()->GetInspectedInstance()) + { + return FlowInstance->GetNode(GetGuid()); + } + + return nullptr; +} + bool UFlowNode::GetStatusBackgroundColor(FLinearColor& OutColor) const { return K2_GetStatusBackgroundColor(OutColor); diff --git a/Source/Flow/Private/Nodes/FlowNodeBase.cpp b/Source/Flow/Private/Nodes/FlowNodeBase.cpp index 85420b9ba..912199dd8 100644 --- a/Source/Flow/Private/Nodes/FlowNodeBase.cpp +++ b/Source/Flow/Private/Nodes/FlowNodeBase.cpp @@ -259,12 +259,12 @@ TArray UFlowNodeBase::GetContextOutputs() const return ContextOutputs; } +#endif // WITH_EDITOR FString UFlowNodeBase::GetStatusString() const { return K2_GetStatusString(); } -#endif // WITH_EDITOR UFlowAsset* UFlowNodeBase::GetFlowAsset() const { diff --git a/Source/Flow/Public/Nodes/FlowNode.h b/Source/Flow/Public/Nodes/FlowNode.h index b9da34695..63df210a8 100644 --- a/Source/Flow/Public/Nodes/FlowNode.h +++ b/Source/Flow/Public/Nodes/FlowNode.h @@ -379,8 +379,6 @@ class FLOW_API UFlowNode TMap GetWireRecords() const; TArray GetPinRecords(const FName& PinName, const EEdGraphPinDirection PinDirection) const; - // Information displayed while node is working - displayed over node as NodeInfoPopup - FString GetStatusStringForNodeAndAddOns() const; virtual bool GetStatusBackgroundColor(FLinearColor& OutColor) const; virtual FString GetAssetPath(); @@ -416,6 +414,9 @@ class FLOW_API UFlowNode UFUNCTION(BlueprintPure, Category = "FlowNode") static FString GetProgressAsString(float Value); + + // Information displayed while node is working - displayed over node as NodeInfoPopup + FString GetStatusStringForNodeAndAddOns() const; }; // Templates & inline implementations: diff --git a/Source/Flow/Public/Nodes/FlowNodeBase.h b/Source/Flow/Public/Nodes/FlowNodeBase.h index b9f9d5169..4da8f6293 100644 --- a/Source/Flow/Public/Nodes/FlowNodeBase.h +++ b/Source/Flow/Public/Nodes/FlowNodeBase.h @@ -336,14 +336,13 @@ class FLOW_API UFlowNodeBase // used when import graph from another asset virtual void PostImport() {} + void RequestReconstruction() const { (void) OnReconstructionRequested.ExecuteIfBound(); } +#endif + // Called by owning FlowNode to add to its Status String. // (may be multi-line) virtual FString GetStatusString() const; - void RequestReconstruction() const { (void) OnReconstructionRequested.ExecuteIfBound(); }; - -#endif - protected: // Information displayed while node is working - displayed over node as NodeInfoPopup UFUNCTION(BlueprintImplementableEvent, Category = "FlowNode", meta = (DisplayName = "Get Status String"))