2026-07-11 10:43:52 +02:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "GameFramework/SaveGame.h"
|
|
|
|
|
#include "ProjectEleri/DialogueSystem/OrderManager.h"
|
|
|
|
|
#include "ProjectEleri/DialogueSystem/QuestDatabase.h"
|
|
|
|
|
#include "BookOfAlchemyManager.h"
|
|
|
|
|
#include "InventoryComponent.h"
|
|
|
|
|
#include "../System/Subsystem/ObjectPersistenceSubsystem.h"
|
|
|
|
|
#include "Interface/SaveableObjectInterface.h"
|
|
|
|
|
#include "ProjectEleri/GameEventSystem/GameEventSubsystem.h"
|
2026-07-16 22:24:27 +02:00
|
|
|
#include "Data/GameplayStatEffect.h"
|
|
|
|
|
#include "Data/StatForgeDefs.h"
|
2026-07-11 10:43:52 +02:00
|
|
|
#include "ProjectEleri/System/TimeOfDayStruct.h"
|
|
|
|
|
#include "EleriSaveGame.generated.h"
|
|
|
|
|
|
|
|
|
|
USTRUCT()
|
2026-07-16 22:24:27 +02:00
|
|
|
struct FActiveGameplayStatEffect_SerializedData {
|
2026-07-11 10:43:52 +02:00
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
2026-07-16 22:24:27 +02:00
|
|
|
TSubclassOf<UGameplayStatEffect> GameplayEffectClass;
|
|
|
|
|
|
2026-07-11 10:43:52 +02:00
|
|
|
UPROPERTY()
|
2026-07-16 22:24:27 +02:00
|
|
|
TMap<FName, float> DataValueMap;
|
|
|
|
|
|
2026-07-11 10:43:52 +02:00
|
|
|
UPROPERTY()
|
|
|
|
|
int32 StackCount = 1;
|
2026-07-16 22:24:27 +02:00
|
|
|
|
2026-07-11 10:43:52 +02:00
|
|
|
UPROPERTY()
|
2026-07-16 22:24:27 +02:00
|
|
|
float RemainingDuration = -1.f;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
float NextTickDuration = -1.f;
|
2026-07-11 10:43:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
USTRUCT(BlueprintType)
|
|
|
|
|
struct FSaveData {
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FTimeOfDayData TimeOfDay;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
TArray<FBookProgressionInfo> BookProgression;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
TMap<FName, FInventorySaveData> InventoryData;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
|
|
|
|
|
TArray<FQuestItem> QuestList;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Seeds")
|
|
|
|
|
TArray<FSeedSaveData> PlantedSeedsList;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Placed Objects")
|
|
|
|
|
TArray<FPlaceableActorInfo> PlacedActors;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
TMap<FGuid, FActorSaveData> ActorSaveData;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
TMap<FSoftObjectPath, FEventData> EventDataMap;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FTransform PlayerTransform;
|
2026-07-16 22:24:27 +02:00
|
|
|
|
2026-07-11 10:43:52 +02:00
|
|
|
UPROPERTY()
|
2026-07-16 22:24:27 +02:00
|
|
|
TArray<FActiveGameplayStatEffect_SerializedData> GameEffects;
|
2026-07-11 10:43:52 +02:00
|
|
|
UPROPERTY()
|
2026-07-16 22:24:27 +02:00
|
|
|
TArray<FStatRuntimeDef> StatData;
|
2026-07-11 10:43:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void Initialize();
|
|
|
|
|
void SaveQuests(const TArray<FQuestItem>& Quests);
|
|
|
|
|
void SetTimeOFDayData(int32 _Day, int32 _Month, int32 _Year, int32 _Minute, int32 _Hour);
|
|
|
|
|
void SetBookProgressionData(TArray<FBookProgressionInfo> _BookProgression);
|
|
|
|
|
void SetInventoryDataForActor(AActor* Actor, UInventoryComponent* Inventory);
|
|
|
|
|
void SetPlantedSeedData(FName ActorId, FSeedSaveData SeedSaveData);
|
|
|
|
|
void SetPlacedObjectsData(TArray<FPlaceableActorInfo> InPlacedActors);
|
|
|
|
|
void CollectSaveableActorsData(const UWorld* World);
|
|
|
|
|
void SetGameEventData(const UWorld* World);
|
|
|
|
|
void SetPlayerData(const UWorld* World);
|
|
|
|
|
void SetAbilitySystemData(const UWorld* World);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
UCLASS()
|
|
|
|
|
class PROJECTELERI_API UEleriSaveGame : public USaveGame
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
|
|
|
FSaveData SaveData;
|
|
|
|
|
|
|
|
|
|
};
|