diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp index df602b7..b6f63ab 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp @@ -3,8 +3,10 @@ #include "Interaction.h" +#include "NetworkMessage.h" #include "Chaos/BoundingVolumeUtilities.h" #include "Components/Button.h" +#include "GameFramework/Character.h" #include "Components/WidgetComponent.h" @@ -77,9 +79,49 @@ void AInteraction::RemoveWidget() void AInteraction::CameraLeftMover() { UE_LOG(LogTemp, Display, TEXT("Button Left is being pressed")); + TempCharacter = GetWorld()->GetFirstPlayerController()->GetCharacter(); + MainCamera = Cast(TempCharacter->FindComponentByClass()); + if (TempCharacter == nullptr) + { + UE_LOG(LogTemp, Display, TEXT("Character not found in Interaction.cpp")); + return; + } + else + { + UE_LOG(LogTemp, Display, TEXT("Character Found in interaction.cpp")); + if (MainCamera == nullptr) + { + UE_LOG(LogTemp, Display, TEXT("Camera not found in Interaction.cpp")); + return; + } + else + { + UE_LOG(LogTemp, Display, TEXT("Camera functionality here in Interaction.cpp")); + } + } } void AInteraction::CameraRightMover() { UE_LOG(LogTemp, Display, TEXT("Button Right is being pressed")); + TempCharacter = GetWorld()->GetFirstPlayerController()->GetCharacter(); + MainCamera = Cast(TempCharacter->FindComponentByClass()); + if (TempCharacter == nullptr) + { + UE_LOG(LogTemp, Display, TEXT("Character not found in Interaction.cpp")); + return; + } + else + { + UE_LOG(LogTemp, Display, TEXT("Character Found in interaction.cpp")); + if (MainCamera == nullptr) + { + UE_LOG(LogTemp, Display, TEXT("Camera not found in Interaction.cpp")); + return; + } + else + { + UE_LOG(LogTemp, Display, TEXT("Camera functionality here in Interaction.cpp")); + } + } } diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h index 0c41e49..4231b2a 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" +#include "Camera/CameraComponent.h" #include "GameFramework/Actor.h" #include "Interaction.generated.h" @@ -50,5 +51,11 @@ public: UFUNCTION(BlueprintCallable, Category= "ButtonLeft") virtual void CameraRightMover(); + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera") + UCameraComponent* MainCamera; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Player") + ACharacter* TempCharacter; };