From cc604de64b666f996715d7780384214011b85f38 Mon Sep 17 00:00:00 2001 From: Alex Mein Date: Tue, 18 Feb 2025 21:47:22 +0000 Subject: [PATCH 1/2] Added missing calls to parent class Cleanup method --- Source/Flow/Private/Nodes/Actor/FlowNode_ComponentObserver.cpp | 2 ++ Source/Flow/Private/Nodes/Actor/FlowNode_PlayLevelSequence.cpp | 2 ++ Source/Flow/Private/Nodes/Graph/FlowNode_SubGraph.cpp | 2 ++ Source/Flow/Private/Nodes/Route/FlowNode_Counter.cpp | 2 ++ Source/Flow/Private/Nodes/Route/FlowNode_ExecutionMultiGate.cpp | 2 ++ Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp | 2 ++ Source/Flow/Private/Nodes/Route/FlowNode_Timer.cpp | 2 ++ 7 files changed, 14 insertions(+) diff --git a/Source/Flow/Private/Nodes/Actor/FlowNode_ComponentObserver.cpp b/Source/Flow/Private/Nodes/Actor/FlowNode_ComponentObserver.cpp index 3020836a3..10d2ef8d3 100644 --- a/Source/Flow/Private/Nodes/Actor/FlowNode_ComponentObserver.cpp +++ b/Source/Flow/Private/Nodes/Actor/FlowNode_ComponentObserver.cpp @@ -145,6 +145,8 @@ void UFlowNode_ComponentObserver::Cleanup() RegisteredActors.Empty(); SuccessCount = 0; + + Super::Cleanup(); } #if WITH_EDITOR diff --git a/Source/Flow/Private/Nodes/Actor/FlowNode_PlayLevelSequence.cpp b/Source/Flow/Private/Nodes/Actor/FlowNode_PlayLevelSequence.cpp index 70fc34b31..9cfbd4f2b 100644 --- a/Source/Flow/Private/Nodes/Actor/FlowNode_PlayLevelSequence.cpp +++ b/Source/Flow/Private/Nodes/Actor/FlowNode_PlayLevelSequence.cpp @@ -300,6 +300,8 @@ void UFlowNode_PlayLevelSequence::Cleanup() #if ENABLE_VISUAL_LOG UE_VLOG(this, LogFlow, Log, TEXT("Finished playback: %s"), *Sequence.ToString()); #endif + + Super::Cleanup(); } FString UFlowNode_PlayLevelSequence::GetPlaybackProgress() const diff --git a/Source/Flow/Private/Nodes/Graph/FlowNode_SubGraph.cpp b/Source/Flow/Private/Nodes/Graph/FlowNode_SubGraph.cpp index 6c0e374a0..047737d36 100644 --- a/Source/Flow/Private/Nodes/Graph/FlowNode_SubGraph.cpp +++ b/Source/Flow/Private/Nodes/Graph/FlowNode_SubGraph.cpp @@ -86,6 +86,8 @@ void UFlowNode_SubGraph::Cleanup() { GetFlowSubsystem()->RemoveSubFlow(this, EFlowFinishPolicy::Keep); } + + Super::Cleanup(); } void UFlowNode_SubGraph::ForceFinishNode() diff --git a/Source/Flow/Private/Nodes/Route/FlowNode_Counter.cpp b/Source/Flow/Private/Nodes/Route/FlowNode_Counter.cpp index f6a4cd701..43f94de55 100644 --- a/Source/Flow/Private/Nodes/Route/FlowNode_Counter.cpp +++ b/Source/Flow/Private/Nodes/Route/FlowNode_Counter.cpp @@ -65,6 +65,8 @@ void UFlowNode_Counter::ExecuteInput(const FName& PinName) void UFlowNode_Counter::Cleanup() { CurrentSum = 0; + + Super::Cleanup(); } #if WITH_EDITOR diff --git a/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionMultiGate.cpp b/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionMultiGate.cpp index a7e05289e..ca16183b3 100644 --- a/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionMultiGate.cpp +++ b/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionMultiGate.cpp @@ -96,6 +96,8 @@ void UFlowNode_ExecutionMultiGate::Cleanup() { NextOutput = 0; Completed.Reset(); + + Super::Cleanup(); } #if WITH_EDITOR diff --git a/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp b/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp index 386dbaa81..4dc8509ea 100644 --- a/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp +++ b/Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp @@ -42,6 +42,8 @@ void UFlowNode_ExecutionSequence::OnLoad_Implementation() void UFlowNode_ExecutionSequence::Cleanup() { ExecutedConnections.Empty(); + + Super::Cleanup(); } void UFlowNode_ExecutionSequence::ExecuteNewConnections() diff --git a/Source/Flow/Private/Nodes/Route/FlowNode_Timer.cpp b/Source/Flow/Private/Nodes/Route/FlowNode_Timer.cpp index 184862c39..2e842dd9c 100644 --- a/Source/Flow/Private/Nodes/Route/FlowNode_Timer.cpp +++ b/Source/Flow/Private/Nodes/Route/FlowNode_Timer.cpp @@ -155,6 +155,8 @@ void UFlowNode_Timer::Cleanup() StepTimerHandle.Invalidate(); SumOfSteps = 0.0f; + + Super::Cleanup(); } void UFlowNode_Timer::OnSave_Implementation() From b3c7e759a219c7903eb2d60413de8a230fdf25d8 Mon Sep 17 00:00:00 2001 From: Rhillion Date: Wed, 19 Feb 2025 16:37:07 +0000 Subject: [PATCH 2/2] Added addon descriptions to node descriptions, with editor settings option to disable --- Source/Flow/Private/Nodes/FlowNodeBase.cpp | 14 ++++++++++++++ Source/Flow/Public/Nodes/FlowNodeBase.h | 3 +++ .../Private/Graph/Nodes/FlowGraphNode.cpp | 4 ++++ .../Public/Graph/FlowGraphEditorSettings.h | 4 ++++ 4 files changed, 25 insertions(+) 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 */