Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Source/Flow/Private/Nodes/FlowNodeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Source/Flow/Public/Nodes/FlowNodeBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 4 additions & 0 deletions Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down