Bugfix Dialogue Voice Overs for More Text Edge Cases

This commit is contained in:
Philip W 2024-05-12 15:36:32 +01:00
parent dae45d306d
commit 4142af94bd

View File

@ -96,8 +96,11 @@ void UAC_PlayerDialogueInterpreter::NextDialogue()
CurrentTextNode = Cast<UDialogueTextNode>(CurrentTextNode->ChildrenNodes[0]);
CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking);
OnNextDialogue.Broadcast(CurrentTextNode);
if (IsValid(CurrentTextNode->DialogueVoiceOver))
{
CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D(
GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false);
}
CurrentChoiceNode = nullptr;
CurrentAddItemNode = nullptr;
}
@ -129,6 +132,11 @@ void UAC_PlayerDialogueInterpreter::NextDialogue()
CurrentTextNode = Cast<UDialogueTextNode>(CurrentAddItemNode->ChildrenNodes[0]);
CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking);
OnNextDialogue.Broadcast(CurrentTextNode);
if (IsValid(CurrentTextNode->DialogueVoiceOver))
{
CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D(
GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false);
}
CurrentChoiceNode = nullptr;
CurrentAddItemNode = nullptr;
}
@ -158,6 +166,11 @@ void UAC_PlayerDialogueInterpreter::MakeChoiceDialogue(const int Choice)
CurrentTextNode = Cast<UDialogueTextNode>(CurrentChoiceNode->ChildrenNodes[Choice]);
CurrentCharacterSpeaking = *GetCharacterSpeakingFromEnum(CurrentTextNode->DialogueCharacterSpeaking);
OnNextDialogue.Broadcast(CurrentTextNode);
if (IsValid(CurrentTextNode->DialogueVoiceOver))
{
CurrentVoiceOverAudioComponent = UGameplayStatics::SpawnSound2D(
GetWorld(), CurrentTextNode->DialogueVoiceOver, 1.f, 1.f, 0.f, nullptr, false, false);
}
CurrentChoiceNode = nullptr;
}
else if (Cast<UDialogueAddItemNode>(CurrentChoiceNode->ChildrenNodes[Choice]))