5#include "CoreMinimal.h"
6#include "Engine/DataAsset.h"
8#include "StoryManager.generated.h"
19 UPROPERTY(BlueprintReadWrite, EditAnywhere)
21 UPROPERTY(BlueprintReadWrite, EditAnywhere)
32 UPROPERTY(BlueprintReadWrite, EditAnywhere)
34 UPROPERTY(BlueprintReadWrite, EditAnywhere)
43 UPROPERTY(BlueprintReadWrite)
45 UPROPERTY(BlueprintReadWrite)
55 UPROPERTY(EditAnywhere, BlueprintReadWrite)
56 TArray<FStepData> StepData;
64 UPROPERTY(EditAnywhere, BlueprintReadWrite)
65 TSubclassOf<
AActor> InteractiveObject;
66 UPROPERTY(EditAnywhere, BlueprintReadWrite)
67 TArray<FText> StorySteps;
68 UPROPERTY(EditAnywhere, BlueprintReadWrite)
69 TArray<FText> HighlightSteps;
77 UPROPERTY(EditAnywhere, BlueprintReadWrite)
78 TArray<FInteractiveObjectData> InteractiveObjectData;
88 UPROPERTY(BlueprintReadWrite)
89 TArray<UStoryData*> DynamicStoryData;
91 UPROPERTY(BlueprintReadWrite)
92 TArray<UStoryScriptClassData*> StoryScripts;
94 UPROPERTY(BlueprintReadWrite)
95 TArray<UInteractiveObjectDataBase*> InteractiveObjectData;
121 UPROPERTY(EditAnywhere, BlueprintReadWrite)
122 TArray<UStoryData*> StoryDataArray;
123 UPROPERTY(BlueprintReadWrite)
124 TArray<FPassedExperiences> PassedExperiencesArray;
126 UPROPERTY(BlueprintReadWrite, Replicated)
129 UPROPERTY(BlueprintReadWrite, Replicated)
131 UPROPERTY(BlueprintReadWrite, Replicated)
133 UPROPERTY(BlueprintReadWrite, Replicated)
135 UPROPERTY(BlueprintReadWrite, Replicated)
137 UPROPERTY(BlueprintReadWrite, Replicated)
140 UPROPERTY(BlueprintReadWrite, Replicated)
143 UPROPERTY(EditAnywhere, BlueprintReadWrite)
146 UPROPERTY(BlueprintReadOnly)
147 bool StoryFinished = true;
149 UPROPERTY(EditInstanceOnly, Category = "StoryManager|Properties")
150 bool IsAutoSwitchingToNextStoryActive = false;
157 UFUNCTION(BlueprintCallable)
158 bool InitNewStory(
int newStoryIndex);
160 UFUNCTION(BlueprintCallable)
162 UFUNCTION(BlueprintCallable)
163 bool GoToNextSubStep();
164 UFUNCTION(BlueprintCallable)
166 UFUNCTION(BlueprintCallable)
167 bool JumpToStepByIndex(
int index);
168 UFUNCTION(BlueprintCallable)
169 bool JumpToStepByName(FText stepId);
171 UFUNCTION(BlueprintCallable)
172 void StepCompleted(FText stepToUpdate,
bool goToNext = true);
178 UFUNCTION(BlueprintCallable)
179 static
void SetupNextStory(
int newNextStoryIndex, TArray<FText> newStoryParameters);
181 UFUNCTION(BlueprintCallable)
182 static
int GetNextStoryIndex() {
return NextStoryIndex; }
184 UFUNCTION(BlueprintCallable)
185 static TArray<FText> GetStoryParameters() {
return StoryParameters; }
187 UFUNCTION(BlueprintCallable)
188 static bool IsSpecificParametersExist(TArray<FText> SpecificParameters);
191 UFUNCTION(BlueprintCallable, Category =
"StoryManager|Misc")
192 float GetCurrentStepDuration() const;
196 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
197 FOnNewStep OnNewStep;
198 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
199 FOnNewSubStep OnNewSubStep;
200 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
201 FOnStepCompleted OnStepCompleted;
202 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
203 FOnRecordStepScore OnRecordStepScore;
204 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
205 FOnStoryLoaded OnStoryLoaded;
206 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
207 FOnEndOfStory OnEndOfStory;
208 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
209 FOnStepSkipped OnStepSkipped;
213 bool IsAllSubStepsCompleted();
220 void RecordStoryStepData();
222 UPROPERTY(BlueprintReadWrite, Replicated)
225 static
int NextStoryIndex;
226 static TArray<FText> StoryParameters;
228 virtual
void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
234 FDateTime StepStartingTime;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnActorStopped, ABaseGrippableStoryActor *, GrippableStoryActor)
#define DECLARE_EVENT_HANDLER(TEvent)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FLaserBeamActivated, APixoVRLaser *, Laser, bool, bActivated)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStoryLoaded)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnNewStep, FStoryStep, newStep, bool, isForward)
DECLARE_LOG_CATEGORY_EXTERN(LogStoryManager, Log, All)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnNewSubStep, FStoryStep, newSubStep)
It provides functionalities for handling events, sending events, and managing a private owner....
Event called when we on init experience.
TArray< FInteractiveObjectData > InteractiveObjectData
UPROPERTY(EditAnywhere, BlueprintReadWrite)
A component responsible for managing the story progression in story actors.
TArray< FStepData > StepData
UPROPERTY(EditAnywhere, BlueprintReadWrite)
Manager that provides handling story-related operations and data.
DECLARE_EVENT_HANDLER(UInitializationEvent)
static int GetNextStoryIndex()
UFUNCTION(BlueprintCallable)
FOnStepSkipped OnStepSkipped
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
TArray< UStoryComponent * > StoryComponents
UPROPERTY()
FOnNewStep OnNewStep
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
FStoryStep PreviousStep
UPROPERTY(BlueprintReadWrite, Replicated)
UStoryData * StoryData
UPROPERTY(BlueprintReadWrite, Replicated)
TArray< FPassedExperiences > PassedExperiencesArray
UPROPERTY(BlueprintReadWrite)
FStoryStep CurrentSubStep
UPROPERTY(BlueprintReadWrite, Replicated)
int StepIndex
UPROPERTY(BlueprintReadWrite, Replicated)
FOnStoryLoaded OnStoryLoaded
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
int SubStepIndex
UPROPERTY(BlueprintReadWrite, Replicated)
static TArray< FText > StoryParameters
bool BlockStory
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray< UStoryData * > StoryDataArray
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FOnRecordStepScore OnRecordStepScore
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
static TArray< FText > GetStoryParameters()
UFUNCTION(BlueprintCallable)
TArray< FStepData > StepData
UPROPERTY(BlueprintReadWrite, Replicated)
FOnStepCompleted OnStepCompleted
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
FOnNewSubStep OnNewSubStep
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
static int NextStoryIndex
Keeps track of which story should be loaded next by index, saved between levels.
FStoryStep CurrentStep
UPROPERTY(BlueprintReadWrite, Replicated)
FOnEndOfStory OnEndOfStory
UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
FDateTime StepStartingTime
Data asset class for storing story script class data.
TArray< UStoryData * > DynamicStoryData
UPROPERTY(BlueprintReadWrite)
TArray< UStoryScriptClassData * > StoryScripts
UPROPERTY(BlueprintReadWrite)
TArray< UInteractiveObjectDataBase * > InteractiveObjectData
UPROPERTY(BlueprintReadWrite)
TSubclassOf< AActor > InteractiveObject
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray< FText > StorySteps
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray< FText > HighlightSteps
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 StoryIndex
UPROPERTY(BlueprintReadWrite)
TArray< FStepData > PassedStepData
UPROPERTY(BlueprintReadWrite)
TArray< FStoryStep > SubStep
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FStoryStep Step
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FText StepName
UPROPERTY(BlueprintReadWrite, EditAnywhere)
bool Completed
UPROPERTY(BlueprintReadWrite, EditAnywhere)