Skip to content

Commit

Permalink
allow to hide Flow Asset and Flow Node from "Create Asset" menu
Browse files Browse the repository at this point in the history
  • Loading branch information
MothDoctor committed Aug 16, 2021
1 parent edf0760 commit 53ed6ca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "Asset/AssetTypeActions_FlowAsset.h"
#include "FlowEditorModule.h"
#include "Graph/FlowGraphSettings.h"

#include "FlowAsset.h"

Expand All @@ -14,7 +15,7 @@ FText FAssetTypeActions_FlowAsset::GetName() const

uint32 FAssetTypeActions_FlowAsset::GetCategories()
{
return FFlowEditorModule::FlowAssetCategory;
return UFlowGraphSettings::Get()->bExposeFlowAssetCreation ? FFlowEditorModule::FlowAssetCategory : 0;
}

UClass* FAssetTypeActions_FlowAsset::GetSupportedClass() const
Expand Down
4 changes: 3 additions & 1 deletion Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

UFlowGraphSettings::UFlowGraphSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, bExposeFlowAssetCreation(true)
, bExposeFlowNodeCreation(true)
, bShowAssetToolbarAboveLevelEditor(true)
, bShowDefaultPinNames(false)
, ExecPinColorModifier(0.75f, 0.75f, 0.75f, 1.0f)
, NodeDescriptionBackground(FLinearColor(0.0625f, 0.0625f, 0.0625f, 1.0f))
, NodeStatusBackground(FLinearColor(0.12f, 0.12f, 0.12f, 1.0f))
, NodePreloadedBackground(FLinearColor(0.12f, 0.12f, 0.12f, 1.0f))
, bShowAssetToolbarAboveLevelEditor(true)
, InactiveWireColor(FLinearColor(0.364f, 0.364f, 0.364f, 1.0f))
, InactiveWireThickness(1.5f)
, RecentWireDuration(3.0f)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Nodes/AssetTypeActions_FlowNodeBlueprint.h"
#include "Nodes/FlowNodeBlueprintFactory.h"
#include "FlowEditorModule.h"
#include "Graph/FlowGraphSettings.h"

#include "Nodes/FlowNodeBlueprint.h"

Expand All @@ -13,7 +14,7 @@ FText FAssetTypeActions_FlowNodeBlueprint::GetName() const

uint32 FAssetTypeActions_FlowNodeBlueprint::GetCategories()
{
return FFlowEditorModule::FlowAssetCategory;
return UFlowGraphSettings::Get()->bExposeFlowNodeCreation ? FFlowEditorModule::FlowAssetCategory : 0;
}

UClass* FAssetTypeActions_FlowNodeBlueprint::GetSupportedClass() const
Expand Down
18 changes: 15 additions & 3 deletions Source/FlowEditor/Public/Graph/FlowGraphSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ class UFlowGraphSettings final : public UDeveloperSettings
GENERATED_UCLASS_BODY()
static UFlowGraphSettings* Get() { return CastChecked<UFlowGraphSettings>(UFlowGraphSettings::StaticClass()->GetDefaultObject()); }

/** Show Flow Asset in Flow category of "Create Asset" menu?
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Default UI")
bool bExposeFlowAssetCreation;

/** Show Flow Node blueprint in Flow category of "Create Asset" menu?
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Default UI")
bool bExposeFlowNodeCreation;

/** Show Flow Asset toolbar?
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Default UI")
bool bShowAssetToolbarAboveLevelEditor;

/** Hide specific nodes from the Flow Palette without changing the source code.
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Nodes")
Expand All @@ -37,9 +52,6 @@ class UFlowGraphSettings final : public UDeveloperSettings

UPROPERTY(EditAnywhere, config, Category = "NodePopups")
FLinearColor NodePreloadedBackground;

UPROPERTY(EditAnywhere, config, Category = "World")
bool bShowAssetToolbarAboveLevelEditor;

UPROPERTY(EditAnywhere, config, Category = "Wires")
FLinearColor InactiveWireColor;
Expand Down

0 comments on commit 53ed6ca

Please sign in to comment.