Skip to content

Commit

Permalink
allow to customize Flow Asset Category Name
Browse files Browse the repository at this point in the history
  • Loading branch information
MothDoctor committed Jan 16, 2022
1 parent 4e07528 commit e618dbe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/FlowEditor/Private/Asset/FlowAssetEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "ToolMenus.h"
#include "Widgets/Docking/SDockTab.h"

#define LOCTEXT_NAMESPACE "FlowEditor"
#define LOCTEXT_NAMESPACE "FlowAssetEditor"

const FName FFlowAssetEditor::DetailsTab(TEXT("Details"));
const FName FFlowAssetEditor::GraphTab(TEXT("Graph"));
Expand Down
4 changes: 2 additions & 2 deletions Source/FlowEditor/Private/FlowEditorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "LevelEditor.h"
#include "Modules/ModuleManager.h"

#define LOCTEXT_NAMESPACE "FlowEditor"
#define LOCTEXT_NAMESPACE "FlowEditorModule"

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

Expand Down Expand Up @@ -105,7 +105,7 @@ void FFlowEditorModule::ShutdownModule()
void FFlowEditorModule::RegisterAssets()
{
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
FlowAssetCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Flow")), LOCTEXT("FlowAssetCategory", "Flow"));
FlowAssetCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Flow")), UFlowGraphSettings::Get()->FlowAssetCategoryName);

const TSharedRef<IAssetTypeActions> FlowAssetActions = MakeShareable(new FAssetTypeActions_FlowAsset());
RegisteredAssetActions.Add(FlowAssetActions);
Expand Down
5 changes: 5 additions & 0 deletions Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

#include "FlowAsset.h"

#define LOCTEXT_NAMESPACE "FlowGraphSettings"

UFlowGraphSettings::UFlowGraphSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, bExposeFlowAssetCreation(true)
, bExposeFlowNodeCreation(true)
, bShowAssetToolbarAboveLevelEditor(true)
, FlowAssetCategoryName(LOCTEXT("FlowAssetCategory", "Flow"))
, WorldAssetClass(UFlowAsset::StaticClass())
, bShowDefaultPinNames(false)
, ExecPinColorModifier(0.75f, 0.75f, 0.75f, 1.0f)
Expand All @@ -33,3 +36,5 @@ UFlowGraphSettings::UFlowGraphSettings(const FObjectInitializer& ObjectInitializ
NodeTitleColors.Emplace(EFlowNodeStyle::Logic, FLinearColor(1.0f, 1.0f, 1.0f, 1.0f));
NodeTitleColors.Emplace(EFlowNodeStyle::SubGraph, FLinearColor(1.0f, 0.128f, 0.0f, 1.0f));
}

#undef LOCTEXT_NAMESPACE
3 changes: 3 additions & 0 deletions Source/FlowEditor/Public/Graph/FlowGraphSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class UFlowGraphSettings final : public UDeveloperSettings
UPROPERTY(EditAnywhere, config, Category = "Default UI")
bool bShowAssetToolbarAboveLevelEditor;

UPROPERTY(EditAnywhere, config, Category = "Default UI")
FText FlowAssetCategoryName;

/** Flow Asset class allowed to be assigned via Level Editor toolbar*/
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (EditCondition = "bShowAssetToolbarAboveLevelEditor"))
TSubclassOf<class UFlowAsset> WorldAssetClass;
Expand Down

0 comments on commit e618dbe

Please sign in to comment.