From 39ed880d6b8ff27f59047e51249c5c9054fbe908 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Wed, 10 Jan 2024 21:31:10 +0000 Subject: [PATCH] Updated Waypoints to Display Bounty Titles Instead of Checkpoint Descriptions --- .../BountySimulation/CP_ElimTutorialTarget.uasset | 4 ++-- .../EndlessVendetta/BountySystem/BountyClass.cpp | 4 ++-- .../EndlessVendetta/BountySystem/CheckpointClass.cpp | 10 ++++++---- .../EndlessVendetta/BountySystem/CheckpointClass.h | 6 ++++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/EndlessVendetta/Content/BountySystem/TutorialFacility/Checkpoints/BountySimulation/CP_ElimTutorialTarget.uasset b/EndlessVendetta/Content/BountySystem/TutorialFacility/Checkpoints/BountySimulation/CP_ElimTutorialTarget.uasset index 6f3dcce1..e35ad8ed 100644 --- a/EndlessVendetta/Content/BountySystem/TutorialFacility/Checkpoints/BountySimulation/CP_ElimTutorialTarget.uasset +++ b/EndlessVendetta/Content/BountySystem/TutorialFacility/Checkpoints/BountySimulation/CP_ElimTutorialTarget.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eafef3871610bf15d90d680c56e28c40ec4e54d5b735a02ae83706187362aed0 -size 144071 +oid sha256:e517fd38bf17f395edda2c998cbed260ac94e95ab348f7eb696232dffd112dc9 +size 143697 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp index 1170079d..314532d4 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.cpp @@ -48,7 +48,7 @@ void ABountyClass::SpawnCheckpoints() // Activate the first checkpoint and listen for its completion BountyCheckpoints[0]->Active = true; - BountyCheckpoints[0]->SpawnWaypoint(); + BountyCheckpoints[0]->SpawnWaypoint(BountyTitle); BountyCheckpoints[0]->CheckpointActivated(); BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint); } @@ -87,7 +87,7 @@ void ABountyClass::IncrementBountyCheckpoint() // Set the new checkpoint in pos 0 to be active and listen for it's completion BountyCheckpoints[0]->Active = true; - BountyCheckpoints[0]->SpawnWaypoint(); + BountyCheckpoints[0]->SpawnWaypoint(BountyTitle); BountyCheckpoints[0]->CheckpointActivated(); BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint); diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp index df618059..c5399b59 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.cpp @@ -8,6 +8,7 @@ ACheckpointClass::ACheckpointClass() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; + BountyTitle = ""; } @@ -17,23 +18,24 @@ void ACheckpointClass::BeginPlay() Super::BeginPlay(); } -void ACheckpointClass::SpawnWaypoint() +void ACheckpointClass::SpawnWaypoint(const FString& CurrentBountyTitle) { if (!IsValid(WaypointActorClass)) return; + BountyTitle = CurrentBountyTitle; FActorSpawnParameters SpawnParams; SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; WaypointActor = Cast(GetWorld()->SpawnActor(WaypointActorClass, WaypointLoc, GetActorRotation(), SpawnParams)); - WaypointActor->SetupWaypoint(WaypointIcon, CheckpointDescription); + WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle); } -void ACheckpointClass::UpdateChecpointWaypoint(FString WaypointDesc, FVector WaypointNewLoc) +void ACheckpointClass::UpdateChecpointWaypoint(FVector WaypointNewLoc) { FActorSpawnParameters SpawnParams; SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; if (WaypointActor) WaypointActor->Destroy(); WaypointActor = Cast(GetWorld()->SpawnActor(WaypointActorClass, WaypointNewLoc, GetActorRotation(), SpawnParams)); - WaypointActor->SetupWaypoint(WaypointIcon, WaypointDesc); + WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle); } // Called every frame diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h index a414a61d..380f2e5b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/CheckpointClass.h @@ -16,6 +16,8 @@ class ENDLESSVENDETTA_API ACheckpointClass : public AActor { GENERATED_BODY() + FString BountyTitle; + // ------ Properties set from Editor ------ UPROPERTY(EditDefaultsOnly, Category = "Checkpoint") FString CheckpointDescription; @@ -41,7 +43,7 @@ protected: } UFUNCTION(BlueprintCallable) - void UpdateChecpointWaypoint(FString WaypointDesc, FVector WaypointNewLoc); + void UpdateChecpointWaypoint(FVector WaypointNewLoc); // Called when the game starts or when spawned virtual void BeginPlay() override; @@ -53,7 +55,7 @@ public: UPROPERTY(BlueprintReadOnly, Category = "Checkpoint") bool Active = false; - void SpawnWaypoint(); + void SpawnWaypoint(const FString& BountyTitle); UFUNCTION(BlueprintImplementableEvent) void CheckpointActivated();