diff --git a/Content/Dialogue/SM_Merchant_Blueprint.uasset b/Content/Dialogue/SM_Merchant_Blueprint.uasset index 41ec1b1..ee0fec6 100644 --- a/Content/Dialogue/SM_Merchant_Blueprint.uasset +++ b/Content/Dialogue/SM_Merchant_Blueprint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:898c7cc76e76ef0e6e2c5d1f5d07d8afe1b9dade271b83f8bc59b59b40c63a27 -size 135869 +oid sha256:067c534fc59af2ef7daf2b0a5b83c5c3406f3ce74d3aaea5b4cb2e1a9dcc8a18 +size 135164 diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index 2e5fa4d..a3cfeb0 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:a9471eeefbd0715f30a83c7e694e072ea9ea7428cd72794ecd17c537987b7800 -size 3464912 +oid sha256:26c1966525a49ea2ca0e927f142117b8911ad729e8bc2cf7b1ed78228471a7e0 +size 3464831 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index b7294ea..89b8928 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -64,6 +64,13 @@ void UDialogueNPC::NextDialogue() Cast(GetWorld()->GetFirstPlayerController()->GetPawn()->GetComponentByClass(UQuestSystem::StaticClass()))->AddQuest(Quests[UKismetStringLibrary::Conv_StringToInt(CurrentDialogueStringPath[DialogueIndex].RightChop(3))]); DialogueIndex++; } + else if (CurrentDialogueStringPath[FMath::Clamp(DialogueIndex + 1, 0, CurrentDialogueStringPath.Num() - 1)].Mid(0, 2) == "@@") + { + FOutputDeviceNull AR; + const FString Command = BlueprintFunctions[UKismetStringLibrary::Conv_StringToInt(CurrentDialogueStringPath[DialogueIndex].RightChop(3))];; + GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); + DialogueIndex++; + } DialogueIndex++; NextArrow->SetVisibility(ESlateVisibility::Hidden); @@ -201,6 +208,13 @@ UDialoguePath* UDialogueNPC::AddQuest(UDialoguePath* DialoguePath, UQuest* Quest return DialoguePath; } +UDialoguePath* UDialogueNPC::CallBlueprintFunction(UDialoguePath* DialoguePath, const FString FunctionName) +{ + DialoguePath->Dialogue.Add(FText::FromString("@@ " + FunctionName).ToString()); + BlueprintFunctions.Add(BlueprintFunctions.Num(), FunctionName); + return DialoguePath; +} + void UDialogueNPC::Choice1() { CurrentDialoguePath = CurrentDialoguePath->Choices[0]; diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h index f50251d..ee5222d 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h @@ -94,6 +94,8 @@ private: UPROPERTY() TMap Quests; + UPROPERTY() + TMap BlueprintFunctions; void ResetDialogueUI(); @@ -118,6 +120,9 @@ public: UFUNCTION(BlueprintCallable) UDialoguePath* AddQuest(UDialoguePath* DialoguePath, UQuest* Quest); + + UFUNCTION(BlueprintCallable) + UDialoguePath* CallBlueprintFunction(UDialoguePath* DialoguePath, FString FunctionName); UFUNCTION() void Choice1();