// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "GameplayTagContainer.h" #include "UObject/SoftObjectPath.h" #include "UObject/WeakObjectPtr.h" #include "LyraContextEffectsLibrary.generated.h" #define UE_API LYRAGAME_API class UNiagaraSystem; class USoundBase; struct FFrame; /** * */ UENUM() enum class EContextEffectsLibraryLoadState : uint8 { Unloaded = 0, Loading = 1, Loaded = 2 }; /** * */ USTRUCT(BlueprintType) struct FLyraContextEffects { GENERATED_BODY() UPROPERTY(EditAnywhere, BlueprintReadOnly) FGameplayTag EffectTag; UPROPERTY(EditAnywhere, BlueprintReadOnly) FGameplayTagContainer Context; UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowedClasses = "/Script/Engine.SoundBase, /Script/Niagara.NiagaraSystem")) TArray Effects; }; /** * */ UCLASS(MinimalAPI) class 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(MinimalAPI, BlueprintType) class ULyraContextEffectsLibrary : public UObject { GENERATED_BODY() public: UPROPERTY(EditAnywhere, BlueprintReadOnly) TArray ContextEffects; UFUNCTION(BlueprintCallable) UE_API void GetEffects(const FGameplayTag Effect, const FGameplayTagContainer Context, TArray& Sounds, TArray& NiagaraSystems); UFUNCTION(BlueprintCallable) UE_API void LoadEffects(); UE_API EContextEffectsLibraryLoadState GetContextEffectsLibraryLoadState(); private: void LoadEffectsInternal(); void LyraContextEffectLibraryLoadingComplete(TArray LyraActiveContextEffects); UPROPERTY(Transient) TArray< TObjectPtr> ActiveContextEffects; UPROPERTY(Transient) EContextEffectsLibraryLoadState EffectsLoadState = EContextEffectsLibraryLoadState::Unloaded; }; #undef UE_API