diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index bd39e85..1b7fd56 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -36,6 +36,8 @@ ATurnBaseCombatV2::ATurnBaseCombatV2() void ATurnBaseCombatV2::StartCombat(AActor* Enemy) { if (Enemy == nullptr) return; + const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY()); + GetWorld()->GetFirstPlayerController()->SetMouseLocation(ViewportSize.X / 2, ViewportSize.Y / 2); bIsInCombat = true; UBlackboardComponent* EnemyBlackboard = Cast(Enemy->GetInstigatorController())->GetBlackboardComponent(); if (!HasSeenTutorial) @@ -100,6 +102,8 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy) void ATurnBaseCombatV2::EndCombat() { + const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY()); + GetWorld()->GetFirstPlayerController()->SetMouseLocation(ViewportSize.X / 2, ViewportSize.Y / 2); bEnemyHasExtraTurn = false; bPlayerHasExtraTurn = false; bIsInCombat = false; @@ -126,6 +130,8 @@ void ATurnBaseCombatV2::EndCombat() void ATurnBaseCombatV2::BeginPlay() { Super::BeginPlay(); + const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY()); + GetWorld()->GetFirstPlayerController()->SetMouseLocation(ViewportSize.X / 2, ViewportSize.Y / 2); TArray AllCharacterActorsInScene; @@ -303,7 +309,6 @@ void ATurnBaseCombatV2::DamageEnemy(int Damage, FString DamageType) void ATurnBaseCombatV2::UpdateProgressBars() const { - //PlayerHealthBar->SetPercent(*PlayerHealth / 100.0f); EnemyHealthBar->SetPercent(*EnemyHealth / 100.0f); } @@ -519,4 +524,3 @@ void ATurnBaseCombatV2::EnemyTurn() TurnIndicatorTextBlock->SetText(FText::FromString("Player Turn")); ToggleButtons(); } -