diff --git a/Source/Flow/Private/Nodes/FlowNodeBase.cpp b/Source/Flow/Private/Nodes/FlowNodeBase.cpp index fe646b4b0..b1393a2f4 100644 --- a/Source/Flow/Private/Nodes/FlowNodeBase.cpp +++ b/Source/Flow/Private/Nodes/FlowNodeBase.cpp @@ -784,6 +784,20 @@ FString UFlowNodeBase::GetNodeDescription() const { return K2_GetNodeDescription(); } + +FString UFlowNodeBase::GetNodeDescriptionWithAddons() const +{ + FString Description = GetNodeDescription(); + FString AddonDescriptions = FString::JoinBy(AddOns, + LINE_TERMINATOR, + [](const UFlowNodeBase* Addon) { return Addon->GetNodeDescriptionWithAddons(); }); + if (!AddonDescriptions.IsEmpty()) + { + return Description.Append(LINE_TERMINATOR).Append(AddonDescriptions); + } + + return Description; +} #endif void UFlowNodeBase::SetNodeConfigText(const FText& NodeConfigText) diff --git a/Source/Flow/Public/Nodes/FlowNodeBase.h b/Source/Flow/Public/Nodes/FlowNodeBase.h index a9efca067..ed957efcb 100644 --- a/Source/Flow/Public/Nodes/FlowNodeBase.h +++ b/Source/Flow/Public/Nodes/FlowNodeBase.h @@ -382,6 +382,9 @@ class FLOW_API UFlowNodeBase public: // Short summary of node's content - displayed over node as NodeInfoPopup virtual FString GetNodeDescription() const; + + // Complex summary of node's content including its addons + FString GetNodeDescriptionWithAddons() const; #endif protected: diff --git a/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp b/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp index d24aab90b..17c8c2c22 100644 --- a/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp +++ b/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp @@ -711,6 +711,10 @@ FString UFlowGraphNode::GetNodeDescription() const { if (NodeInstance && (GEditor->PlayWorld == nullptr || UFlowGraphEditorSettings::Get()->bShowNodeDescriptionWhilePlaying)) { + if (UFlowGraphEditorSettings::Get()->bShowAddonNodeDescriptions) + { + return NodeInstance->GetNodeDescriptionWithAddons(); + } return NodeInstance->GetNodeDescription(); } diff --git a/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h b/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h index 6e3546702..f45a1f7aa 100644 --- a/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h +++ b/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h @@ -52,6 +52,10 @@ class FLOWEDITOR_API UFlowGraphEditorSettings : public UDeveloperSettings UPROPERTY(config, EditAnywhere, Category = "Nodes", meta = (EditCondition = "bShowSubGraphPreview")) FVector2D SubGraphPreviewSize; + + // Display descriptions from attached addons in node descriptions + UPROPERTY(EditAnywhere, config, Category = "Nodes") + bool bShowAddonNodeDescriptions = true; /** Enable hot reload for native flow nodes? * WARNING: hot reload can easily crash the editor and you can lose progress */