Bugfix Cursor Not Hiding After Combat

This commit is contained in:
Philip W 2023-01-31 00:56:53 +00:00
parent 7e81387247
commit d18c547632
3 changed files with 15 additions and 4 deletions

BIN
Content/Levels/Top_layer_level.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -85,7 +85,7 @@ AActor* UHoldToInitCombat::LookingAtEnemy() const
CollisionParams.AddIgnoredActor(GetOwner());
if (FHitResult HitResult; GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECC_Pawn, CollisionParams))
{
DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 5.0f, 0, 10.0f);
//DrawDebugLine(GetWorld(), Start, End, FColor::Green, false, 5.0f, 0, 10.0f);
if (HitResult.GetActor()->Tags.Contains("Enemy"))
{
return HitResult.GetActor();
@ -96,6 +96,6 @@ AActor* UHoldToInitCombat::LookingAtEnemy() const
return nullptr;
}
}
DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, 5.0f, 0, 10.0f);
//DrawDebugLine(GetWorld(), Start, End, FColor::Red, false, 5.0f, 0, 10.0f);
return nullptr;
}

View File

@ -68,6 +68,17 @@ void ATurnBaseCombatV2::EndCombat()
{
PlayerCharacter->EnableInput(GetWorld()->GetFirstPlayerController());
}
if (APlayerController* PC = Cast<APlayerController>(GetWorld()->GetFirstPlayerController()))
{
PC->bShowMouseCursor = false;
PC->bEnableClickEvents = false;
PC->bEnableMouseOverEvents = false;
}
GetWorld()->GetFirstPlayerController()->SetIgnoreLookInput(false);
GetWorld()->GetFirstPlayerController()->SetIgnoreMoveInput(false);
GetWorld()->GetFirstPlayerController()->bShowMouseCursor = false;
GetWorld()->GetFirstPlayerController()->bEnableClickEvents = false;
GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false;
}
void ATurnBaseCombatV2::FKeyPressed()