RealtimeStyleTransferRuntime/Source/LyraGame/UI/Frontend/LyraFrontendStateComponent.h

72 lines
2.2 KiB
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Components/GameStateComponent.h"
#include "ControlFlowNode.h"
2022-09-13 07:18:28 +00:00
#include "Engine/EngineTypes.h"
#include "HAL/Platform.h"
#include "LoadingProcessInterface.h"
#include "Templates/SharedPointer.h"
#include "UObject/SoftObjectPtr.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "LyraFrontendStateComponent.generated.h"
2022-09-13 07:18:28 +00:00
class FControlFlow;
class FString;
class FText;
class UObject;
struct FFrame;
2022-05-23 18:41:30 +00:00
enum class ECommonUserOnlineContext : uint8;
enum class ECommonUserPrivilege : uint8;
class UCommonActivatableWidget;
class UCommonUserInfo;
2022-09-13 07:18:28 +00:00
class ULyraExperienceDefinition;
2022-05-23 18:41:30 +00:00
UCLASS(Abstract)
class ULyraFrontendStateComponent : public UGameStateComponent, public ILoadingProcessInterface
{
GENERATED_BODY()
public:
ULyraFrontendStateComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
//~UActorComponent interface
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
//~End of UActorComponent interface
//~ILoadingProcessInterface interface
virtual bool ShouldShowLoadingScreen(FString& OutReason) const override;
//~End of ILoadingProcessInterface
private:
void OnExperienceLoaded(const ULyraExperienceDefinition* Experience);
UFUNCTION()
void OnUserInitialized(const UCommonUserInfo* UserInfo, bool bSuccess, FText Error, ECommonUserPrivilege RequestedPrivilege, ECommonUserOnlineContext OnlineContext);
void FlowStep_WaitForUserInitialization(FControlFlowNodeRef SubFlow);
void FlowStep_TryShowPressStartScreen(FControlFlowNodeRef SubFlow);
2022-09-13 07:18:28 +00:00
void FlowStep_TryJoinRequestedSession(FControlFlowNodeRef SubFlow);
2022-05-23 18:41:30 +00:00
void FlowStep_TryShowMainScreen(FControlFlowNodeRef SubFlow);
bool bShouldShowLoadingScreen = true;
UPROPERTY(EditAnywhere, Category = UI)
TSoftClassPtr<UCommonActivatableWidget> PressStartScreenClass;
UPROPERTY(EditAnywhere, Category = UI)
TSoftClassPtr<UCommonActivatableWidget> MainScreenClass;
TSharedPtr<FControlFlow> FrontEndFlow;
// If set, this is the in-progress press start screen task
FControlFlowNodePtr InProgressPressStartScreen;
2022-09-13 07:18:28 +00:00
FDelegateHandle OnJoinSessionCompleteEventHandle;
2022-05-23 18:41:30 +00:00
};