From d18c54763232d21d452340ca2392e76ab527eeca Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Tue, 31 Jan 2023 00:56:53 +0000 Subject: [PATCH] Bugfix Cursor Not Hiding After Combat --- Content/Levels/Top_layer_level.umap | 4 ++-- .../TurnBasedCombatV2/HoldToInitCombat.cpp | 4 ++-- .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Content/Levels/Top_layer_level.umap b/Content/Levels/Top_layer_level.umap index a7c8fd3..3bbb67c 100644 --- a/Content/Levels/Top_layer_level.umap +++ b/Content/Levels/Top_layer_level.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:efa810ba341773ef70924459587a5bbcb3231863903517bdad8273090322f7ec -size 219702 +oid sha256:ce4d6dc0fd250c921a0493922a225877cc4175e894f7bda04de42b6d6941109e +size 220298 diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp index edec171..da73c16 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/HoldToInitCombat.cpp @@ -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; } diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index 80e801e..c0edfb8 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -68,6 +68,17 @@ void ATurnBaseCombatV2::EndCombat() { PlayerCharacter->EnableInput(GetWorld()->GetFirstPlayerController()); } + if (APlayerController* PC = Cast(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()