Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
UStoryManager Class ReferenceBlueprintable

Manager that provides handling story-related operations and data. More...

#include <StoryManager.h>

Inheritance diagram for UStoryManager:
[legend]

Public Member Functions

 UStoryManager ()
 
void AddStoryComponent (UStoryComponent *storyComponent)
 
void CompleteSubStep (FStoryStep completedStep)
 UFUNCTION(BlueprintCallable)
 
 DECLARE_EVENT_HANDLER (UInitializationEvent)
 
float GetCurrentStepDuration () const
 UFUNCTION(BlueprintCallable, Category = "StoryManager|Misc")
 
APlayerController * GetPrivateOwner () const
 
bool GoToNextStep ()
 UFUNCTION(BlueprintCallable)
 
bool GoToNextSubStep ()
 UFUNCTION(BlueprintCallable)
 
void HandleEvent (UBaseEvent *Event)
 
bool InitNewStory (int newStoryIndex)
 Choose one story from StoryDataArray.
 
bool JumpToStepByIndex (int index)
 UFUNCTION(BlueprintCallable)
 
bool JumpToStepByName (FText stepId)
 UFUNCTION(BlueprintCallable)
 
template<typename TEventType , typename... TInitializeArgs>
void SendEvent (TInitializeArgs... Arguments)
 
void SetPrivateOwner (APlayerController *Owner)
 
void StepCompleted (FText stepToUpdate, bool goToNext=true)
 UFUNCTION(BlueprintCallable)
 

Static Public Member Functions

static int GetNextStoryIndex ()
 UFUNCTION(BlueprintCallable)
 
static TArray< FText > GetStoryParameters ()
 UFUNCTION(BlueprintCallable)
 
static bool IsSpecificParametersExist (TArray< FText > SpecificParameters)
 UFUNCTION(BlueprintCallable)
 
static void SetupNextStory (int newNextStoryIndex, TArray< FText > newStoryParameters)
 UFUNCTION(BlueprintCallable)
 

Public Attributes

bool BlockStory
 UPROPERTY(EditAnywhere, BlueprintReadWrite)
 
FStoryStep CurrentStep
 UPROPERTY(BlueprintReadWrite, Replicated)
 
FStoryStep CurrentSubStep
 UPROPERTY(BlueprintReadWrite, Replicated)
 
bool IsAutoSwitchingToNextStoryActive = false
 UPROPERTY(EditInstanceOnly, Category = "StoryManager|Properties")
 
FOnEndOfStory OnEndOfStory
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
FOnNewStep OnNewStep
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
FOnNewSubStep OnNewSubStep
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
FOnRecordStepScore OnRecordStepScore
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
FOnStepCompleted OnStepCompleted
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
FOnStepSkipped OnStepSkipped
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
FOnStoryLoaded OnStoryLoaded
 UPROPERTY(BlueprintAssignable, Category = "Story Delegate")
 
TArray< FPassedExperiencesPassedExperiencesArray
 UPROPERTY(BlueprintReadWrite)
 
FStoryStep PreviousStep
 UPROPERTY(BlueprintReadWrite, Replicated)
 
TArray< FStepDataStepData
 UPROPERTY(BlueprintReadWrite, Replicated)
 
int StepIndex
 UPROPERTY(BlueprintReadWrite, Replicated)
 
TArray< UStoryData * > StoryDataArray
 UPROPERTY(EditAnywhere, BlueprintReadWrite)
 
bool StoryFinished = true
 UPROPERTY(BlueprintReadOnly)
 
int StoryIndex = -1
 UPROPERTY(BlueprintReadWrite, Replicated)
 
int SubStepIndex
 UPROPERTY(BlueprintReadWrite, Replicated)
 

Protected Member Functions

virtual void GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override
 
void HandleEvent_Impl (class UBaseEvent *Event)
 
bool IsAllSubStepsCompleted ()
 UFUNCTION()
 
void RecordStoryStepData ()
 Records the data for a story step. It checks if the story is already present in the PassedExperiencesArray and updates the step data if it exists. Otherwise, it creates a new entry in the array with the step data and the story index.
 

Protected Attributes

THandlers Handlers
 
UStoryDataStoryData
 UPROPERTY(BlueprintReadWrite, Replicated)
 

Static Protected Attributes

static int NextStoryIndex = 0
 Keeps track of which story should be loaded next by index, saved between levels.
 
static TArray< FText > StoryParameters
 

Private Types

using THandler = TFunction<void(UBaseEvent*)>
 
using THandlerKey = UClass*
 
using THandlers = std::unordered_map<THandlerKey, THandler, THandlerHash, THandlerComp>
 

Private Member Functions

 GENERATED_BODY ()
 

Private Attributes

APlayerController * PrivateOwner
 UPROPERTY()
 
FDateTime StepStartingTime
 
TArray< UStoryComponent * > StoryComponents
 UPROPERTY()
 

Detailed Description

Manager that provides handling story-related operations and data.

UCLASS(Blueprintable)

Definition at line 183 of file StoryManager.h.

Member Typedef Documentation

◆ THandler

using UBaseManager::THandler = TFunction<void(UBaseEvent*)>
privateinherited

Definition at line 56 of file BaseManager.h.

◆ THandlerKey

using UBaseManager::THandlerKey = UClass*
privateinherited

Definition at line 55 of file BaseManager.h.

◆ THandlers

using UBaseManager::THandlers = std::unordered_map<THandlerKey, THandler, THandlerHash, THandlerComp>
privateinherited

Definition at line 74 of file BaseManager.h.

Constructor & Destructor Documentation

◆ UStoryManager()

UStoryManager::UStoryManager ( )

Definition at line 22 of file StoryManager.cpp.

Member Function Documentation

◆ AddStoryComponent()

void UStoryManager::AddStoryComponent ( UStoryComponent * storyComponent)

Definition at line 299 of file StoryManager.cpp.

◆ CompleteSubStep()

void UStoryManager::CompleteSubStep ( FStoryStep completedStep)
BlueprintCallable

UFUNCTION(BlueprintCallable)

Call this functions when all sub-steps are activated in the step and could be completed in different order.

Definition at line 139 of file StoryManager.cpp.

Here is the call graph for this function:

◆ DECLARE_EVENT_HANDLER()

UStoryManager::DECLARE_EVENT_HANDLER ( UInitializationEvent )

◆ GENERATED_BODY()

UStoryManager::GENERATED_BODY ( )
private

◆ GetCurrentStepDuration()

float UStoryManager::GetCurrentStepDuration ( ) const
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "StoryManager|Misc")

Definition at line 329 of file StoryManager.cpp.

◆ GetLifetimeReplicatedProps()

void UStoryManager::GetLifetimeReplicatedProps ( TArray< FLifetimeProperty > & OutLifetimeProps) const
overrideprotectedvirtual

Definition at line 377 of file StoryManager.cpp.

◆ GetNextStoryIndex()

static int UStoryManager::GetNextStoryIndex ( )
inlinestaticBlueprintCallable

UFUNCTION(BlueprintCallable)

Definition at line 327 of file StoryManager.h.

◆ GetPrivateOwner()

APlayerController * UBaseManager::GetPrivateOwner ( ) const
inlineinherited

Definition at line 47 of file BaseManager.h.

Here is the caller graph for this function:

◆ GetStoryParameters()

static TArray< FText > UStoryManager::GetStoryParameters ( )
inlinestaticBlueprintCallable

UFUNCTION(BlueprintCallable)

Definition at line 333 of file StoryManager.h.

◆ GoToNextStep()

bool UStoryManager::GoToNextStep ( )
BlueprintCallable

UFUNCTION(BlueprintCallable)

Returns false if current step is last.

Definition at line 74 of file StoryManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GoToNextSubStep()

bool UStoryManager::GoToNextSubStep ( )
BlueprintCallable

UFUNCTION(BlueprintCallable)

Returns false if current step is last.

Definition at line 113 of file StoryManager.cpp.

Here is the call graph for this function:

◆ HandleEvent()

void UBaseManager::HandleEvent ( UBaseEvent * Event)
inherited

Definition at line 11 of file BaseManager.cpp.

◆ HandleEvent_Impl()

void UBaseManager::HandleEvent_Impl ( class UBaseEvent * Event)
protectedinherited

Definition at line 24 of file BaseManager.cpp.

◆ InitNewStory()

bool UStoryManager::InitNewStory ( int newStoryIndex)
BlueprintCallable

Choose one story from StoryDataArray.

Parameters
newStoryIndexStory to load.
Returns
true if init was successful.

UFUNCTION(BlueprintCallable)

Definition at line 27 of file StoryManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAllSubStepsCompleted()

bool UStoryManager::IsAllSubStepsCompleted ( )
protected

UFUNCTION()

Definition at line 334 of file StoryManager.cpp.

Here is the caller graph for this function:

◆ IsSpecificParametersExist()

bool UStoryManager::IsSpecificParametersExist ( TArray< FText > SpecificParameters)
staticBlueprintCallable

UFUNCTION(BlueprintCallable)

Definition at line 310 of file StoryManager.cpp.

◆ JumpToStepByIndex()

bool UStoryManager::JumpToStepByIndex ( int index)
BlueprintCallable

UFUNCTION(BlueprintCallable)

Returns false if jump failed.

Definition at line 160 of file StoryManager.cpp.

Here is the call graph for this function:

◆ JumpToStepByName()

bool UStoryManager::JumpToStepByName ( FText stepId)
BlueprintCallable

UFUNCTION(BlueprintCallable)

Returns false if jump failed.

Definition at line 211 of file StoryManager.cpp.

Here is the call graph for this function:

◆ RecordStoryStepData()

void UStoryManager::RecordStoryStepData ( )
protected

Records the data for a story step. It checks if the story is already present in the PassedExperiencesArray and updates the step data if it exists. Otherwise, it creates a new entry in the array with the step data and the story index.

UFUNCTION()

Definition at line 352 of file StoryManager.cpp.

Here is the caller graph for this function:

◆ SendEvent()

template<typename TEventType , typename... TInitializeArgs>
void UBaseManager::SendEvent ( TInitializeArgs... Arguments)
inlineinherited

Definition at line 40 of file BaseManager.h.

Here is the call graph for this function:

◆ SetPrivateOwner()

void UBaseManager::SetPrivateOwner ( APlayerController * Owner)
inlineinherited

Definition at line 46 of file BaseManager.h.

◆ SetupNextStory()

void UStoryManager::SetupNextStory ( int newNextStoryIndex,
TArray< FText > newStoryParameters )
staticBlueprintCallable

UFUNCTION(BlueprintCallable)

Definition at line 304 of file StoryManager.cpp.

◆ StepCompleted()

void UStoryManager::StepCompleted ( FText stepToUpdate,
bool goToNext = true )
BlueprintCallable

UFUNCTION(BlueprintCallable)

Called when step is completed. If stepToJump is empty, you will go to next step, else you will try to jump to step, which you typed in.

Definition at line 275 of file StoryManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ BlockStory

bool UStoryManager::BlockStory
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite)

Definition at line 256 of file StoryManager.h.

◆ CurrentStep

FStoryStep UStoryManager::CurrentStep
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Definition at line 218 of file StoryManager.h.

◆ CurrentSubStep

FStoryStep UStoryManager::CurrentSubStep
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Definition at line 224 of file StoryManager.h.

◆ Handlers

THandlers UBaseManager::Handlers
protectedinherited

Definition at line 77 of file BaseManager.h.

◆ IsAutoSwitchingToNextStoryActive

bool UStoryManager::IsAutoSwitchingToNextStoryActive = false
EditInstanceOnly

UPROPERTY(EditInstanceOnly, Category = "StoryManager|Properties")

Definition at line 268 of file StoryManager.h.

◆ NextStoryIndex

int UStoryManager::NextStoryIndex = 0
staticprotected

Keeps track of which story should be loaded next by index, saved between levels.

Definition at line 408 of file StoryManager.h.

◆ OnEndOfStory

FOnEndOfStory UStoryManager::OnEndOfStory
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when the story ends.

Definition at line 379 of file StoryManager.h.

◆ OnNewStep

FOnNewStep UStoryManager::OnNewStep
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when a new step is reached.

Definition at line 354 of file StoryManager.h.

◆ OnNewSubStep

FOnNewSubStep UStoryManager::OnNewSubStep
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when a new sub-step is reached.

Definition at line 359 of file StoryManager.h.

◆ OnRecordStepScore

FOnRecordStepScore UStoryManager::OnRecordStepScore
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when a step score is recorded.

Definition at line 369 of file StoryManager.h.

◆ OnStepCompleted

FOnStepCompleted UStoryManager::OnStepCompleted
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when a step is completed.

Definition at line 364 of file StoryManager.h.

◆ OnStepSkipped

FOnStepSkipped UStoryManager::OnStepSkipped
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when a step is skipped.

Definition at line 384 of file StoryManager.h.

◆ OnStoryLoaded

FOnStoryLoaded UStoryManager::OnStoryLoaded
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "Story Delegate")

Delegate for the event when a story is loaded.

Definition at line 374 of file StoryManager.h.

◆ PassedExperiencesArray

TArray<FPassedExperiences> UStoryManager::PassedExperiencesArray
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite)

Definition at line 204 of file StoryManager.h.

◆ PreviousStep

FStoryStep UStoryManager::PreviousStep
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Definition at line 242 of file StoryManager.h.

◆ PrivateOwner

APlayerController* UBaseManager::PrivateOwner
privateinherited

UPROPERTY()

Definition at line 53 of file BaseManager.h.

◆ StepData

TArray<FStepData> UStoryManager::StepData
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Definition at line 211 of file StoryManager.h.

◆ StepIndex

int UStoryManager::StepIndex
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Definition at line 230 of file StoryManager.h.

◆ StepStartingTime

FDateTime UStoryManager::StepStartingTime
private

Definition at line 419 of file StoryManager.h.

◆ StoryComponents

TArray<UStoryComponent*> UStoryManager::StoryComponents
private

UPROPERTY()

Definition at line 417 of file StoryManager.h.

◆ StoryData

UStoryData* UStoryManager::StoryData
protectedBlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Current story

Definition at line 406 of file StoryManager.h.

◆ StoryDataArray

TArray<UStoryData*> UStoryManager::StoryDataArray
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite)

Definition at line 199 of file StoryManager.h.

◆ StoryFinished

bool UStoryManager::StoryFinished = true
BlueprintReadOnly

UPROPERTY(BlueprintReadOnly)

Definition at line 262 of file StoryManager.h.

◆ StoryIndex

int UStoryManager::StoryIndex = -1
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Keeps track of which story index is loaded

Definition at line 249 of file StoryManager.h.

◆ StoryParameters

TArray< FText > UStoryManager::StoryParameters
staticprotected

Definition at line 409 of file StoryManager.h.

◆ SubStepIndex

int UStoryManager::SubStepIndex
BlueprintReadWriteReplicated

UPROPERTY(BlueprintReadWrite, Replicated)

Definition at line 236 of file StoryManager.h.


The documentation for this class was generated from the following files: