Files
ProjectEleri/Source/ProjectEleri/GameEventSystem/GameEventDataAsset.h

99 lines
2.9 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "GameplayTagContainer.h"
#include "GameEventRequirements.h"
#include "ProjectEleri/System/TimeOfDayStruct.h"
#include "StructUtils/InstancedStruct.h"
#include "GameEventDataAsset.generated.h"
class UTexture2D;
class USoundBase;
UENUM(BlueprintType)
enum class EEventStage : uint8
{
NONE,
STARTED,
COMPLETED
};
UENUM(BlueprintType)
enum class EEventRepeatType : uint8
{
NONE,
YEARLY,
MONTHLY,
WEEKLY,
DAILY,
MAX
};
USTRUCT(BlueprintType)
struct FTagValue
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
FGameplayTagContainer TagContainer;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
float Value = 0.f;
};
/**
*
*/
UCLASS(BlueprintType)
class PROJECTELERI_API UGameEventDataAsset : public UDataAsset
{
GENERATED_BODY()
public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info", meta = (GameplayTagFilter = "GameEvents"))
FGameplayTag EventTag;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "UI")
FText EventName;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "UI")
TSoftObjectPtr<UTexture2D> EventIcon;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
FTimeOfDayData StartDate;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
FTimeOfDayData EventDuration;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
EEventRepeatType EventRepeat;
UPROPERTY(EditAnywhere, Category = "Info", meta=(ExcludeBaseStruct, BaseStruct="/Script/ProjectEleri.GameEventRequirement"))
TArray<FInstancedStruct> Requirements;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Data")
TArray<FTagValue> TagValueArray;
/** Soundtracks this event can put on. One is drawn at random and crossfaded in over whatever is
* playing already, and it holds the music until the override is cleared. An event with none
* leaves the music alone, which is what most of them will do. */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Audio")
TSoftObjectPtr<USoundBase> MusicCue;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Newspaper event")
bool bIsNewspaperEvent;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Newspaper event", meta = (EditCondition = "bIsNewspaperEvent", EditConditionHides))
FText EventDescription;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Newspaper event", meta = (EditCondition = "bIsNewspaperEvent", EditConditionHides))
int32 AutoTriggerOnDay;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Calendar event")
bool bShowOnCalendar;
bool CanStartEvent(const UObject* ContextObj) const;
};