// Copyright Epic Games, Inc. All Rights Reserved. #include "LyraEditorEngine.h" #include "Development/LyraDeveloperSettings.h" #include "Development/LyraPlatformEmulationSettings.h" #include "Engine/GameInstance.h" #include "Framework/Notifications/NotificationManager.h" #include "GameModes/LyraWorldSettings.h" #include "Settings/ContentBrowserSettings.h" #include "Settings/LevelEditorPlaySettings.h" #include "Widgets/Notifications/SNotificationList.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(LyraEditorEngine) class IEngineLoop; #define LOCTEXT_NAMESPACE "LyraEditor" ULyraEditorEngine::ULyraEditorEngine(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { } void ULyraEditorEngine::Init(IEngineLoop* InEngineLoop) { Super::Init(InEngineLoop); } void ULyraEditorEngine::Start() { Super::Start(); } void ULyraEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) { Super::Tick(DeltaSeconds, bIdleMode); FirstTickSetup(); } void ULyraEditorEngine::FirstTickSetup() { if (bFirstTickSetup) { return; } bFirstTickSetup = true; // Force show plugin content on load. GetMutableDefault()->SetDisplayPluginFolders(true); } FGameInstancePIEResult ULyraEditorEngine::PreCreatePIEInstances(const bool bAnyBlueprintErrors, const bool bStartInSpectatorMode, const float PIEStartTime, const bool bSupportsOnlinePIE, int32& InNumOnlinePIEInstances) { if (const ALyraWorldSettings* LyraWorldSettings = Cast(EditorWorld->GetWorldSettings())) { if (LyraWorldSettings->ForceStandaloneNetMode) { EPlayNetMode OutPlayNetMode; PlaySessionRequest->EditorPlaySettings->GetPlayNetMode(OutPlayNetMode); if (OutPlayNetMode != PIE_Standalone) { PlaySessionRequest->EditorPlaySettings->SetPlayNetMode(PIE_Standalone); FNotificationInfo Info(LOCTEXT("ForcingStandaloneForFrontend", "Forcing NetMode: Standalone for the Frontend")); Info.ExpireDuration = 2.0f; FSlateNotificationManager::Get().AddNotification(Info); } } } //@TODO: Should add delegates that a *non-editor* module could bind to for PIE start/stop instead of poking directly GetDefault()->OnPlayInEditorStarted(); GetDefault()->OnPlayInEditorStarted(); // FGameInstancePIEResult Result = Super::PreCreatePIEServerInstance(bAnyBlueprintErrors, bStartInSpectatorMode, PIEStartTime, bSupportsOnlinePIE, InNumOnlinePIEInstances); return Result; } #undef LOCTEXT_NAMESPACE