Some work done on dialogue fixes and more bazaar iterations

This commit is contained in:
2026-08-18 22:58:29 +02:00
parent 1a3c2013b5
commit 28f27d032a
13 changed files with 57 additions and 35 deletions

View File

@@ -93,12 +93,14 @@ void UDialogueComponent::TriggerDialogue(USpeechDataAsset* DialogueAssetPath, co
UDialogueSubsystem* DialogueSubsystem = UDialogueSubsystem::Get(this);
if (!DialogueSubsystem) return;
if (!DialogueSubsystem->StartDialogue()) return;
if (!DialogueSubsystem->IsDialogueStarted())
{
BindToControllerInput();
bDialogueSelectOpen = false;
DialogueWidget = Cast<UDialogueWidget>(EleriPlayerController->ToggleDialogueWindow(true));
DialogueWidget->AssignDialogueComponent(this);
}
BindToControllerInput();
bDialogueSelectOpen = false;
DialogueWidget = Cast<UDialogueWidget>(EleriPlayerController->ToggleDialogueWindow(true));
DialogueWidget->AssignDialogueComponent(this);
CurrentLineIndex = 0;
CurrentActiveDialogue = DialogueAssetPath;
CurrentDialogueReplacementMap = ReplacementMap;
@@ -113,8 +115,10 @@ void UDialogueComponent::TriggerDialogue(USpeechDataAsset* DialogueAssetPath, co
MappedDialogueOptions.Add(i, CurrentActiveDialogue->PlayerSpeechMap[i]);
PlayerSpeakOptions.Add(CurrentActiveDialogue->PlayerSpeechMap[i].PlayerSpeak);
}
TriggerDialogueSelect(PlayerSpeakOptions, false);
//TriggerDialogueSelect(PlayerSpeakOptions, false);
}
DialogueSubsystem->StartDialogue();
}
TArray<USpeechDataAsset*> UDialogueComponent::GetActiveSpeechData() { return ActiveSpeechData; }
@@ -231,6 +235,7 @@ void UDialogueComponent::OnDialogueOptionSelected(int32 Index)
{
DialogueWidget->OnDialogueOptionSelected.RemoveDynamic(this, &UDialogueComponent::OnDialogueOptionSelected);
SelectedDialogueOptionIndex = Index;
bDialogueSelectOpen = false;
if (const FPlayerSpeakToDialogue* PlayerSpeak = MappedDialogueOptions.Find(SelectedDialogueOptionIndex))
{
@@ -244,6 +249,11 @@ void UDialogueComponent::OnDialogueOptionSelected(int32 Index)
TriggerDialogue_Async(PlayerSpeak->NextSpeechDataAsset, CurrentDialogueReplacementMap);
return;
}
if (!PlayerSpeak->bEndDialogueAfterSelecting)
{
return;
}
}
CloseDialogue();