RealtimeStyleTransferRuntime/Source/LyraGame/UI/Foundation/LyraLoadingScreenSubsystem.h

45 lines
1.3 KiB
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
2022-09-13 07:18:28 +00:00
#include "Delegates/Delegate.h"
2022-05-23 18:41:30 +00:00
#include "Subsystems/GameInstanceSubsystem.h"
2022-09-13 07:18:28 +00:00
#include "Templates/SubclassOf.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "LyraLoadingScreenSubsystem.generated.h"
2022-09-13 07:18:28 +00:00
class UObject;
class UUserWidget;
struct FFrame;
2022-05-23 18:41:30 +00:00
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLoadingScreenWidgetChangedDelegate, TSubclassOf<UUserWidget>, NewWidgetClass);
/**
* Tracks/stores the current loading screen configuration in a place
* that persists across map transitions
*/
UCLASS()
class LYRAGAME_API ULyraLoadingScreenSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
ULyraLoadingScreenSubsystem();
// Sets the loading screen widget class to display inside of the loading screen widget host
UFUNCTION(BlueprintCallable)
void SetLoadingScreenContentWidget(TSubclassOf<UUserWidget> NewWidgetClass);
// Returns the last set loading screen widget class to display inside of the loading screen widget host
UFUNCTION(BlueprintPure)
TSubclassOf<UUserWidget> GetLoadingScreenContentWidget() const;
private:
UPROPERTY(BlueprintAssignable, meta=(AllowPrivateAccess))
FLoadingScreenWidgetChangedDelegate OnLoadingScreenWidgetChanged;
UPROPERTY()
TSubclassOf<UUserWidget> LoadingScreenWidgetClass;
};