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

View File

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

View File

@ -196,7 +196,7 @@ public:
void WeaponSwitcher(AActor* Outhit); void WeaponSwitcher(AActor* Outhit);
UFUNCTION(BlueprintImplementableEvent) 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 // 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); bool UpdateGadgetType(TSubclassOf<AGadgetBase> NewGadgetClass);