You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
87 lines
2.4 KiB
C++
87 lines
2.4 KiB
C++
// 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<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,
|
|
TAttribute<FGraphAppearanceInfo> Appearance,
|
|
TSharedPtr<SWidget> InTitleBar,
|
|
const TAttribute<bool>& 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
|