Updated DialogueNPC to use Ranged For Loops

This commit is contained in:
Philip W 2023-02-20 09:50:09 +00:00
parent 9bfb07fbba
commit 26f21a9136
3 changed files with 9 additions and 4 deletions

BIN
Content/Dialogue/DialogueTest.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -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)
{

View File

@ -107,7 +107,7 @@ public:
FDialoguePath CreateDialoguePath(FDialoguePath ParentDialoguePath);
UFUNCTION(BlueprintPure)
void CreateDialogueChoice(FDialoguePath PreviousDialoguePath);
FDialoguePath CreateDialogueChoice(FDialoguePath PreviousDialoguePath);
UFUNCTION()
bool GotoDialoguePath(FString PathId);