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;
|
PlayerController->bShowMouseCursor = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<FString> UDialogueNPC::AddDialogue(FText TextInput, TArray<FString> DialogueArrayInput)
|
FDialoguePath UDialogueNPC::CreateRootDialoguePath()
|
||||||
{
|
{
|
||||||
if (TextInput.IsEmpty()) return DialogueArrayInput;
|
return FDialoguePath();
|
||||||
DialogueArrayInput.Add(TextInput.ToString());
|
}
|
||||||
return DialogueArrayInput;
|
|
||||||
|
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)
|
void UDialogueNPC::GetFinalDialogue(TArray<FString> DialogueArray)
|
||||||
|
@ -24,7 +24,17 @@ struct FDialoguePath
|
|||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
TArray<FString> Dialogue;
|
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;
|
this->Dialogue = Dialogue;
|
||||||
}
|
}
|
||||||
@ -91,7 +101,19 @@ public:
|
|||||||
void EndDialogue();
|
void EndDialogue();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
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)
|
UFUNCTION(BlueprintCallable)
|
||||||
void GetFinalDialogue(TArray<FString> DialogueArray);
|
void GetFinalDialogue(TArray<FString> DialogueArray);
|
||||||
|
Loading…
Reference in New Issue
Block a user