diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index 4eb63ed..a746440 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -48,8 +48,6 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot) EnemyActor = Enemy; StatusTextBlock->SetRenderOpacity(0.0f); BookHUD->SetVisibility(ESlateVisibility::SelfHitTestInvisible); - Cast(PlayerActor)->InventoryWidget->SetVisibility(ESlateVisibility::Hidden); - Cast(PlayerActor)->EscapeMenuWidget->SetVisibility(ESlateVisibility::Hidden); HUD->AddToViewport(-1); BookStaticMeshComponent->SetVisibility(true); EscapePercentage = CalculateEscapePercentage(); @@ -59,6 +57,12 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot) Cast(PlayerActor->GetComponentByClass(UQuestSystem::StaticClass()))->QuestWidgetInstance->SetVisibility(ESlateVisibility::Hidden); HealingJellyAmountTextBlock->SetText(FText::FromString(FString::FromInt(FMath::Clamp(Cast(PlayerActor)->Inventory->GetItemAmount(0), 0, 99)))); + FOutputDeviceNull AR; + const FString Command = FString::Printf(TEXT("CloseInventory")); + PlayerActor->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); + const FString Command69 = FString::Printf(TEXT("CloseEscapeMenu")); + PlayerActor->CallFunctionByNameWithArguments(*Command69, AR, nullptr, true); + //Disable Character Movement APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); PlayerController->SetIgnoreMoveInput(true); @@ -75,9 +79,8 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy, const bool bWasShot) FProperty* IsBossProperty = FindFieldChecked(EnemyActor->GetClass(), "IsBoss"); if (const FBoolProperty* IsBossBoolProperty = CastFieldChecked(IsBossProperty); IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor)) { - FOutputDeviceNull AR; - const FString Command = FString::Printf(TEXT("TriggerCombatAnimation true")); - EnemyActor->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); + const FString Command123 = FString::Printf(TEXT("TriggerCombatAnimation true")); + EnemyActor->CallFunctionByNameWithArguments(*Command123, AR, nullptr, true); FVector Direction = EnemyActor->GetActorLocation() - PlayerActor->GetActorLocation(); Direction.Normalize(); FRotator LookAtRotation = FRotationMatrix::MakeFromX(Direction).Rotator(); @@ -169,11 +172,17 @@ void ATurnBaseCombatV2::EndCombat() //Enable Character Movement //Set to Game Mode Only APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); + PlayerController->SetInputMode(FInputModeGameOnly()); PlayerController->SetIgnoreMoveInput(false); PlayerController->SetIgnoreLookInput(false); - PlayerController->SetInputMode(FInputModeGameOnly()); PlayerController->bShowMouseCursor = false; + //Enable Character Movement + if (ACharacter* PlayerCharacter = Cast(GetWorld()->GetFirstPlayerController()->GetPawn())) + { + PlayerCharacter->EnableInput(GetWorld()->GetFirstPlayerController()); + } + if (IsValid(EnemyActor)) { FProperty* IsBossProperty = FindFieldChecked(EnemyActor->GetClass(), "IsBoss");