Files
UnrealEngineUWP/Engine/Source/Runtime/PreLoadScreen/Public/PreLoadScreenBase.h
justin marcus 637c03cc22 Undo //Fortnite/Release-10.0/Engine/... changelist 7445561
Resubmitting CL 7437649

-Allow preload screens to optionally render
-Add FileExistsInPlatformPackage() to platform misc
-Add HasBuildMetaData() to bundle manager interface

[at]Thomas.Ross [at]Daniel.Lamb [at]Hongyi.Yu
#test preflight passed automation tests


#ROBOMERGE-SOURCE: CL 7474485 via CL 7474487 via CL 7475393
#ROBOMERGE-BOT: (v372-7473910)

[CL 7475436 by justin marcus in Main branch]
2019-07-22 11:49:15 -04:00

70 lines
3.2 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "PreLoadScreen.h"
// Base implementation of the IPreLoadScreen that handles all the logic for controlling / updating the UI for PreLoadScreens.
// Designed to be overriden by a game specific Plugin that calls FPreloadScreenManager::RegisterPreLoadScreen so that functions are called by the PreLoadScreenManager correctly.
class PRELOADSCREEN_API FPreLoadScreenBase :
public IPreLoadScreen
//,public TSharedFromThis<FPreLoadScreenBase, ESPMode::ThreadSafe>
{
/**** IPreLoadScreen implementation ****/
public:
//We don't use these in the FPreLoadScreenBase, but they are useful for game-specific implementations
virtual void Tick(float DeltaTime) override {}
virtual bool ShouldRender() const override { return true; }
virtual void RenderTick(float DeltaTime) override {};
virtual void OnStop() override {}
//Store off TargetWindow
virtual void OnPlay(TWeakPtr<SWindow> TargetWindow) override { OwningWindow = TargetWindow; }
//By default have a small added tick delay so we don't super spin out while waiting on other threads to load data / etc.
virtual float GetAddedTickDelay() override { return 0.02f; }
virtual bool Init() override { return true; }
virtual TSharedPtr<SWidget> GetWidget() override { return nullptr; }
virtual const TSharedPtr<const SWidget> GetWidget() const override { return nullptr; }
//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 override { return EPreLoadScreenTypes::EngineLoadingScreen; }
virtual void SetEngineLoadingFinished(bool IsEngineLoadingFinished) override { bIsEngineLoadingFinished = IsEngineLoadingFinished; }
// PreLoadScreens not using this functionality should return NAME_None
virtual FName GetPreLoadScreenTag() const override { return NAME_None; }
virtual void CleanUp() override;
//Default behavior is just to see if we have an active widget. Should really overload with our own behavior to see if we are done displaying
virtual bool IsDone() const override;
public:
FPreLoadScreenBase()
: bIsEngineLoadingFinished(false)
{}
virtual ~FPreLoadScreenBase() override {};
//Handles constructing a FPreLoadSettingsContainerBase with the
virtual void InitSettingsFromConfig(const FString& ConfigFileName);
//Set what plugin is creating this PreLoadScreenBase. Used to make file paths relative to that plugin as well as
//determining . Used for converting locations for content to be relative to the plugin calling us
virtual void SetPluginName(const FString& PluginNameIn) { PluginName = PluginNameIn; }
protected:
TWeakPtr<SWindow> OwningWindow;
bool bIsEngineLoadingFinished;
private:
//The name of the Plugin creating this FPreLoadScreenBase.
//Important: Should be set before Initting settings from Config!
FString PluginName;
};