diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp index 27c894f..df602b7 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp @@ -4,6 +4,7 @@ #include "Interaction.h" #include "Chaos/BoundingVolumeUtilities.h" +#include "Components/Button.h" #include "Components/WidgetComponent.h" @@ -52,6 +53,16 @@ void AInteraction::RemoveWidget() ShopDialogWidget->RemoveFromViewport(); UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true")); ItemSelectorWidget = CreateWidget(GetWorld(), ItemSelector); + UProperty* Property = ItemSelectorWidget->GetClass()->FindPropertyByName("publicActor"); + if (Property == nullptr) + { + UE_LOG(LogTemp, Error, TEXT("Property not found")); + } + else + { + FObjectPropertyBase* ObjectProperty = static_cast(Property); + ObjectProperty->SetObjectPropertyValue(ObjectProperty->ContainerPtrToValuePtr(ItemSelectorWidget), this); + } if (ItemSelectorWidget == nullptr) { return; @@ -61,4 +72,14 @@ void AInteraction::RemoveWidget() ItemSelectorWidget->AddToViewport(0); bisDisabled = false; } -} \ No newline at end of file +} + +void AInteraction::CameraLeftMover() +{ + UE_LOG(LogTemp, Display, TEXT("Button Left is being pressed")); +} + +void AInteraction::CameraRightMover() +{ + UE_LOG(LogTemp, Display, TEXT("Button Right is being pressed")); +} diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h index fbeb15d..0c41e49 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h @@ -44,5 +44,11 @@ public: UPROPERTY() bool bisDisabled = false; + + UFUNCTION(BlueprintCallable, Category= "ButtonLeft") + virtual void CameraLeftMover(); + + UFUNCTION(BlueprintCallable, Category= "ButtonLeft") + virtual void CameraRightMover(); };