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
5 changes: 5 additions & 0 deletions Source/Flow/Private/FlowAsset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,11 @@ TWeakObjectPtr<UFlowAsset> UFlowAsset::GetFlowInstance(UFlowNode_SubGraph* SubGr
return ActiveSubGraphs.FindRef(SubGraphNode);
}

FName UFlowAsset::GetDisplayName() const
{
return GetFName();
}

void UFlowAsset::InitializePreloadPolicy()
{
if (PreloadPolicy.IsValid())
Expand Down
37 changes: 36 additions & 1 deletion Source/Flow/Private/Nodes/FlowNodeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ FString UFlowNodeBase::GetNodeCategory() const
}
}

return Category;
return K2_GetNodeCategory();
}

bool UFlowNodeBase::GetDynamicTitleColor(FLinearColor& OutColor) const
Expand All @@ -636,6 +636,32 @@ bool UFlowNodeBase::GetDynamicTitleColor(FLinearColor& OutColor) const
return false;
}

FText UFlowNodeBase::GetNodeTitle() const
{
if (HasAnyFlags(RF_ClassDefaultObject | RF_ArchetypeObject))
{
// For the archetype of the node (e.g. in the node selection UI), only use the default value
return UFlowNodeBase::K2_GetNodeTitle_Implementation();
}
else
{
return K2_GetNodeTitle();
}
}

FText UFlowNodeBase::GetNodeToolTip() const
{
if (HasAnyFlags(RF_ClassDefaultObject | RF_ArchetypeObject))
{
// For the archetype of the node (e.g. in the node selection UI), only use the default value
return UFlowNodeBase::K2_GetNodeToolTip_Implementation();
}
else
{
return K2_GetNodeToolTip();
}
}

FText UFlowNodeBase::GetGeneratedDisplayName() const
{
static const FName NAME_GeneratedDisplayName(TEXT("GeneratedDisplayName"));
Expand Down Expand Up @@ -820,6 +846,15 @@ FText UFlowNodeBase::K2_GetNodeToolTip_Implementation() const
#endif
}

FString UFlowNodeBase::K2_GetNodeCategory_Implementation() const
{
#if WITH_EDITORONLY_DATA
return Category;
#else
return "";
#endif
}

FText UFlowNodeBase::GetNodeConfigText() const
{
#if WITH_EDITORONLY_DATA
Expand Down
1 change: 1 addition & 0 deletions Source/Flow/Public/FlowAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ class FLOW_API UFlowAsset : public UObject

public:
UFlowSubsystem* GetFlowSubsystem() const;
FName GetDisplayName() const;

UFlowNode_SubGraph* GetNodeOwningThisAssetInstance() const;
UFlowAsset* GetParentInstance() const;
Expand Down
9 changes: 6 additions & 3 deletions Source/Flow/Public/Nodes/FlowNodeBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ class FLOW_API UFlowNodeBase
/* This method allows to have different for every node instance, i.e. Red if node represents enemy, Green if node represents a friend. */
virtual bool GetDynamicTitleColor(FLinearColor& OutColor) const;

virtual FText GetNodeTitle() const { return K2_GetNodeTitle(); }
virtual FText GetNodeToolTip() const { return K2_GetNodeToolTip(); }
virtual FText GetNodeTitle() const;
virtual FText GetNodeToolTip() const;

FText GetGeneratedDisplayName() const;

Expand Down Expand Up @@ -488,7 +488,10 @@ class FLOW_API UFlowNodeBase

UFUNCTION(BlueprintNativeEvent, Category = "FlowNode")
FText K2_GetNodeToolTip() const;


UFUNCTION(BlueprintNativeEvent, Category = "FlowNode")
FString K2_GetNodeCategory() const;

UFUNCTION(BlueprintPure, Category = "FlowNode")
virtual FText GetNodeConfigText() const;

Expand Down
4 changes: 2 additions & 2 deletions Source/FlowEditor/Private/Asset/FlowAssetToolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ FText SFlowAssetInstanceList::JoinInstanceAndContextTexts(const FObjectKey& Asse
{
if (const UFlowAsset* Instance = Cast<UFlowAsset>(AssetInstance.ResolveObjectPtr()))
{
FText Result = FText::FromName(Instance->GetFName());
FText Result = FText::FromName(Instance->GetDisplayName());

// add context name if there are multiple contexts present
if (InstancesPerContext.Num() > 1)
Expand Down Expand Up @@ -321,7 +321,7 @@ void SFlowAssetBreadcrumb::FillBreadcrumb() const
TWeakObjectPtr<const UFlowAsset> Instance = InstancesFromRoot[Index];
TWeakObjectPtr<const UFlowAsset> ChildInstance = Index < InstancesFromRoot.Num() - 1 ? InstancesFromRoot[Index + 1] : nullptr;

BreadcrumbTrail->PushCrumb(FText::FromName(Instance->GetFName()), FFlowBreadcrumb(Instance, ChildInstance));
BreadcrumbTrail->PushCrumb(FText::FromName(Instance->GetDisplayName()), FFlowBreadcrumb(Instance, ChildInstance));
}
}
}
Expand Down