Updated Checkpoint Tips to Perma Stay on the Screen with a New Animation

This commit is contained in:
Rafal Swierczek 2024-01-10 22:23:26 +00:00
parent 39ed880d6b
commit 9cf6884335
9 changed files with 19 additions and 27 deletions

Binary file not shown.

View File

@ -70,7 +70,6 @@ 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;
}
@ -90,9 +89,6 @@ void ABountyClass::IncrementBountyCheckpoint()
BountyCheckpoints[0]->SpawnWaypoint(BountyTitle);
BountyCheckpoints[0]->CheckpointActivated();
BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI(BountyCheckpoints[0]->GetCheckpointTip());
}
void ABountyClass::CollectRewards_Implementation()

View File

@ -100,16 +100,7 @@ public:
return BountyCheckpoints[0]->GetWaypointIcon();
}
FString GetCheckpointDescription()
{
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr)
{
return FString("No more Bounty checkpoints, check BountyClass.h GetCheckpointDescription()");
}
return BountyCheckpoints[0]->GetCheckpointDesc();
}
// ----------------------------------------------------------
// Sets default values for this actor's properties

View File

@ -20,8 +20,6 @@ class ENDLESSVENDETTA_API ACheckpointClass : public AActor
// ------ Properties set from Editor ------
UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
FString CheckpointDescription;
UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
FString CheckpointTip;
UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
FVector WaypointLoc;
@ -61,10 +59,6 @@ public:
void CheckpointActivated();
// ------ Getters for CP Properties ------
FString GetCheckpointDesc()
{
return CheckpointDescription;
}
FString GetCheckpointTip()
{

View File

@ -3,6 +3,15 @@
#include "MainBountyClass.h"
void AMainBountyClass::IncrementBountyCheckpoint()
{
Super::IncrementBountyCheckpoint();
FString TipToDisplay = "";
if (!Completed) TipToDisplay = BountyCheckpoints[0]->GetCheckpointTip();
Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI(TipToDisplay, Completed);
}
void AMainBountyClass::SpawnAmmoDrops()
{
UE_LOG(LogTemp, Display, TEXT("Bought Ammo Drops, but its not implemented yet"));

View File

@ -15,6 +15,8 @@ class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
{
GENERATED_BODY()
void IncrementBountyCheckpoint() override;
protected:
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
TArray<TSubclassOf<ASideBountyClass>> SideBountiesToSpawn;

View File

@ -228,7 +228,7 @@ public:
void WeaponSwitcher(AActor* Outhit);
UFUNCTION(BlueprintImplementableEvent)
void CheckpointCompletedUI(const FString& CheckpointDesc);
void CheckpointCompletedUI(const FString& CheckpointDesc, bool CompletedBounty = false);
// 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);