Files
UnrealEngineUWP/Engine/Source/Runtime/PreLoadScreen/Public/SimplePreLoadScreenWidget.h
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -05:00

50 lines
1.7 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Framework/Application/SlateApplication.h"
#include "Rendering/SlateRenderer.h"
#include "RenderingThread.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SWidget.h"
#include "Widgets/SCompoundWidget.h"
#include "Widgets/Layout/SDPIScaler.h"
//Widget that displays a very simple version of a FPreLoadScreen UI that just includes a background and localized text together.
//Rotates through the PreLoadScreens in the same order they are in the FPreLoadSettingsContainerBase. Uses the TimeToDisplayEachBackground variable to determine how long
//to display each screen before rotating. Loops back when finished.
class SSimplePreLoadScreenWidget : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SSimplePreLoadScreenWidget) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
//Handles updating the background every X seconds
virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
private:
//Loops to the next background image
virtual void UpdateBackgroundImage();
//Not used in the default simple implementation
virtual float GetDPIScale() const { return 1.0f; };
const FSlateBrush* GetCurrentBackgroundImage() const;
FText GetCurrentScreenText() const;
FSlateFontInfo GetTextFont() const;
FSlateFontInfo GetFontInfo(const FString& FontName, float FontSize) const;
int CurrentPreLoadScreenIndex;
float TimeToDisplayEachBackground;
float TimeSinceLastBackgroundUpdate;
static FCriticalSection BackgroundImageCrit;
static int CurrentBackgroundImage;
};