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 "Containers/Array.h"
|
|
|
|
#include "Delegates/Delegate.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "GameplayTagContainer.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "HAL/Platform.h"
|
|
|
|
#include "UObject/Object.h"
|
|
|
|
#include "UObject/SoftObjectPath.h"
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
#include "UObject/WeakObjectPtr.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "LyraContextEffectsLibrary.generated.h"
|
|
|
|
|
|
|
|
class UNiagaraSystem;
|
2022-09-13 07:18:28 +00:00
|
|
|
class USoundBase;
|
|
|
|
struct FFrame;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
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<FSoftObjectPath> Effects;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
UCLASS()
|
|
|
|
class LYRAGAME_API ULyraActiveContextEffects : public UObject
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
|
|
|
FGameplayTag EffectTag;
|
|
|
|
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
|
|
|
FGameplayTagContainer Context;
|
|
|
|
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
2022-09-13 07:18:28 +00:00
|
|
|
TArray<TObjectPtr<USoundBase>> Sounds;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
2022-09-13 07:18:28 +00:00
|
|
|
TArray<TObjectPtr<UNiagaraSystem>> NiagaraSystems;
|
2022-05-23 18:41:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_DELEGATE_OneParam(FLyraContextEffectLibraryLoadingComplete, TArray<ULyraActiveContextEffects*>, LyraActiveContextEffects);
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
UCLASS(BlueprintType)
|
|
|
|
class LYRAGAME_API ULyraContextEffectsLibrary : public UObject
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
|
|
|
TArray<FLyraContextEffects> ContextEffects;
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void GetEffects(const FGameplayTag Effect, const FGameplayTagContainer Context, TArray<USoundBase*>& Sounds, TArray<UNiagaraSystem*>& NiagaraSystems);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void LoadEffects();
|
|
|
|
|
|
|
|
EContextEffectsLibraryLoadState GetContextEffectsLibraryLoadState();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void LoadEffectsInternal();
|
|
|
|
|
|
|
|
void LyraContextEffectLibraryLoadingComplete(TArray<ULyraActiveContextEffects*> LyraActiveContextEffects);
|
|
|
|
|
|
|
|
UPROPERTY(Transient)
|
2022-09-13 07:18:28 +00:00
|
|
|
TArray< TObjectPtr<ULyraActiveContextEffects>> ActiveContextEffects;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
UPROPERTY(Transient)
|
|
|
|
EContextEffectsLibraryLoadState EffectsLoadState = EContextEffectsLibraryLoadState::Unloaded;
|
|
|
|
};
|