// Copyright 1998-2014 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() { TArray< TWeakPtr >& Instances = SGraphEditor::AllInstances; for (auto InstanceIt = SGraphEditor::AllInstances.CreateIterator(); InstanceIt; ++InstanceIt) { TWeakPtr& 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& 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 FGraphEditorModule::PRIVATE_MakeGraphEditor( const TSharedPtr& InAdditionalCommands, const TAttribute& InIsEditable, TAttribute Appearance, TSharedPtr InTitleBar, const TAttribute& InTitleBarEnabledOnly, UEdGraph* InGraphToEdit, SGraphEditor::FGraphEditorEvents InGraphEvents, bool InAutoExpandActionMenu, UEdGraph* InGraphToDiff, FSimpleDelegate InOnNavigateHistoryBack, FSimpleDelegate InOnNavigateHistoryForward, bool InShowPIENotification) { return SNew(SGraphEditorImpl) .AdditionalCommands( InAdditionalCommands ) .IsEditable( InIsEditable ) .Appearance( Appearance ) .TitleBar( InTitleBar ) .TitleBarEnabledOnly( InTitleBarEnabledOnly ) .GraphToEdit( InGraphToEdit) .GraphEvents(InGraphEvents) .AutoExpandActionMenu(InAutoExpandActionMenu) .GraphToDiff(InGraphToDiff) .OnNavigateHistoryBack(InOnNavigateHistoryBack) .OnNavigateHistoryForward(InOnNavigateHistoryForward) .ShowPIENotification(InShowPIENotification); } ///////////////////////////////////////////////////// #undef LOCTEXT_NAMESPACE