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;
|
bisDisabled = true;
|
||||||
//Setting ShopWidgetText back to hidden
|
//Setting ShopWidgetText back to hidden
|
||||||
ShopDialogWidget->SetVisibility(ESlateVisibility::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"));
|
UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true"));
|
||||||
|
|
||||||
if (Property == nullptr)
|
if (Property == nullptr)
|
||||||
|
@ -62,6 +62,7 @@ public:
|
|||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
bool bDisableShopDialMove = false;
|
bool bDisableShopDialMove = false;
|
||||||
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
||||||
virtual void CameraLeftMover();
|
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 the actor hit has the interaction component/script then it will activate the code
|
||||||
|
|
||||||
if (AInteraction* MyInteractable = Cast<AInteraction>(OutHit.GetActor()))
|
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);
|
DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 1.0f);
|
||||||
MyInteractable->OnInteract();
|
MyInteractable->OnInteract();
|
||||||
@ -118,10 +133,13 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ATempCharacter::InputDisabler()
|
void ATempCharacter::InputDisabler()
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
UE_LOG(LogTemp, Display, TEXT("Disabling playermovement"));
|
||||||
|
//GetWorld()->GetFirstPlayerController()->InputComponent->RemoveActionBinding("Interact", IE_Pressed);
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(true);
|
||||||
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(true);
|
||||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true;
|
||||||
@ -150,6 +168,7 @@ void ATempCharacter::InputEnabler()
|
|||||||
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
|
||||||
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = false;
|
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = false;
|
||||||
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
|
||||||
|
//GetWorld()->GetFirstPlayerController()->InputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed);
|
||||||
TraceDistance = 300;
|
TraceDistance = 300;
|
||||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||||
if (ThisCamera == nullptr)
|
if (ThisCamera == nullptr)
|
||||||
|
@ -76,4 +76,6 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, Category= "Items")
|
UFUNCTION(BlueprintCallable, Category= "Items")
|
||||||
void BuyItem();
|
void BuyItem();
|
||||||
|
|
||||||
|
bool bShopKeeperText = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user