From 182f54a3c888a336127ecaf8eefdc9a39ab21156 Mon Sep 17 00:00:00 2001 From: MH261677 Date: Sat, 4 Feb 2023 17:39:12 +0000 Subject: [PATCH] Updated TempCharacter.cpp Added boolean to make inventory not open when in shop --- Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp | 3 +++ Source/the_twilight_abyss/PlayerTemp/TempCharacter.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index bfdfe06..aed31e5 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -85,6 +85,7 @@ void ATempCharacter::LineTraceLogic() } if(OutHit.GetActor()->FindComponentByClass()) { + UE_LOG(LogTemp, Display, TEXT("Hit Merchant")); auto ItemArray = OutHit.GetActor()->FindComponentByClass()->GetItem(0); if(GoldBalance >= ItemArray->ItemCostPrice) { @@ -139,6 +140,7 @@ void ATempCharacter::LineTraceLogic() void ATempCharacter::InputDisabler() { UE_LOG(LogTemp, Display, TEXT("Disabling playermovement")); + disableTab = true; //GetWorld()->GetFirstPlayerController()->InputComponent->RemoveActionBinding("Interact", IE_Pressed); GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true); GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true); @@ -163,6 +165,7 @@ void ATempCharacter::InputDisabler() void ATempCharacter::InputEnabler() { UE_LOG(LogTemp, Display, TEXT("Enabling Inputs")); + disableTab = true; GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false); GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(false); GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false; diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index 928b8df..510587b 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -77,5 +77,8 @@ public: void BuyItem(); bool bShopKeeperText = false; + + UPROPERTY(BlueprintReadWrite) + bool disableTab = false; };