Skip to content

Commit

Permalink
added option to hide Asset Toolbar above Level Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
MothDoctor committed Aug 5, 2021
1 parent e02b422 commit 4403621
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/FlowEditor/Private/FlowEditorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -47,11 +48,14 @@ void FFlowEditorModule::StartupModule()
FlowAssetExtensibility.Init();

// add Flow Toolbar
if (FLevelEditorModule* LevelEditorModule = FModuleManager::GetModulePtr<FLevelEditorModule>(TEXT("LevelEditor")))
if (UFlowGraphSettings::Get()->bShowAssetToolbarAboveLevelEditor)
{
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddToolBarExtension("Game", EExtensionHook::After, nullptr, FToolBarExtensionDelegate::CreateRaw(this, &FFlowEditorModule::CreateFlowToolbar));
LevelEditorModule->GetToolBarExtensibilityManager()->AddExtender(MenuExtender);
if (FLevelEditorModule* LevelEditorModule = FModuleManager::GetModulePtr<FLevelEditorModule>(TEXT("LevelEditor")))
{
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddToolBarExtension("Game", EExtensionHook::After, nullptr, FToolBarExtensionDelegate::CreateRaw(this, &FFlowEditorModule::CreateFlowToolbar));
LevelEditorModule->GetToolBarExtensibilityManager()->AddExtender(MenuExtender);
}
}

// register Flow sequence track
Expand Down
1 change: 1 addition & 0 deletions Source/FlowEditor/Private/Graph/FlowGraphSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Source/FlowEditor/Public/Graph/FlowGraphSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4403621

Please sign in to comment.