From 4403621a236b2a19d4f11e009ad66c7cbff02873 Mon Sep 17 00:00:00 2001 From: Moth Doctor Date: Thu, 5 Aug 2021 14:17:56 +0200 Subject: [PATCH] added option to hide Asset Toolbar above Level Editor --- Source/FlowEditor/Private/FlowEditorModule.cpp | 12 ++++++++---- .../FlowEditor/Private/Graph/FlowGraphSettings.cpp | 1 + Source/FlowEditor/Public/Graph/FlowGraphSettings.h | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/FlowEditor/Private/FlowEditorModule.cpp b/Source/FlowEditor/Private/FlowEditorModule.cpp index fdc871db..15bfb735 100644 --- a/Source/FlowEditor/Private/FlowEditorModule.cpp +++ b/Source/FlowEditor/Private/FlowEditorModule.cpp @@ -5,6 +5,7 @@ #include "Asset/FlowAssetDetails.h" #include "Asset/FlowAssetEditor.h" #include "Graph/FlowGraphConnectionDrawingPolicy.h" +#include "Graph/FlowGraphSettings.h" #include "LevelEditor/SLevelEditorFlow.h" #include "MovieScene/FlowTrackEditor.h" #include "Nodes/AssetTypeActions_FlowNodeBlueprint.h" @@ -47,11 +48,14 @@ void FFlowEditorModule::StartupModule() FlowAssetExtensibility.Init(); // add Flow Toolbar - if (FLevelEditorModule* LevelEditorModule = FModuleManager::GetModulePtr(TEXT("LevelEditor"))) + if (UFlowGraphSettings::Get()->bShowAssetToolbarAboveLevelEditor) { - TSharedPtr MenuExtender = MakeShareable(new FExtender()); - MenuExtender->AddToolBarExtension("Game", EExtensionHook::After, nullptr, FToolBarExtensionDelegate::CreateRaw(this, &FFlowEditorModule::CreateFlowToolbar)); - LevelEditorModule->GetToolBarExtensibilityManager()->AddExtender(MenuExtender); + if (FLevelEditorModule* LevelEditorModule = FModuleManager::GetModulePtr(TEXT("LevelEditor"))) + { + TSharedPtr MenuExtender = MakeShareable(new FExtender()); + MenuExtender->AddToolBarExtension("Game", EExtensionHook::After, nullptr, FToolBarExtensionDelegate::CreateRaw(this, &FFlowEditorModule::CreateFlowToolbar)); + LevelEditorModule->GetToolBarExtensibilityManager()->AddExtender(MenuExtender); + } } // register Flow sequence track diff --git a/Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp b/Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp index 623695d3..98348af5 100644 --- a/Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp +++ b/Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp @@ -7,6 +7,7 @@ UFlowGraphSettings::UFlowGraphSettings(const FObjectInitializer& ObjectInitializ , 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) diff --git a/Source/FlowEditor/Public/Graph/FlowGraphSettings.h b/Source/FlowEditor/Public/Graph/FlowGraphSettings.h index ef693731..bb9d2f49 100644 --- a/Source/FlowEditor/Public/Graph/FlowGraphSettings.h +++ b/Source/FlowEditor/Public/Graph/FlowGraphSettings.h @@ -38,6 +38,9 @@ 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;