From 76b2d78f0e88438241efbc111e9836160c890578 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 13 Mar 2023 04:49:09 +0000 Subject: [PATCH 1/3] Updated Dialogue for Choices --- .../Combat_UI/CombatCharacter.uasset | 4 +- Content/Dialogue/BungeeManPortrait.uasset | 3 + Content/Dialogue/DialogueTest.umap | 4 +- Content/Dialogue/NPCTest.uasset | 4 +- Content/Dialogue/TextPrompt.uasset | 4 +- .../Dialogue/DialogueNPC.cpp | 134 +++++++++++++----- .../the_twilight_abyss/Dialogue/DialogueNPC.h | 93 ++++++------ 7 files changed, 152 insertions(+), 94 deletions(-) create mode 100644 Content/Dialogue/BungeeManPortrait.uasset diff --git a/Content/Blueprints/Combat_UI/CombatCharacter.uasset b/Content/Blueprints/Combat_UI/CombatCharacter.uasset index 55b464e..5a5a38a 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:59e49f5ac21ef2b66e0d6eba22bb309b9a177d9c454e8a78eedc9b40788fe3b7 -size 74399 +oid sha256:fa5a4588db7886e28e8862809e819137d8bc98e191f2b8d8369cebdf7e425737 +size 84101 diff --git a/Content/Dialogue/BungeeManPortrait.uasset b/Content/Dialogue/BungeeManPortrait.uasset new file mode 100644 index 0000000..2af7db7 --- /dev/null +++ b/Content/Dialogue/BungeeManPortrait.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ce66a0de831991e0a11f66633428bfe3dc25d9beecd5ed3c99a20e454e42822 +size 107279 diff --git a/Content/Dialogue/DialogueTest.umap b/Content/Dialogue/DialogueTest.umap index 9ce057c..d2cca9e 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:10874d3de45d0093660a3b6e12561bc69214daafe2cd3072f9574c83f6cbc5d1 -size 40398 +oid sha256:6cebce24cfcd1333109dac833b39e7e0d425562e5bfad6e06ed1beaaac7ed181 +size 40317 diff --git a/Content/Dialogue/NPCTest.uasset b/Content/Dialogue/NPCTest.uasset index 7ee990d..68a9f1e 100644 --- a/Content/Dialogue/NPCTest.uasset +++ b/Content/Dialogue/NPCTest.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f99fe93ed5bc4534338fea5cabf8e1d078c3b91032f9813339bbc56ac21caf6b -size 46996 +oid sha256:f0ad8840517a535b9c0ed3e940916072540e85bb94f95e85f07c29e6d9fdc481 +size 63292 diff --git a/Content/Dialogue/TextPrompt.uasset b/Content/Dialogue/TextPrompt.uasset index 36af6e8..047ed0c 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:9f186852f793c0cf57654d61c8314956651f3c41f25d508459e48d00f7ea0581 -size 45953 +oid sha256:a3b5fa6517a77733e630214224da6e359af110afe3736a12a23d0f92c52b6a35 +size 45981 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index db464e5..4630d66 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -29,23 +29,45 @@ void UDialogueNPC::BeginPlay() DialogueText = Cast(DialogueWidgetInstance->GetWidgetFromName("Text_Dialogue")); NextButton = Cast(DialogueWidgetInstance->GetWidgetFromName("Button_Next")); NextButton->OnClicked.AddDynamic(this, &UDialogueNPC::NextDialogue); + NPCPortraitImage = Cast(DialogueWidgetInstance->GetWidgetFromName("Image_Portrait")); + if (IsValid(NPCPortrait)) NPCPortraitImage->SetBrushFromTexture(NPCPortrait); + + Choice1Button = Cast(DialogueWidgetInstance->GetWidgetFromName("Button_Choice1")); + Choice1Button->OnClicked.AddDynamic(this, &UDialogueNPC::Choice1); + Choice2Button = Cast(DialogueWidgetInstance->GetWidgetFromName("Button_Choice2")); + Choice2Button->OnClicked.AddDynamic(this, &UDialogueNPC::Choice2); + Choice3Button = Cast(DialogueWidgetInstance->GetWidgetFromName("Button_Choice3")); + Choice3Button->OnClicked.AddDynamic(this, &UDialogueNPC::Choice3); + Choice1Text = Cast(DialogueWidgetInstance->GetWidgetFromName("Text_Choice1")); + Choice2Text = Cast(DialogueWidgetInstance->GetWidgetFromName("Text_Choice2")); + Choice3Text = Cast(DialogueWidgetInstance->GetWidgetFromName("Text_Choice3")); } void UDialogueNPC::NextDialogue() { //Dialogue Skip - if (CurrentDialogue.Len() < CurrentDialoguePath[DialogueIndex].Len()) + if (CurrentDialogue.Len() < CurrentDialogueStringPath[DialogueIndex].Len()) { - CurrentDialogue = CurrentDialoguePath[DialogueIndex]; + CurrentDialogue = CurrentDialogueStringPath[DialogueIndex]; DialogueText->SetText(FText::FromString(CurrentDialogue)); return; } DialogueIndex++; - if (DialogueIndex >= CurrentDialoguePath.Num()) + if (DialogueIndex >= CurrentDialogueStringPath.Num()) { - EndDialogue(); + if (CurrentDialoguePath->Choices.IsEmpty()) + { + EndDialogue(); + return; + } + GetWorld()->GetTimerManager().PauseTimer(TextAnimationTimerHandle); + DialogueText->SetText(FText::FromString("")); + Choice1Button->SetVisibility(ESlateVisibility::Visible); + Choice2Button->SetVisibility(ESlateVisibility::Visible); + if (Choice3Text->GetText().ToString() != "") Choice3Button->SetVisibility(ESlateVisibility::Visible); + NextButton->SetVisibility(ESlateVisibility::Hidden); return; } CurrentDialogue = ""; @@ -53,11 +75,11 @@ void UDialogueNPC::NextDialogue() void UDialogueNPC::NextCharacter() { - if (DialogueIndex >= CurrentDialoguePath.Num()) return; + if (DialogueIndex >= CurrentDialogueStringPath.Num()) return; - if (CurrentDialogue.Len() < CurrentDialoguePath[DialogueIndex].Len()) + if (CurrentDialogue.Len() < CurrentDialogueStringPath[DialogueIndex].Len()) { - CurrentDialogue.AppendChar(CurrentDialoguePath[DialogueIndex][CurrentDialogue.Len()]); + CurrentDialogue.AppendChar(CurrentDialogueStringPath[DialogueIndex][CurrentDialogue.Len()]); DialogueText->SetText(FText::FromString(CurrentDialogue)); } } @@ -72,6 +94,12 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom void UDialogueNPC::StartDialogue() { + if (IsValid(RootDialoguePath)) CurrentDialogueStringPath = RootDialoguePath->Dialogue; + if (CurrentDialogueStringPath.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("Dialogue Path is Empty")); + return; + } //Disable Character Movement if (ACharacter* PlayerCharacter = Cast(GetWorld()->GetFirstPlayerController()->GetPawn())) { @@ -82,11 +110,16 @@ void UDialogueNPC::StartDialogue() PlayerController->SetInputMode(FInputModeUIOnly()); PlayerController->bShowMouseCursor = true; + Choice1Button->SetVisibility(ESlateVisibility::Hidden); + Choice2Button->SetVisibility(ESlateVisibility::Hidden); + Choice3Button->SetVisibility(ESlateVisibility::Hidden); + DialogueText->SetText(FText::FromString("")); DialogueWidgetInstance->AddToViewport(); - DialogueIndex = 1; NPCNameText->SetText(FText::FromString(NPCName)); + DialogueIndex = 0; CurrentDialogue = ""; - CurrentDialoguePath = DialoguePaths[0].Dialogue; + CurrentDialoguePath = RootDialoguePath; + CurrentDialogueStringPath = RootDialoguePath->Dialogue; GetWorld()->GetTimerManager().SetTimer(TextAnimationTimerHandle, this, &UDialogueNPC::NextCharacter, TextAnimationSpeed, true); } @@ -106,42 +139,67 @@ void UDialogueNPC::EndDialogue() PlayerController->bShowMouseCursor = false; } -FDialoguePath UDialogueNPC::CreateRootDialoguePath() +UDialoguePath* UDialogueNPC::CreateRootDialoguePath() { - return FDialoguePath(); + RootDialoguePath = NewObject(); + return RootDialoguePath; } -FDialoguePath UDialogueNPC::CreateDialoguePath(FDialoguePath ParentDialoguePath) -{ - return FDialoguePath("#" + FString::FromInt(DialoguePaths.Num())); -} - -FDialoguePath UDialogueNPC::CreateDialogueChoice(FDialoguePath PreviousDialoguePath) -{ - return FDialoguePath(); -} - -bool UDialogueNPC::GotoDialoguePath(FString PathId) -{ - for (FDialoguePath DialogPath : DialoguePaths) - { - if (DialogPath.Dialogue[0] == PathId) - { - CurrentDialoguePath = DialogPath.Dialogue; - return true; - } - } - return false; -} - -FDialoguePath UDialogueNPC::AddDialogue(FText TextInput, FDialoguePath DialoguePath) +UDialoguePath* UDialogueNPC::AddDialogue(UDialoguePath* DialoguePath, FText TextInput) { if (TextInput.IsEmpty()) return DialoguePath; - DialoguePath.Dialogue.Add(TextInput.ToString()); + DialoguePath->Dialogue.Add(TextInput.ToString()); return DialoguePath; } -void UDialogueNPC::GetFinalDialogue(TArray DialogueArray) +void UDialogueNPC::AddChoices(UDialoguePath* ParentPath, FText ChoiceText1, FText ChoiceText2, FText ChoiceText3, UDialoguePath*& Out_ChoicePath1, UDialoguePath*& Out_ChoicePath2, UDialoguePath*& Out_ChoicePath3) { - DialoguePaths.Add(FDialoguePath(DialogueArray)); + ParentPath->Choices.Add(NewObject()); + ParentPath->Choices.Add(NewObject()); + ParentPath->Choices.Add(NewObject()); + Out_ChoicePath1 = ParentPath->Choices[0]; + Out_ChoicePath2 = ParentPath->Choices[1]; + Out_ChoicePath3 = ParentPath->Choices[2]; + Choice1Text->SetText(ChoiceText1); + Choice2Text->SetText(ChoiceText2); + Choice3Text->SetText(ChoiceText3); +} + +void UDialogueNPC::Choice1() +{ + CurrentDialoguePath = CurrentDialoguePath->Choices[0]; + DialogueIndex = 0; + CurrentDialogue = ""; + CurrentDialogueStringPath = CurrentDialoguePath->Dialogue; + GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle); + Choice1Button->SetVisibility(ESlateVisibility::Hidden); + Choice2Button->SetVisibility(ESlateVisibility::Hidden); + Choice3Button->SetVisibility(ESlateVisibility::Hidden); + NextButton->SetVisibility(ESlateVisibility::Visible); +} + +void UDialogueNPC::Choice2() +{ + CurrentDialoguePath = CurrentDialoguePath->Choices[1]; + DialogueIndex = 0; + CurrentDialogue = ""; + CurrentDialogueStringPath = CurrentDialoguePath->Dialogue; + GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle); + Choice1Button->SetVisibility(ESlateVisibility::Hidden); + Choice2Button->SetVisibility(ESlateVisibility::Hidden); + Choice3Button->SetVisibility(ESlateVisibility::Hidden); + NextButton->SetVisibility(ESlateVisibility::Visible); +} + +void UDialogueNPC::Choice3() +{ + CurrentDialoguePath = CurrentDialoguePath->Choices[2]; + DialogueIndex = 0; + CurrentDialogue = ""; + CurrentDialogueStringPath = CurrentDialoguePath->Dialogue; + GetWorld()->GetTimerManager().UnPauseTimer(TextAnimationTimerHandle); + Choice1Button->SetVisibility(ESlateVisibility::Hidden); + Choice2Button->SetVisibility(ESlateVisibility::Hidden); + Choice3Button->SetVisibility(ESlateVisibility::Hidden); + NextButton->SetVisibility(ESlateVisibility::Visible); } diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h index 4b6f2f9..4ceda47 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h @@ -6,38 +6,20 @@ #include "Components/ActorComponent.h" #include "Components/Button.h" #include "Components/TextBlock.h" +#include "Components/Image.h" #include "DialogueNPC.generated.h" -UENUM(BlueprintType) -enum class EChoices : uint8 -{ - Choice1 UMETA(DisplayName="Choice 1"), - Choice2 UMETA(DisplayName="Choice 2"), - Choice3 UMETA(DisplayName="Choice 3"), -}; - -USTRUCT(BlueprintType) -struct FDialoguePath +UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) +class UDialoguePath : public UObject { GENERATED_BODY() - UPROPERTY() +public: + UPROPERTY(BlueprintReadWrite) TArray Dialogue; - FDialoguePath() - { - Dialogue.Add("#ROOT"); - } - - FDialoguePath(FString Id) - { - Dialogue.Add(Id); - } - - explicit FDialoguePath(TArray Dialogue) - { - this->Dialogue = Dialogue; - } + UPROPERTY(BlueprintReadWrite) + TArray Choices; }; UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) @@ -51,11 +33,15 @@ public: UPROPERTY(EditAnywhere) FString NPCName; - - UPROPERTY() - TArray DialoguePaths; - TArray CurrentDialoguePath; + UPROPERTY() + UDialoguePath* RootDialoguePath; + UPROPERTY() + UDialoguePath* CurrentDialoguePath; + TArray CurrentDialogueStringPath; + + UPROPERTY(EditAnywhere) + UTexture2D* NPCPortrait; UPROPERTY(EditAnywhere) float TextAnimationSpeed = 0.05f; @@ -70,13 +56,26 @@ protected: private: UPROPERTY() UUserWidget* DialogueWidgetInstance; - - UPROPERTY() - UTextBlock* NPCNameText; + UPROPERTY() + UTextBlock* NPCNameText; UPROPERTY() UTextBlock* DialogueText; - + UPROPERTY() + UImage* NPCPortraitImage; + UPROPERTY() + UButton* Choice1Button; + UPROPERTY() + UButton* Choice2Button; + UPROPERTY() + UButton* Choice3Button; + UPROPERTY() + UTextBlock* Choice1Text; + UPROPERTY() + UTextBlock* Choice2Text; + UPROPERTY() + UTextBlock* Choice3Text; + UPROPERTY() UButton* NextButton; @@ -100,21 +99,19 @@ public: UFUNCTION(BlueprintCallable) void EndDialogue(); - UFUNCTION(BlueprintPure) - FDialoguePath CreateRootDialoguePath(); - - UFUNCTION() - FDialoguePath CreateDialoguePath(FDialoguePath ParentDialoguePath); - - UFUNCTION(BlueprintPure) - FDialoguePath CreateDialogueChoice(FDialoguePath PreviousDialoguePath); - - UFUNCTION() - bool GotoDialoguePath(FString PathId); - - UFUNCTION(BlueprintPure) - FDialoguePath AddDialogue(FText TextInput, FDialoguePath DialoguePath); + UFUNCTION(BlueprintCallable) + UDialoguePath* CreateRootDialoguePath(); UFUNCTION(BlueprintCallable) - void GetFinalDialogue(TArray DialogueArray); + UDialoguePath* AddDialogue(UDialoguePath* DialoguePath, FText TextInput); + UFUNCTION(BlueprintCallable) + void AddChoices(UDialoguePath* ParentPath, FText ChoiceText1, FText ChoiceText2, FText ChoiceText3, + UDialoguePath*& ChoicePath1, UDialoguePath*& ChoicePath2, UDialoguePath*& ChoicePath3); + + UFUNCTION() + void Choice1(); + UFUNCTION() + void Choice2(); + UFUNCTION() + void Choice3(); }; From 3a99e71bde5b6fb52ebcbd1c7d8514126fc80de9 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 13 Mar 2023 05:19:13 +0000 Subject: [PATCH 2/3] Added Base Stub for Quest System --- Content/Blueprints/Quest_UI/Quest_UI.uasset | 3 ++ Content/Dialogue/BungeeManPortrait.uasset | 4 +-- Content/Dialogue/DialogueTest.umap | 2 +- Content/Dialogue/NPCTest.uasset | 4 +-- Content/Dialogue/TextPrompt.uasset | 2 +- .../the_twilight_abyss/Quest/QuestSystem.cpp | 35 +++++++++++++++++++ Source/the_twilight_abyss/Quest/QuestSystem.h | 26 ++++++++++++++ 7 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 Content/Blueprints/Quest_UI/Quest_UI.uasset create mode 100644 Source/the_twilight_abyss/Quest/QuestSystem.cpp create mode 100644 Source/the_twilight_abyss/Quest/QuestSystem.h diff --git a/Content/Blueprints/Quest_UI/Quest_UI.uasset b/Content/Blueprints/Quest_UI/Quest_UI.uasset new file mode 100644 index 0000000..effccd5 --- /dev/null +++ b/Content/Blueprints/Quest_UI/Quest_UI.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03df2bbabe6a8403b44a85bba4cd111dbda87297beabcc69a1b161892c264b52 +size 23596 diff --git a/Content/Dialogue/BungeeManPortrait.uasset b/Content/Dialogue/BungeeManPortrait.uasset index 2af7db7..c516e5a 100644 --- a/Content/Dialogue/BungeeManPortrait.uasset +++ b/Content/Dialogue/BungeeManPortrait.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ce66a0de831991e0a11f66633428bfe3dc25d9beecd5ed3c99a20e454e42822 -size 107279 +oid sha256:d449437cf1c3ac29971ea809f60c0521cf1607f0ed3bbd2ad9851a831e880b0a +size 107274 diff --git a/Content/Dialogue/DialogueTest.umap b/Content/Dialogue/DialogueTest.umap index d2cca9e..6ce0a54 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:6cebce24cfcd1333109dac833b39e7e0d425562e5bfad6e06ed1beaaac7ed181 +oid sha256:d733c4c0e6d5852ac101cf16ef82f9afdccbcd4dc60ed09eeb8404b22ca235d4 size 40317 diff --git a/Content/Dialogue/NPCTest.uasset b/Content/Dialogue/NPCTest.uasset index 68a9f1e..faaaae3 100644 --- a/Content/Dialogue/NPCTest.uasset +++ b/Content/Dialogue/NPCTest.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0ad8840517a535b9c0ed3e940916072540e85bb94f95e85f07c29e6d9fdc481 -size 63292 +oid sha256:8a667ddf710cba8e628170add37673bba11b8c4519557fe10a43707f27d9ca58 +size 62672 diff --git a/Content/Dialogue/TextPrompt.uasset b/Content/Dialogue/TextPrompt.uasset index 047ed0c..01772b4 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:a3b5fa6517a77733e630214224da6e359af110afe3736a12a23d0f92c52b6a35 +oid sha256:70a4ef6a110e5f181fcdfde4ba5397b911ce22f5f704fcad74f7883967c51580 size 45981 diff --git a/Source/the_twilight_abyss/Quest/QuestSystem.cpp b/Source/the_twilight_abyss/Quest/QuestSystem.cpp new file mode 100644 index 0000000..c5244c9 --- /dev/null +++ b/Source/the_twilight_abyss/Quest/QuestSystem.cpp @@ -0,0 +1,35 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "QuestSystem.h" + + +// Sets default values for this component's properties +UQuestSystem::UQuestSystem() +{ + // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features + // off to improve performance if you don't need them. + PrimaryComponentTick.bCanEverTick = true; + + // ... +} + + +// Called when the game starts +void UQuestSystem::BeginPlay() +{ + Super::BeginPlay(); + + // ... + +} + + +// Called every frame +void UQuestSystem::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) +{ + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + // ... +} + diff --git a/Source/the_twilight_abyss/Quest/QuestSystem.h b/Source/the_twilight_abyss/Quest/QuestSystem.h new file mode 100644 index 0000000..70a6d79 --- /dev/null +++ b/Source/the_twilight_abyss/Quest/QuestSystem.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/ActorComponent.h" +#include "QuestSystem.generated.h" + + +UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) +class THE_TWILIGHT_ABYSS_API UQuestSystem : public UActorComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UQuestSystem(); + +protected: + // Called when the game starts + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; +}; From af86084f3e5b92dbd0e25347996a985c4e7fb57e Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Mon, 13 Mar 2023 18:11:42 +0000 Subject: [PATCH 3/3] Updated Quest UI to Display Tasks --- Content/Blueprints/Quest_UI/Quest_UI.uasset | 4 ++-- Content/Dialogue/DialogueTest.umap | 2 +- Content/Dialogue/NPCTest.uasset | 4 ++-- Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp | 2 +- Source/the_twilight_abyss/Quest/QuestSystem.cpp | 5 ++--- Source/the_twilight_abyss/Quest/QuestSystem.h | 4 ++++ 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Content/Blueprints/Quest_UI/Quest_UI.uasset b/Content/Blueprints/Quest_UI/Quest_UI.uasset index effccd5..3fca063 100644 --- a/Content/Blueprints/Quest_UI/Quest_UI.uasset +++ b/Content/Blueprints/Quest_UI/Quest_UI.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:03df2bbabe6a8403b44a85bba4cd111dbda87297beabcc69a1b161892c264b52 -size 23596 +oid sha256:34a368440be2e5be15b6cc6adb7ac590ec2f950565bc580b2eecd85f013b4ab4 +size 24449 diff --git a/Content/Dialogue/DialogueTest.umap b/Content/Dialogue/DialogueTest.umap index 6ce0a54..f0c293a 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:d733c4c0e6d5852ac101cf16ef82f9afdccbcd4dc60ed09eeb8404b22ca235d4 +oid sha256:f6a9356162034744222c61ef862852d040350f8930a389993c238e814a018ff3 size 40317 diff --git a/Content/Dialogue/NPCTest.uasset b/Content/Dialogue/NPCTest.uasset index faaaae3..e334156 100644 --- a/Content/Dialogue/NPCTest.uasset +++ b/Content/Dialogue/NPCTest.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8a667ddf710cba8e628170add37673bba11b8c4519557fe10a43707f27d9ca58 -size 62672 +oid sha256:9e9c7e12ba35a17ee147602e8f916c869f659eeea4b503b5da874ebf1b66a4c7 +size 63914 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index 4630d66..9fdfed1 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -13,7 +13,7 @@ UDialogueNPC::UDialogueNPC() // off to improve performance if you don't need them. PrimaryComponentTick.bCanEverTick = true; - static ConstructorHelpers::FClassFinder DialogueWidgetClass(TEXT("/Game/Dialogue/TextPrompt")); + static ConstructorHelpers::FClassFinder DialogueWidgetClass(TEXT("/Game/Blueprints/Quest_UI/Quest_UI")); DialogueWidget = DialogueWidgetClass.Class; } diff --git a/Source/the_twilight_abyss/Quest/QuestSystem.cpp b/Source/the_twilight_abyss/Quest/QuestSystem.cpp index c5244c9..d8c9c29 100644 --- a/Source/the_twilight_abyss/Quest/QuestSystem.cpp +++ b/Source/the_twilight_abyss/Quest/QuestSystem.cpp @@ -11,7 +11,8 @@ UQuestSystem::UQuestSystem() // off to improve performance if you don't need them. PrimaryComponentTick.bCanEverTick = true; - // ... + static ConstructorHelpers::FClassFinder QuestWidgetClass(TEXT("/Game/Dialogue/TextPrompt")); + QuestWidget = QuestWidgetClass.Class; } @@ -20,7 +21,6 @@ void UQuestSystem::BeginPlay() { Super::BeginPlay(); - // ... } @@ -30,6 +30,5 @@ void UQuestSystem::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - // ... } diff --git a/Source/the_twilight_abyss/Quest/QuestSystem.h b/Source/the_twilight_abyss/Quest/QuestSystem.h index 70a6d79..352333c 100644 --- a/Source/the_twilight_abyss/Quest/QuestSystem.h +++ b/Source/the_twilight_abyss/Quest/QuestSystem.h @@ -4,6 +4,7 @@ #include "CoreMinimal.h" #include "Components/ActorComponent.h" +#include "Components/TextBlock.h" #include "QuestSystem.generated.h" @@ -20,6 +21,9 @@ protected: // Called when the game starts virtual void BeginPlay() override; + UPROPERTY() + TSubclassOf QuestWidget; + public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;