From 26f21a9136ff94af448a7ffb1b85019915fa3557 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 20 Feb 2023 09:50:09 +0000 Subject: [PATCH] Updated DialogueNPC to use Ranged For Loops --- Content/Dialogue/DialogueTest.umap | 4 ++-- Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp | 7 ++++++- Source/the_twilight_abyss/Dialogue/DialogueNPC.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Content/Dialogue/DialogueTest.umap b/Content/Dialogue/DialogueTest.umap index f2a5797..9ce057c 100644 --- a/Content/Dialogue/DialogueTest.umap +++ b/Content/Dialogue/DialogueTest.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f2c0cc2d73c9fd35cf193c48ae0546bd41a9a10dedfe8c60d504fe09b55e819 -size 41343 +oid sha256:10874d3de45d0093660a3b6e12561bc69214daafe2cd3072f9574c83f6cbc5d1 +size 40398 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index a62d7bb..db464e5 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -116,9 +116,14 @@ FDialoguePath UDialogueNPC::CreateDialoguePath(FDialoguePath ParentDialoguePath) return FDialoguePath("#" + FString::FromInt(DialoguePaths.Num())); } +FDialoguePath UDialogueNPC::CreateDialogueChoice(FDialoguePath PreviousDialoguePath) +{ + return FDialoguePath(); +} + bool UDialogueNPC::GotoDialoguePath(FString PathId) { - for each (FDialoguePath DialogPath in DialoguePaths) + for (FDialoguePath DialogPath : DialoguePaths) { if (DialogPath.Dialogue[0] == PathId) { diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h index f2a9409..4b6f2f9 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h @@ -107,7 +107,7 @@ public: FDialoguePath CreateDialoguePath(FDialoguePath ParentDialoguePath); UFUNCTION(BlueprintPure) - void CreateDialogueChoice(FDialoguePath PreviousDialoguePath); + FDialoguePath CreateDialogueChoice(FDialoguePath PreviousDialoguePath); UFUNCTION() bool GotoDialoguePath(FString PathId);