Updated TempCharacter.cpp

Added boolean to make inventory not open when in shop
This commit is contained in:
MH261677 2023-02-04 17:39:12 +00:00
parent e2f91a11b5
commit 182f54a3c8
2 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,7 @@ void ATempCharacter::LineTraceLogic()
}
if(OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
{
UE_LOG(LogTemp, Display, TEXT("Hit Merchant"));
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->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;

View File

@ -78,4 +78,7 @@ public:
bool bShopKeeperText = false;
UPROPERTY(BlueprintReadWrite)
bool disableTab = false;
};