68 lines
2.3 KiB
C++
68 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "Containers/UnrealString.h"
|
|
#include "GameFeatureStateChangeObserver.h"
|
|
#include "GameFeaturesProjectPolicies.h"
|
|
#include "UObject/Object.h"
|
|
#include "UObject/ObjectPtr.h"
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
#include "LyraGameFeaturePolicy.generated.h"
|
|
|
|
class FName;
|
|
class UGameFeatureData;
|
|
struct FPrimaryAssetId;
|
|
|
|
/**
|
|
* Manager to keep track of the state machines that bring a game feature plugin into memory and active
|
|
* This class discovers plugins either that are built-in and distributed with the game or are reported externally (i.e. by a web service or other endpoint)
|
|
*/
|
|
UCLASS(MinimalAPI, Config = Game)
|
|
class ULyraGameFeaturePolicy : public UDefaultGameFeaturesProjectPolicies
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
LYRAGAME_API static ULyraGameFeaturePolicy& Get();
|
|
|
|
ULyraGameFeaturePolicy(const FObjectInitializer& ObjectInitializer);
|
|
|
|
//~UGameFeaturesProjectPolicies interface
|
|
virtual void InitGameFeatureManager() override;
|
|
virtual void ShutdownGameFeatureManager() override;
|
|
virtual TArray<FPrimaryAssetId> GetPreloadAssetListForGameFeature(const UGameFeatureData* GameFeatureToLoad, bool bIncludeLoadedAssets = false) const override;
|
|
virtual bool IsPluginAllowed(const FString& PluginURL) const override;
|
|
virtual const TArray<FName> GetPreloadBundleStateForGameFeature() const override;
|
|
virtual void GetGameFeatureLoadingMode(bool& bLoadClientData, bool& bLoadServerData) const override;
|
|
//~End of UGameFeaturesProjectPolicies interface
|
|
|
|
private:
|
|
UPROPERTY(Transient)
|
|
TArray<TObjectPtr<UObject>> Observers;
|
|
};
|
|
|
|
|
|
|
|
// checked
|
|
UCLASS()
|
|
class ULyraGameFeature_HotfixManager : public UObject, public IGameFeatureStateChangeObserver
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
virtual void OnGameFeatureLoading(const UGameFeatureData* GameFeatureData, const FString& PluginURL) override;
|
|
};
|
|
|
|
// checked
|
|
UCLASS()
|
|
class ULyraGameFeature_AddGameplayCuePaths : public UObject, public IGameFeatureStateChangeObserver
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
virtual void OnGameFeatureRegistering(const UGameFeatureData* GameFeatureData, const FString& PluginName, const FString& PluginURL) override;
|
|
virtual void OnGameFeatureUnregistering(const UGameFeatureData* GameFeatureData, const FString& PluginName, const FString& PluginURL) override;
|
|
}; |