Updated Dialogue for User Experience Improvements

In dialogue make arrow only appear when the animation is finished, Made things Bigger
This commit is contained in:
Philip W 2023-05-09 06:05:59 +01:00
parent 487c46d7b8
commit 6d8a4c82b0
2 changed files with 8 additions and 4 deletions

BIN
Content/Dialogue/TextPrompt.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -50,12 +50,13 @@ void UDialogueNPC::BeginPlay()
void UDialogueNPC::NextDialogue()
{
if (NextArrow->GetVisibility() == ESlateVisibility::Hidden) return;
if (Choice1Button->GetVisibility() == ESlateVisibility::Visible) return;
//Dialogue Skip
if (CurrentDialogue.Len() < CurrentDialogueStringPath[DialogueIndex].Len())
{
CurrentDialogue = CurrentDialogueStringPath[DialogueIndex];
DialogueText->SetText(FText::FromString(CurrentDialogue));
NextArrow->SetVisibility(ESlateVisibility::SelfHitTestInvisible);
return;
}
if (CurrentDialogueStringPath[FMath::Clamp(DialogueIndex + 1, 0, CurrentDialogueStringPath.Num() - 1)].Mid(0, 2) == "##")
@ -65,6 +66,7 @@ void UDialogueNPC::NextDialogue()
}
DialogueIndex++;
NextArrow->SetVisibility(ESlateVisibility::Hidden);
if (DialogueIndex >= CurrentDialogueStringPath.Num())
{
if (CurrentDialoguePath->Choices.IsEmpty())
@ -92,6 +94,7 @@ void UDialogueNPC::NextCharacter()
CurrentDialogue.AppendChar(CurrentDialogueStringPath[DialogueIndex][CurrentDialogue.Len()]);
DialogueText->SetText(FText::FromString(CurrentDialogue));
}
else NextArrow->SetVisibility(ESlateVisibility::SelfHitTestInvisible);
}
void UDialogueNPC::ResetDialogueUI()
@ -103,7 +106,7 @@ void UDialogueNPC::ResetDialogueUI()
Choice1Button->SetVisibility(ESlateVisibility::Hidden);
Choice2Button->SetVisibility(ESlateVisibility::Hidden);
Choice3Button->SetVisibility(ESlateVisibility::Hidden);
NextArrow->SetVisibility(ESlateVisibility::Visible);
NextArrow->SetVisibility(ESlateVisibility::Hidden);
}
// Called every frame
@ -139,6 +142,7 @@ void UDialogueNPC::StartDialogue()
Choice1Button->SetVisibility(ESlateVisibility::Hidden);
Choice2Button->SetVisibility(ESlateVisibility::Hidden);
Choice3Button->SetVisibility(ESlateVisibility::Hidden);
NextArrow->SetVisibility(ESlateVisibility::Hidden);
DialogueText->SetText(FText::FromString(""));
DialogueWidgetInstance->AddToViewport();
NPCNameText->SetText(FText::FromString(NPCName));