// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "UObject/SoftObjectPath.h" #include "GameplayTagContainer.h" #include "LyraContextEffectsLibrary.generated.h" class USoundBase; class UNiagaraSystem; /** * */ UENUM() enum class EContextEffectsLibraryLoadState : uint8 { Unloaded = 0, Loading = 1, Loaded = 2 }; /** * */ USTRUCT(BlueprintType) struct LYRAGAME_API FLyraContextEffects { GENERATED_BODY() UPROPERTY(EditAnywhere, BlueprintReadOnly) FGameplayTag EffectTag; UPROPERTY(EditAnywhere, BlueprintReadOnly) FGameplayTagContainer Context; UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowedClasses = "SoundBase, NiagaraSystem")) TArray Effects; }; /** * */ UCLASS() class LYRAGAME_API ULyraActiveContextEffects : public UObject { GENERATED_BODY() public: UPROPERTY(VisibleAnywhere) FGameplayTag EffectTag; UPROPERTY(VisibleAnywhere) FGameplayTagContainer Context; UPROPERTY(VisibleAnywhere) TArray Sounds; UPROPERTY(VisibleAnywhere) TArray NiagaraSystems; }; DECLARE_DYNAMIC_DELEGATE_OneParam(FLyraContextEffectLibraryLoadingComplete, TArray, LyraActiveContextEffects); /** * */ UCLASS(BlueprintType) class LYRAGAME_API ULyraContextEffectsLibrary : public UObject { GENERATED_BODY() public: UPROPERTY(EditAnywhere, BlueprintReadOnly) TArray ContextEffects; UFUNCTION(BlueprintCallable) void GetEffects(const FGameplayTag Effect, const FGameplayTagContainer Context, TArray& Sounds, TArray& NiagaraSystems); UFUNCTION(BlueprintCallable) void LoadEffects(); EContextEffectsLibraryLoadState GetContextEffectsLibraryLoadState(); private: void LoadEffectsInternal(); void LyraContextEffectLibraryLoadingComplete(TArray LyraActiveContextEffects); UPROPERTY(Transient) TArray< ULyraActiveContextEffects*> ActiveContextEffects; UPROPERTY(Transient) EContextEffectsLibraryLoadState EffectsLoadState = EContextEffectsLibraryLoadState::Unloaded; };