From 014a670ec580bb017cda0886859987f4cd65f720 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Thu, 2 Feb 2023 02:06:55 +0000 Subject: [PATCH] Bugfix Widget Focus Not Correctly Being Set --- .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index 5fff2b7..b2c29ff 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -42,17 +42,16 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy) IronResource = 10; SulfurResource = 10; - if (APlayerController* PC = Cast(GetWorld()->GetFirstPlayerController())) - { - PC->bShowMouseCursor = true; - PC->bEnableClickEvents = true; - PC->bEnableMouseOverEvents = true; - } //Disable Character Movement if (ACharacter* PlayerCharacter = Cast(GetWorld()->GetFirstPlayerController()->GetPawn())) { PlayerCharacter->DisableInput(GetWorld()->GetFirstPlayerController()); } + //Set to UI Mode Only + APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); + PlayerController->SetInputMode(FInputModeUIOnly()); + PlayerController->bShowMouseCursor = true; + CurrentComboString = ""; UpdateComboString(CurrentComboString); RevertActionPoints(); @@ -73,17 +72,10 @@ 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; + //Set to Game Mode Only + APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); + PlayerController->SetInputMode(FInputModeGameOnly()); + PlayerController->bShowMouseCursor = false; } void ATurnBaseCombatV2::FKeyPressed()