Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Resources/Icons/Discord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Icons/Docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Icons/Github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Source/FlowEditor/FlowEditor.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ public FlowEditor(ReadOnlyTargetRules target) : base(target)
"RenderCore",
"Sequencer",
"SequencerCore",
"Settings",
"Slate",
"SlateCore",
"SourceControl",
"ToolMenus",
"UnrealEd"
]);
}
}
}
65 changes: 64 additions & 1 deletion Source/FlowEditor/Private/FlowEditorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include "Asset/FlowAssetEditor.h"
#include "Asset/FlowAssetIndexer.h"
#include "Graph/FlowGraphConnectionDrawingPolicy.h"
#include "Graph/FlowGraphEditorSettings.h"
#include "Graph/FlowGraphPinFactory.h"
#include "Graph/FlowGraphSettings.h"
#include "Utils/SFlowWelcomeWindow.h"
#include "Utils/SLevelEditorFlow.h"
#include "MovieScene/FlowTrackEditor.h"
#include "Nodes/AssetTypeActions_FlowNodeBlueprint.h"
Expand Down Expand Up @@ -47,11 +49,14 @@
#include "AssetRegistry/AssetRegistryModule.h"
#include "EdGraphUtilities.h"
#include "IAssetSearchModule.h"
#include "Framework/Application/SlateApplication.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "ISequencerChannelInterface.h" // ignore Rider's false "unused include" warning
#include "ISequencerModule.h"
#include "LevelEditor.h"
#include "Misc/CoreDelegates.h"
#include "Modules/ModuleManager.h"
#include "Widgets/SWindow.h"

static FName AssetSearchModuleName = TEXT("AssetSearch");

Expand Down Expand Up @@ -91,6 +96,18 @@ void FFlowEditorModule::StartupModule()

RegisterDetailCustomizations();

if (GIsEditor && !IsRunningCommandlet())
{
if (FSlateApplication::IsInitialized())
{
TryOpenWelcomeWindow();
}
else
{
PostEngineInitHandle = FCoreDelegates::OnPostEngineInit.AddRaw(this, &FFlowEditorModule::HandlePostEngineInit);
}
}

// register asset indexers
if (FModuleManager::Get().IsModuleLoaded(AssetSearchModuleName))
{
Expand All @@ -115,6 +132,12 @@ void FFlowEditorModule::RegisterForAssetChanges()

void FFlowEditorModule::ShutdownModule()
{
if (PostEngineInitHandle.IsValid())
{
FCoreDelegates::OnPostEngineInit.Remove(PostEngineInitHandle);
PostEngineInitHandle.Reset();
}

FFlowEditorStyle::Shutdown();

UnregisterDetailCustomizations();
Expand Down Expand Up @@ -349,6 +372,46 @@ void FFlowEditorModule::OnAssetRenamed(const FAssetData& AssetData, const FStrin
OnAssetUpdated(AssetData);
}

void FFlowEditorModule::HandlePostEngineInit()
{
if (PostEngineInitHandle.IsValid())
{
FCoreDelegates::OnPostEngineInit.Remove(PostEngineInitHandle);
PostEngineInitHandle.Reset();
}

TryOpenWelcomeWindow();
}

void FFlowEditorModule::TryOpenWelcomeWindow()
{
if (!FSlateApplication::IsInitialized())
{
return;
}

UFlowGraphEditorSettings* EditorSettings = GetMutableDefault<UFlowGraphEditorSettings>();
if (!EditorSettings || !EditorSettings->bShowWelcomeWindowOnStartup)
{
return;
}

const TSharedRef<SWindow> WelcomeWindow = SNew(SWindow)
.Title(LOCTEXT("FlowWelcomeWindowTitle", "Welcome to Flow Graph"))
.ClientSize(FVector2D(880.f, 520.f))
.SizingRule(ESizingRule::UserSized)
.AutoCenter(EAutoCenter::PreferredWorkArea)
.SupportsMaximize(false)
.SupportsMinimize(false)
[
SNew(SFlowWelcomeWindow)
];
FSlateApplication::Get().AddWindow(WelcomeWindow);

EditorSettings->bShowWelcomeWindowOnStartup = false;
EditorSettings->SaveConfig();
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FFlowEditorModule, FlowEditor)
IMPLEMENT_MODULE(FFlowEditorModule, FlowEditor)
4 changes: 4 additions & 0 deletions Source/FlowEditor/Private/FlowEditorStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ void FFlowEditorStyle::Initialize()
StyleSet->Set("Flow.Node.Body", new BOX_BRUSH("Icons/FlowNode_Body", FMargin(16.f/64.f)));
StyleSet->Set("Flow.Node.ActiveShadow", new BOX_BRUSH("Icons/FlowNode_Shadow_Active", FMargin(18.0f/64.0f)));
StyleSet->Set("Flow.Node.WasActiveShadow", new BOX_BRUSH("Icons/FlowNode_Shadow_WasActive", FMargin(18.0f/64.0f)));

StyleSet->Set("FlowWelcome.Docs", new IMAGE_BRUSH(TEXT("Icons/Docs"), Icon20));
StyleSet->Set("FlowWelcome.GitHub", new IMAGE_BRUSH(TEXT("Icons/Github"), Icon20));
StyleSet->Set("FlowWelcome.Discord", new IMAGE_BRUSH(TEXT("Icons/Discord"), Icon20));

FSlateStyleRegistry::RegisterSlateStyle(*StyleSet.Get());
};
Expand Down
3 changes: 2 additions & 1 deletion Source/FlowEditor/Private/Graph/FlowGraphEditorSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include UE_INLINE_GENERATED_CPP_BY_NAME(FlowGraphEditorSettings)

UFlowGraphEditorSettings::UFlowGraphEditorSettings()
: NodeDoubleClickTarget(EFlowNodeDoubleClickTarget::PrimaryAssetOrNodeDefinition)
: bShowWelcomeWindowOnStartup(true)
, NodeDoubleClickTarget(EFlowNodeDoubleClickTarget::PrimaryAssetOrNodeDefinition)
, bShowNodeClass(false)
, bShowNodeDescriptionWhilePlaying(true)
, bShowAddonDescriptions(true)
Expand Down
Loading