From 6d8a4c82b0b22b76d3d2fee5f879595b79092d70 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Tue, 9 May 2023 06:05:59 +0100 Subject: [PATCH] Updated Dialogue for User Experience Improvements In dialogue make arrow only appear when the animation is finished, Made things Bigger --- Content/Dialogue/TextPrompt.uasset | 4 ++-- Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Content/Dialogue/TextPrompt.uasset b/Content/Dialogue/TextPrompt.uasset index 48a535a..8ec7355 100644 --- a/Content/Dialogue/TextPrompt.uasset +++ b/Content/Dialogue/TextPrompt.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:434d3632e2e1b5967439f277fd4a8ec58b609ffc4fe2ecf2921a38fdcb8cee45 -size 59861 +oid sha256:9edb55ee6a2bdfd64c0e209421e750e840a4b71146cc49409e7e4a774160dbb0 +size 60170 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index ebea482..b7294ea 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -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));