diff --git a/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset b/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset index dc1bc94..cf030cd 100644 --- a/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset +++ b/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5bb3791cb5ab0e66b2ad4d80e3c6be0e29c6952263079e17ed30b81659c64532 -size 33650 +oid sha256:2ab4de6dc668c0b8ca8ae692028ad12b8b9f48a63c0bcbd285d0896b77445307 +size 35241 diff --git a/Content/Levels/MerchantPrototype.umap b/Content/Levels/MerchantPrototype.umap index 2ebff49..c761fa8 100644 --- a/Content/Levels/MerchantPrototype.umap +++ b/Content/Levels/MerchantPrototype.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0480c5233cfea998ff467ef611c2a4aa64649eea743ae081bca929873937499c +oid sha256:088d93734195a866f6750e1bb72cd6177b555c8078682d7cacdd943f4c195f9e size 27160 diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp index 237d6ee..3f19df3 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp @@ -30,7 +30,13 @@ void AInteraction::Tick(float DeltaTime) void AInteraction::OnInteract() { - UUserWidget* spawnedWidget = CreateWidget(GetWorld(), Widget); - spawnedWidget->AddToViewport(0); + CurrentWidget = CreateWidget(GetWorld(), Widget); + CurrentWidget->AddToViewport(0); + FTimerHandle WidgetTimer; + GetWorldTimerManager().SetTimer(WidgetTimer, this, &AInteraction::RemoveWidget, 5.0f, false); } +void AInteraction::RemoveWidget() +{ + CurrentWidget->RemoveFromViewport(); +} \ No newline at end of file diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h index 2fa21b1..3450771 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h @@ -27,5 +27,8 @@ public: TSubclassOf Widget; virtual void OnInteract(); + virtual void RemoveWidget(); + UPROPERTY() + UUserWidget* CurrentWidget; };