Updated DialogueNPC to Add Ids for Dialogue Paths
This commit is contained in:
parent
d1fab9f9a1
commit
9bfb07fbba
@ -106,11 +106,34 @@ void UDialogueNPC::EndDialogue()
|
||||
PlayerController->bShowMouseCursor = false;
|
||||
}
|
||||
|
||||
TArray<FString> UDialogueNPC::AddDialogue(FText TextInput, TArray<FString> DialogueArrayInput)
|
||||
FDialoguePath UDialogueNPC::CreateRootDialoguePath()
|
||||
{
|
||||
if (TextInput.IsEmpty()) return DialogueArrayInput;
|
||||
DialogueArrayInput.Add(TextInput.ToString());
|
||||
return DialogueArrayInput;
|
||||
return FDialoguePath();
|
||||
}
|
||||
|
||||
FDialoguePath UDialogueNPC::CreateDialoguePath(FDialoguePath ParentDialoguePath)
|
||||
{
|
||||
return FDialoguePath("#" + FString::FromInt(DialoguePaths.Num()));
|
||||
}
|
||||
|
||||
bool UDialogueNPC::GotoDialoguePath(FString PathId)
|
||||
{
|
||||
for each (FDialoguePath DialogPath in DialoguePaths)
|
||||
{
|
||||
if (DialogPath.Dialogue[0] == PathId)
|
||||
{
|
||||
CurrentDialoguePath = DialogPath.Dialogue;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
FDialoguePath UDialogueNPC::AddDialogue(FText TextInput, FDialoguePath DialoguePath)
|
||||
{
|
||||
if (TextInput.IsEmpty()) return DialoguePath;
|
||||
DialoguePath.Dialogue.Add(TextInput.ToString());
|
||||
return DialoguePath;
|
||||
}
|
||||
|
||||
void UDialogueNPC::GetFinalDialogue(TArray<FString> DialogueArray)
|
||||
|
@ -24,7 +24,17 @@ struct FDialoguePath
|
||||
UPROPERTY()
|
||||
TArray<FString> Dialogue;
|
||||
|
||||
explicit FDialoguePath(const TArray<FString> Dialogue)
|
||||
FDialoguePath()
|
||||
{
|
||||
Dialogue.Add("#ROOT");
|
||||
}
|
||||
|
||||
FDialoguePath(FString Id)
|
||||
{
|
||||
Dialogue.Add(Id);
|
||||
}
|
||||
|
||||
explicit FDialoguePath(TArray<FString> Dialogue)
|
||||
{
|
||||
this->Dialogue = Dialogue;
|
||||
}
|
||||
@ -91,7 +101,19 @@ public:
|
||||
void EndDialogue();
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
TArray<FString> AddDialogue(FText TextInput, TArray<FString> DialogueArrayInput);
|
||||
FDialoguePath CreateRootDialoguePath();
|
||||
|
||||
UFUNCTION()
|
||||
FDialoguePath CreateDialoguePath(FDialoguePath ParentDialoguePath);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
void CreateDialogueChoice(FDialoguePath PreviousDialoguePath);
|
||||
|
||||
UFUNCTION()
|
||||
bool GotoDialoguePath(FString PathId);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
FDialoguePath AddDialogue(FText TextInput, FDialoguePath DialoguePath);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void GetFinalDialogue(TArray<FString> DialogueArray);
|
||||
|
Loading…
Reference in New Issue
Block a user