Skip to content

Commit 3120da6

Browse files
committed
allow to customize Flow Asset Category Name
1 parent 5fe8f67 commit 3120da6

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Source/FlowEditor/Private/Asset/FlowAssetEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "ToolMenus.h"
3434
#include "Widgets/Docking/SDockTab.h"
3535

36-
#define LOCTEXT_NAMESPACE "FlowEditor"
36+
#define LOCTEXT_NAMESPACE "FlowAssetEditor"
3737

3838
const FName FFlowAssetEditor::DetailsTab(TEXT("Details"));
3939
const FName FFlowAssetEditor::GraphTab(TEXT("Graph"));

Source/FlowEditor/Private/FlowEditorModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "LevelEditor.h"
3030
#include "Modules/ModuleManager.h"
3131

32-
#define LOCTEXT_NAMESPACE "FlowEditor"
32+
#define LOCTEXT_NAMESPACE "FlowEditorModule"
3333

3434
EAssetTypeCategories::Type FFlowEditorModule::FlowAssetCategory = static_cast<EAssetTypeCategories::Type>(0);
3535

@@ -111,7 +111,7 @@ void FFlowEditorModule::ShutdownModule()
111111
void FFlowEditorModule::RegisterAssets()
112112
{
113113
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
114-
FlowAssetCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Flow")), LOCTEXT("FlowAssetCategory", "Flow"));
114+
FlowAssetCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Flow")), UFlowGraphSettings::Get()->FlowAssetCategoryName);
115115

116116
const TSharedRef<IAssetTypeActions> FlowAssetActions = MakeShareable(new FAssetTypeActions_FlowAsset());
117117
RegisteredAssetActions.Add(FlowAssetActions);

Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
#include "FlowAsset.h"
44

5+
#define LOCTEXT_NAMESPACE "FlowGraphSettings"
6+
57
UFlowGraphSettings::UFlowGraphSettings(const FObjectInitializer& ObjectInitializer)
68
: Super(ObjectInitializer)
79
, bExposeFlowAssetCreation(true)
810
, bExposeFlowNodeCreation(true)
911
, bShowAssetToolbarAboveLevelEditor(true)
12+
, FlowAssetCategoryName(LOCTEXT("FlowAssetCategory", "Flow"))
1013
, WorldAssetClass(UFlowAsset::StaticClass())
1114
, bShowDefaultPinNames(false)
1215
, ExecPinColorModifier(0.75f, 0.75f, 0.75f, 1.0f)
@@ -33,3 +36,5 @@ UFlowGraphSettings::UFlowGraphSettings(const FObjectInitializer& ObjectInitializ
3336
NodeTitleColors.Emplace(EFlowNodeStyle::Logic, FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
3437
NodeTitleColors.Emplace(EFlowNodeStyle::SubGraph, FLinearColor(1.0f, 0.128f, 0.0f, 1.0f));
3538
}
39+
40+
#undef LOCTEXT_NAMESPACE

Source/FlowEditor/Public/Graph/FlowGraphSettings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class UFlowGraphSettings final : public UDeveloperSettings
3030
UPROPERTY(EditAnywhere, config, Category = "Default UI")
3131
bool bShowAssetToolbarAboveLevelEditor;
3232

33+
UPROPERTY(EditAnywhere, config, Category = "Default UI")
34+
FText FlowAssetCategoryName;
35+
3336
/** Flow Asset class allowed to be assigned via Level Editor toolbar*/
3437
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (EditCondition = "bShowAssetToolbarAboveLevelEditor"))
3538
TSubclassOf<class UFlowAsset> WorldAssetClass;

0 commit comments

Comments
 (0)