搬了lyra的hudlayout
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class CommonStartupLoadingScreen : ModuleRules
|
||||
{
|
||||
public CommonStartupLoadingScreen(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicIncludePaths.AddRange(
|
||||
new string[] {
|
||||
// ... add public include paths required here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
// ... add other private include paths required here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
// ... add other public dependencies that you statically link with here ...
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"MoviePlayer",
|
||||
"PreLoadScreen",
|
||||
"DeveloperSettings"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
// ... add any modules that your module loads dynamically here ...
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "CommonPreLoadScreen.h"
|
||||
|
||||
#include "Misc/App.h"
|
||||
#include "SCommonPreLoadingScreenWidget.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "CommonPreLoadingScreen"
|
||||
|
||||
void FCommonPreLoadScreen::Init()
|
||||
{
|
||||
if (!GIsEditor && FApp::CanEverRender())
|
||||
{
|
||||
EngineLoadingWidget = SNew(SCommonPreLoadingScreenWidget);
|
||||
}
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PreLoadScreenBase.h"
|
||||
|
||||
class SWidget;
|
||||
|
||||
class FCommonPreLoadScreen : public FPreLoadScreenBase
|
||||
{
|
||||
public:
|
||||
|
||||
/*** IPreLoadScreen Implementation ***/
|
||||
virtual void Init() override;
|
||||
virtual EPreLoadScreenTypes GetPreLoadScreenType() const override { return EPreLoadScreenTypes::EngineLoadingScreen; }
|
||||
virtual TSharedPtr<SWidget> GetWidget() override { return EngineLoadingWidget; }
|
||||
private:
|
||||
|
||||
TSharedPtr<SWidget> EngineLoadingWidget;
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "CommonPreLoadScreen.h"
|
||||
#include "Misc/App.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "PreLoadScreenManager.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FCommonLoadingScreenModule"
|
||||
|
||||
class FCommonStartupLoadingScreenModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
bool IsGameModule() const override;
|
||||
|
||||
private:
|
||||
void OnPreLoadScreenManagerCleanUp();
|
||||
|
||||
TSharedPtr<FCommonPreLoadScreen> PreLoadingScreen;
|
||||
};
|
||||
|
||||
|
||||
void FCommonStartupLoadingScreenModule::StartupModule()
|
||||
{
|
||||
// No need to load these assets on dedicated servers.
|
||||
// Still want to load them in commandlets so cook catches them
|
||||
if (!IsRunningDedicatedServer())
|
||||
{
|
||||
PreLoadingScreen = MakeShared<FCommonPreLoadScreen>();
|
||||
PreLoadingScreen->Init();
|
||||
|
||||
if (!GIsEditor && FApp::CanEverRender() && FPreLoadScreenManager::Get())
|
||||
{
|
||||
FPreLoadScreenManager::Get()->RegisterPreLoadScreen(PreLoadingScreen);
|
||||
FPreLoadScreenManager::Get()->OnPreLoadScreenManagerCleanUp.AddRaw(this, &FCommonStartupLoadingScreenModule::OnPreLoadScreenManagerCleanUp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FCommonStartupLoadingScreenModule::OnPreLoadScreenManagerCleanUp()
|
||||
{
|
||||
//Once the PreLoadScreenManager is cleaning up, we can get rid of all our resources too
|
||||
PreLoadingScreen.Reset();
|
||||
ShutdownModule();
|
||||
}
|
||||
|
||||
void FCommonStartupLoadingScreenModule::ShutdownModule()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool FCommonStartupLoadingScreenModule::IsGameModule() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
IMPLEMENT_MODULE(FCommonStartupLoadingScreenModule, CommonStartupLoadingScreen)
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "SCommonPreLoadingScreenWidget.h"
|
||||
|
||||
#include "Widgets/Layout/SBorder.h"
|
||||
|
||||
class FReferenceCollector;
|
||||
|
||||
#define LOCTEXT_NAMESPACE "SCommonPreLoadingScreenWidget"
|
||||
|
||||
void SCommonPreLoadingScreenWidget::Construct(const FArguments& InArgs)
|
||||
{
|
||||
ChildSlot
|
||||
[
|
||||
SNew(SBorder)
|
||||
.BorderImage(FCoreStyle::Get().GetBrush("WhiteBrush"))
|
||||
.BorderBackgroundColor(FLinearColor::Black)
|
||||
.Padding(0)
|
||||
];
|
||||
}
|
||||
|
||||
void SCommonPreLoadingScreenWidget::AddReferencedObjects(FReferenceCollector& Collector)
|
||||
{
|
||||
//WidgetAssets.AddReferencedObjects(Collector);
|
||||
}
|
||||
|
||||
FString SCommonPreLoadingScreenWidget::GetReferencerName() const
|
||||
{
|
||||
return TEXT("SCommonPreLoadingScreenWidget");
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "UObject/GCObject.h"
|
||||
#include "Widgets/Accessibility/SlateWidgetAccessibleTypes.h"
|
||||
#include "Widgets/SCompoundWidget.h"
|
||||
|
||||
class FReferenceCollector;
|
||||
|
||||
class SCommonPreLoadingScreenWidget : public SCompoundWidget, public FGCObject
|
||||
{
|
||||
public:
|
||||
SLATE_BEGIN_ARGS(SCommonPreLoadingScreenWidget) {}
|
||||
SLATE_END_ARGS()
|
||||
|
||||
void Construct(const FArguments& InArgs);
|
||||
|
||||
//~ Begin FGCObject interface
|
||||
virtual void AddReferencedObjects(FReferenceCollector& Collector) override;
|
||||
virtual FString GetReferencerName() const override;
|
||||
//~ End FGCObject interface
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user