diff --git a/Source/Flow/Private/Nodes/FlowNodeBase.cpp b/Source/Flow/Private/Nodes/FlowNodeBase.cpp index 8f60f3e4..2e772ce5 100644 --- a/Source/Flow/Private/Nodes/FlowNodeBase.cpp +++ b/Source/Flow/Private/Nodes/FlowNodeBase.cpp @@ -730,6 +730,14 @@ FString UFlowNodeBase::GetNodeDescription() const return K2_GetNodeDescription(); } +FString UFlowNodeBase::GetAddOnDescriptions() const +{ + return FString::JoinBy(AddOns, LINE_TERMINATOR, [](const UFlowNodeBase* Addon) + { + return Addon->GetNodeDescription(); + }); +} + bool UFlowNodeBase::CanModifyFlowDataPinType() const { return !IsPlacedInFlowAsset() || IsFlowNamedPropertiesSupplier(); @@ -962,7 +970,7 @@ bool UFlowNodeBase::BuildMessage(FString& Message) const EDataValidationResult UFlowNodeBase::ValidateNode() { EDataValidationResult ValidationResult = EDataValidationResult::NotValidated; - + if (GetClass()->IsFunctionImplementedInScript(GET_FUNCTION_NAME_CHECKED(UFlowNodeBase, K2_ValidateNode))) { ValidationResult = K2_ValidateNode(); diff --git a/Source/Flow/Public/Nodes/FlowNodeBase.h b/Source/Flow/Public/Nodes/FlowNodeBase.h index 25894ff3..1512af72 100644 --- a/Source/Flow/Public/Nodes/FlowNodeBase.h +++ b/Source/Flow/Public/Nodes/FlowNodeBase.h @@ -507,6 +507,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 GetAddOnDescriptions() const; #endif protected: diff --git a/Source/FlowEditor/Private/Graph/FlowGraphEditorSettings.cpp b/Source/FlowEditor/Private/Graph/FlowGraphEditorSettings.cpp index 766ed1b8..47c7f7a5 100644 --- a/Source/FlowEditor/Private/Graph/FlowGraphEditorSettings.cpp +++ b/Source/FlowEditor/Private/Graph/FlowGraphEditorSettings.cpp @@ -9,6 +9,7 @@ UFlowGraphEditorSettings::UFlowGraphEditorSettings() : NodeDoubleClickTarget(EFlowNodeDoubleClickTarget::PrimaryAssetOrNodeDefinition) , bShowNodeClass(false) , bShowNodeDescriptionWhilePlaying(true) + , bShowAddonDescriptions(true) , bEnforceFriendlyPinNames(false) , bShowSubGraphPreview(true) , bShowSubGraphPath(true) diff --git a/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp b/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp index 38668c28..b83b6049 100644 --- a/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp +++ b/Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp @@ -361,7 +361,7 @@ void UFlowGraphNode::ReconstructNode() { FlowNode->UpdateNodeConfigText(); } - + // This ensures the graph editor 'Refresh' button still rebuilds all the graph widgets even if the FlowGraphNode has nothing to update // Ideally we could get rid of the 'Refresh' button, but I think it will keep being useful, esp. for users making rough custom widgets (void)OnReconstructNodeCompleted.ExecuteIfBound(); @@ -737,7 +737,22 @@ FString UFlowGraphNode::GetNodeDescription() const { if (NodeInstance && (GEditor->PlayWorld == nullptr || GetDefault()->bShowNodeDescriptionWhilePlaying)) { - return NodeInstance->GetNodeDescription(); + const UFlowGraphEditorSettings* GraphEditorSettings = GetDefault(); + if (GEditor->PlayWorld == nullptr || GraphEditorSettings->bShowNodeDescriptionWhilePlaying) + { + FString Result = NodeInstance->GetNodeDescription(); + + if (GraphEditorSettings->bShowAddonDescriptions) + { + FString AddonDescriptions = NodeInstance->GetAddOnDescriptions(); + if (!AddonDescriptions.IsEmpty()) + { + return Result.Append(LINE_TERMINATOR).Append(AddonDescriptions); + } + } + + return Result; + } } return FString(); @@ -1568,7 +1583,7 @@ void UFlowGraphNode::RemoveSubNode(UFlowGraphNode* SubNode) { SubNode->NodeInstance->OnAddOnRequestedParentReconstruction.Unbind(); } - + SubNodes.RemoveSingle(SubNode); RebuildRuntimeAddOnsFromEditorSubNodes(); @@ -1585,7 +1600,7 @@ void UFlowGraphNode::RemoveAllSubNodes() SubNode->NodeInstance->OnAddOnRequestedParentReconstruction.Unbind(); } } - + SubNodes.Reset(); RebuildRuntimeAddOnsFromEditorSubNodes(); @@ -1879,8 +1894,7 @@ bool UFlowGraphNode::TryUpdateNodePins() const bool bPinsChanged = false; - if (!FlowNodeInstance->CanUserAddInput() && - !CheckPinsMatch(RequiredNodeInputPins, ExistingNodeInputPins)) + if (!FlowNodeInstance->CanUserAddInput() && !CheckPinsMatch(RequiredNodeInputPins, ExistingNodeInputPins)) { FlowNodeInstance->Modify(); @@ -1890,8 +1904,7 @@ bool UFlowGraphNode::TryUpdateNodePins() const bPinsChanged = true; } - if (!FlowNodeInstance->CanUserAddOutput() && - !CheckPinsMatch(RequiredNodeOutputPins, ExistingNodeOutputPins)) + if (!FlowNodeInstance->CanUserAddOutput() && !CheckPinsMatch(RequiredNodeOutputPins, ExistingNodeOutputPins)) { FlowNodeInstance->Modify(); diff --git a/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h b/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h index 955d64af..047f75bc 100644 --- a/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h +++ b/Source/FlowEditor/Public/Graph/FlowGraphEditorSettings.h @@ -45,6 +45,10 @@ class FLOWEDITOR_API UFlowGraphEditorSettings : public UDeveloperSettings UPROPERTY(config, EditAnywhere, Category = "Nodes") bool bShowNodeDescriptionWhilePlaying; + // Display descriptions from attached addons in node descriptions + UPROPERTY(EditAnywhere, config, Category = "Nodes") + bool bShowAddonDescriptions; + // Pin names will be displayed in a format that is easier to read, even if PinFriendlyName wasn't set UPROPERTY(EditAnywhere, config, Category = "Nodes") bool bEnforceFriendlyPinNames;