|
|
|
|
| #pragma once
|
|
|
| #include "GameplayCueManager.h"
|
|
|
| #include "LyraGameplayCueManager.generated.h"
|
|
|
| class FString;
|
| class UClass;
|
| class UObject;
|
| class UWorld;
|
| struct FObjectKey;
|
|
|
| |
| |
| |
| |
|
|
| UCLASS()
|
| class ULyraGameplayCueManager : public UGameplayCueManager
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| ULyraGameplayCueManager(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
| static ULyraGameplayCueManager* Get();
|
|
|
|
|
| virtual void OnCreated() override;
|
| virtual bool ShouldAsyncLoadRuntimeObjectLibraries() const override;
|
| virtual bool ShouldSyncLoadMissingGameplayCues() const override;
|
| virtual bool ShouldAsyncLoadMissingGameplayCues() const override;
|
|
|
|
|
| static void DumpGameplayCues(const TArray<FString>& Args);
|
|
|
|
|
| void LoadAlwaysLoadedCues();
|
|
|
|
|
| void RefreshGameplayCuePrimaryAsset();
|
|
|
| private:
|
| void OnGameplayTagLoaded(const FGameplayTag& Tag);
|
| void HandlePostGarbageCollect();
|
| void ProcessLoadedTags();
|
| void ProcessTagToPreload(const FGameplayTag& Tag, UObject* OwningObject);
|
| void OnPreloadCueComplete(FSoftObjectPath Path, TWeakObjectPtr<UObject> OwningObject, bool bAlwaysLoadedCue);
|
| void RegisterPreloadedCue(UClass* LoadedGameplayCueClass, UObject* OwningObject);
|
| void HandlePostLoadMap(UWorld* NewWorld);
|
| void UpdateDelayLoadDelegateListeners();
|
| bool ShouldDelayLoadGameplayCues() const;
|
|
|
| private:
|
| struct FLoadedGameplayTagToProcessData
|
| {
|
| FGameplayTag Tag;
|
| TWeakObjectPtr<UObject> WeakOwner;
|
|
|
| FLoadedGameplayTagToProcessData() {}
|
| FLoadedGameplayTagToProcessData(const FGameplayTag& InTag, const TWeakObjectPtr<UObject>& InWeakOwner) : Tag(InTag), WeakOwner(InWeakOwner) {}
|
| };
|
|
|
| private:
|
|
|
| UPROPERTY(transient)
|
| TSet<TObjectPtr<UClass>> PreloadedCues;
|
| TMap<FObjectKey, TSet<FObjectKey>> PreloadedCueReferencers;
|
|
|
|
|
| UPROPERTY(transient)
|
| TSet<TObjectPtr<UClass>> AlwaysLoadedCues;
|
|
|
| TArray<FLoadedGameplayTagToProcessData> LoadedGameplayTagsToProcess;
|
| FCriticalSection LoadedGameplayTagsToProcessCS;
|
| bool bProcessLoadedTagsAfterGC = false;
|
| };
|
|
|