Bugfix Being In a Menu Breaks Game

This commit is contained in:
Philip W 2023-05-20 00:55:20 +01:00
parent 8108050bd6
commit d2d67a5bea
4 changed files with 8 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -143,6 +143,8 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom
void UDialogueNPC::StartDialogue()
{
Cast<ATempCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->bIsInDialogue = true;
Cast<ATempCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->InventoryWidget->SetVisibility(ESlateVisibility::Hidden);
Cast<ATempCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->EscapeMenuWidget->SetVisibility(ESlateVisibility::Hidden);
bIsInDialogue = true;
Quests.Empty();
BlueprintFunctions.Empty();

View File

@ -47,6 +47,8 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot)
if (bIsInCombat) return;
EnemyActor = Enemy;
BookHUD->SetVisibility(ESlateVisibility::SelfHitTestInvisible);
Cast<ATempCharacter>(PlayerActor)->InventoryWidget->SetVisibility(ESlateVisibility::Hidden);
Cast<ATempCharacter>(PlayerActor)->EscapeMenuWidget->SetVisibility(ESlateVisibility::Hidden);
HUD->AddToViewport(-1);
BookStaticMeshComponent->SetVisibility(true);
EscapePercentage = CalculateEscapePercentage();