Files
UnrealEngineUWP/Engine/Source/Editor/GraphEditor/Private/GraphEditorModule.cpp
Michael Schoell 2043b596a8 Various graphs that looked disabled, will now correctly display as Read Only but can be panned and nodes are selectable.
Reworked how graphs were disabled to stop all out disabling of the SGraphPanel while still maintaining the visual display of being read-only.

Removed concept of TitleBarEnabledOnly from the graph editor and merged it with the IsEditable functionality.

#jira UE-10289  - Changing Blueprint Interface layout can shift nodes out of view

[CL 2535806 by Michael Schoell in Main branch]
2015-05-04 11:08:14 -04:00

88 lines
2.4 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "GraphEditorCommon.h"
#include "GraphEditor.h"
#include "GraphEditorModule.h"
#include "GraphEditorActions.h"
#include "ScopedTransaction.h"
#include "SGraphEditorActionMenu.h"
#include "EdGraphUtilities.h"
#include "SGraphEditorImpl.h"
IMPLEMENT_MODULE(FGraphEditorModule, GraphEditor);
#define LOCTEXT_NAMESPACE "GraphEditorModule"
/////////////////////////////////////////////////////
// FGraphEditorModule
void FGraphEditorModule::StartupModule()
{
FGraphEditorCommands::Register();
TArray< TWeakPtr<SGraphEditor> >& Instances = SGraphEditor::AllInstances;
for (auto InstanceIt = SGraphEditor::AllInstances.CreateIterator(); InstanceIt; ++InstanceIt)
{
TWeakPtr<SGraphEditor>& Instance = *InstanceIt;
if (Instance.IsValid())
{
Instance.Pin()->OnModuleReloaded();
}
}
}
void FGraphEditorModule::ShutdownModule()
{
// Notify all the instances of GraphEditor that their code is about to be unloaded.
for (auto InstanceIt = SGraphEditor::AllInstances.CreateIterator(); InstanceIt; ++InstanceIt)
{
TWeakPtr<SGraphEditor>& Instance = *InstanceIt;
if (Instance.IsValid())
{
Instance.Pin()->OnModuleUnloading();
}
}
FGraphEditorCommands::Unregister();
}
/**
* DO NOT CALL THIS METHOD. Use SNew(SGraphEditor) to make instances of SGraphEditor.
*
* @return A GraphEditor implementation.
*/
TSharedRef<SGraphEditor> FGraphEditorModule::PRIVATE_MakeGraphEditor(
const TSharedPtr<FUICommandList>& InAdditionalCommands,
const TAttribute<bool>& InIsEditable,
const TAttribute<bool>& InIsEmpty,
TAttribute<FGraphAppearanceInfo> Appearance,
TSharedPtr<SWidget> InTitleBar,
UEdGraph* InGraphToEdit,
SGraphEditor::FGraphEditorEvents InGraphEvents,
bool InAutoExpandActionMenu,
UEdGraph* InGraphToDiff,
FSimpleDelegate InOnNavigateHistoryBack,
FSimpleDelegate InOnNavigateHistoryForward,
TAttribute<bool> ShowGraphStateOverlay)
{
return
SNew(SGraphEditorImpl)
.AdditionalCommands(InAdditionalCommands)
.IsEditable(InIsEditable)
.Appearance(Appearance)
.TitleBar(InTitleBar)
.GraphToEdit(InGraphToEdit)
.GraphEvents(InGraphEvents)
.AutoExpandActionMenu(InAutoExpandActionMenu)
.GraphToDiff(InGraphToDiff)
.OnNavigateHistoryBack(InOnNavigateHistoryBack)
.OnNavigateHistoryForward(InOnNavigateHistoryForward)
.ShowGraphStateOverlay(ShowGraphStateOverlay);
}
/////////////////////////////////////////////////////
#undef LOCTEXT_NAMESPACE