Updated Interaction,TempCharacter.cpp
Fixed being able to open the text widget while the selector is open so merchant is fully working now.
This commit is contained in:
parent
63e44f47e8
commit
f33c43689b
@ -93,6 +93,14 @@ void AInteraction::RemoveWidget()
|
||||
bisDisabled = true;
|
||||
//Setting ShopWidgetText back to hidden
|
||||
ShopDialogWidget->SetVisibility(ESlateVisibility::Hidden);
|
||||
if (ShopDialogWidget->IsVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("You cant open this widget when this widget is open"));
|
||||
}
|
||||
UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true"));
|
||||
|
||||
if (Property == nullptr)
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
UPROPERTY()
|
||||
bool bDisableShopDialMove = false;
|
||||
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
||||
virtual void CameraLeftMover();
|
||||
|
||||
|
@ -100,6 +100,21 @@ void ATempCharacter::LineTraceLogic()
|
||||
// if the actor hit has the interaction component/script then it will activate the code
|
||||
|
||||
if (AInteraction* MyInteractable = Cast<AInteraction>(OutHit.GetActor()))
|
||||
{
|
||||
if (MyInteractable->ShopDialogWidget->IsVisible())
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("ShopKeeper text is visible"));
|
||||
bShopKeeperText = true;
|
||||
return;
|
||||
}
|
||||
//if there is no text on screen this triggers
|
||||
else
|
||||
{
|
||||
if (MyInteractable->ItemSelectorWidget->IsVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 1.0f);
|
||||
MyInteractable->OnInteract();
|
||||
@ -117,11 +132,14 @@ void ATempCharacter::LineTraceLogic()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ATempCharacter::InputDisabler()
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
||||
//GetWorld()->GetFirstPlayerController()->InputComponent->RemoveActionBinding("Interact", IE_Pressed);
|
||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
||||
@ -150,6 +168,7 @@ void ATempCharacter::InputEnabler()
|
||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
||||
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = false;
|
||||
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
||||
//GetWorld()->GetFirstPlayerController()->InputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed);
|
||||
TraceDistance = 300;
|
||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||
if (ThisCamera == nullptr)
|
||||
|
@ -76,4 +76,6 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category= "Items")
|
||||
void BuyItem();
|
||||
|
||||
bool bShopKeeperText = false;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user