Files
UnrealEngineUWP/Engine/Source/Runtime/PreLoadScreen/Public/PreLoadScreen.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

62 lines
2.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Widgets/SWindow.h"
#include "IAnalyticsProviderET.h"
enum class EPreLoadScreenTypes : uint8
{
CustomSplashScreen,
EarlyStartupScreen,
EngineLoadingScreen
};
// Interface that defines the class that handles all the logic for controlling / displaying a particular PreLoadScreen.
// Designed to be implemented in a Plugin that calls FPreLoadScreenManager::RegisterPreLoadScreen so that functions are called by PreLoadScreenManager correctly.
// Really should probably inherit from FPreLoadScreenBase instead of this class for more functionality
class IPreLoadScreen //: public TSharedFromThis<IPreLoadScreen, ESPMode::ThreadSafe>
{
public:
virtual ~IPreLoadScreen() {};
virtual void Init() = 0;
//Standard tick that happens every frame
virtual void Tick(float DeltaTime) = 0;
//This function is used to determine if an extra platform sleep should be performed every tick (to slow down the tick rate)
//keeps us from spinning super fast when we aren't doing much beyond loading data / etc on other threads.
virtual float GetAddedTickDelay() = 0;
//Whether an EarlyStartupLoadScreen should render
virtual bool ShouldRender() const = 0;
//This tick happens as part of the slate render tick during an EarlyStartupLoadScreen
virtual void RenderTick(float DeltaTime) = 0;
//Callback for when a PreLoadScreen starts being displayed. Provides a reference to the SWindow that will be used to display content
virtual void OnPlay(TWeakPtr<SWindow> TargetWindow) = 0;
//Callback for when a PreLoadScreen is no longer being displayed.
virtual void OnStop() = 0;
virtual bool IsDone() const = 0;
virtual void CleanUp() = 0;
//Should override this function to determine if this screen should be used to handle EarlyStartupScreen behavior
//IMPORTANT: This changes a LOT of functionality and implementation details. EarlyStartupScreens happen before the engine is fully initialized and block engine initialization before they finish.
// this means they have to forgo even the most basic of engine features like UObject support, as they are displayed before those systems are initialized.
virtual EPreLoadScreenTypes GetPreLoadScreenType() const = 0;
// Allows the PreLoadScreen to register a tag that can be later used to find a specific loading screen.
// PreLoadScreens not using this functionality should return NAME_None
virtual FName GetPreLoadScreenTag() const = 0;
virtual void SetEngineLoadingFinished(bool IsEngineLoadingFinished) = 0;
virtual const TSharedPtr<const SWidget> GetWidget() const = 0;
virtual TSharedPtr<SWidget> GetWidget() = 0;
};