diff --git a/Content/Blueprints/Combat_UI/CombatCharacter.uasset b/Content/Blueprints/Combat_UI/CombatCharacter.uasset index 3f01fba..61614bd 100644 --- a/Content/Blueprints/Combat_UI/CombatCharacter.uasset +++ b/Content/Blueprints/Combat_UI/CombatCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e1f61ee11c1c818422cdc50628b28b3d3d20c6955797c75dd431f06d99b712ad -size 251440 +oid sha256:e8c788cf555e34d359428f9ec1fc2e816ab5de456996ab829ab793ffeab1ca72 +size 252531 diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index 531e7f0..9c0b871 100644 --- a/Content/Levels/Build.umap +++ b/Content/Levels/Build.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3b97096737c0bcf374b3ff69ce12c42a74eab4db8faf83270a7b9d897adb7b8c +oid sha256:12152c368686ed76c0b087496252c05d06736f040e60ba8a87b6963538507749 size 5615430 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index 14b498b..d193e71 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -142,6 +142,7 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom void UDialogueNPC::StartDialogue() { + bIsInDialogue = true; Quests.Empty(); BlueprintFunctions.Empty(); ItemIndexes.Empty(); @@ -178,6 +179,7 @@ void UDialogueNPC::StartDialogue() void UDialogueNPC::EndDialogue() { + bIsInDialogue = false; TextAnimationTimerHandle.Invalidate(); DialogueWidgetInstance->RemoveFromParent(); diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h index 862072d..fbb78cf 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h @@ -57,6 +57,9 @@ public: UPROPERTY(EditAnywhere) float TextAnimationSpeed = 0.05f; + UPROPERTY(BlueprintReadOnly) + bool bIsInDialogue = false; + protected: // Called when the game starts virtual void BeginPlay() override; @@ -92,14 +95,15 @@ private: UPROPERTY() UButton* NextButton; + UPROPERTY() int DialogueIndex = 1; + UPROPERTY() FString CurrentDialogue; UPROPERTY() FTimerHandle TextAnimationTimerHandle; - + UFUNCTION() - void NextDialogue(); void NextCharacter(); UPROPERTY() @@ -122,10 +126,12 @@ public: UFUNCTION(BlueprintCallable) void StartDialogue(); - UFUNCTION(BlueprintCallable) void EndDialogue(); - + + UFUNCTION(BlueprintCallable) + void NextDialogue(); + UFUNCTION(BlueprintCallable) UDialoguePath* CreateRootDialoguePath(bool ResetUserControls = true); diff --git a/Source/the_twilight_abyss/Dialogue/InteractNPC.cpp b/Source/the_twilight_abyss/Dialogue/InteractNPC.cpp index 042b946..788f950 100644 --- a/Source/the_twilight_abyss/Dialogue/InteractNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/InteractNPC.cpp @@ -47,7 +47,13 @@ void UInteractNPC::Interact() if (HitResult.GetActor()->Tags.Contains("NPC")) { //DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 5.0f, 0, 10.0f); - HitResult.GetActor()->FindComponentByClass()->StartDialogue(); + UDialogueNPC* DialogueNPC = HitResult.GetActor()->FindComponentByClass(); + if (DialogueNPC->bIsInDialogue) + { + DialogueNPC->NextDialogue(); + return; + } + DialogueNPC->StartDialogue(); } //DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, 5.0f, 0, 10.0f); }