Implemented Text to Checkpoint Completed UI

This commit is contained in:
Rafal Swierczek 2023-11-25 15:53:52 +00:00
parent c955020483
commit 9020cdb284
6 changed files with 10 additions and 8 deletions

View File

@ -70,6 +70,7 @@ void ABountyClass::IncrementBountyCheckpoint()
BountyCheckpoints[0]->Destroy();
BountyCheckpoints.RemoveAt(0);
UE_LOG(LogTemp, Warning, TEXT(" You've Completed the Bounty!! Well done"));
Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI(FString(""));
return;
}
@ -89,6 +90,8 @@ void ABountyClass::IncrementBountyCheckpoint()
BountyCheckpoints[0]->SpawnWaypoint();
BountyCheckpoints[0]->CheckpointActivated();
BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI(BountyCheckpoints[0]->GetCheckpointDesc());
}

View File

@ -34,7 +34,6 @@ protected:
UFUNCTION(BlueprintCallable, Category = "Checkpoint")
void BroadcastCompletion()
{
Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI();
CompletedCheckpoint.Broadcast();
}

View File

@ -196,7 +196,7 @@ public:
void WeaponSwitcher(AActor* Outhit);
UFUNCTION(BlueprintImplementableEvent)
void CheckpointCompletedUI();
void CheckpointCompletedUI(const FString& CheckpointDesc);
// Returns true if successfully changed to a new gadget, can fail if the target gadget to replace is being used
bool UpdateGadgetType(TSubclassOf<AGadgetBase> NewGadgetClass);