Merge branch 'PauseMenuTabs' into dev

# Conflicts:
#	EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
#	EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence1.uasset
#	EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence2.uasset
#	EndlessVendetta/Content/BountySystem/ApartmentBounty/CinematicFrmaes/TimothyEliminatedSequence3.uasset
#	EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
This commit is contained in:
Rafal Swierczek 2024-02-23 07:04:45 +00:00
commit 0012488f1d
110 changed files with 721 additions and 255 deletions

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:149144b6fd8ca68c9504252e87e3dea76145a975072f5f950a31628b7265bc5d
size 93434

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -16,9 +16,17 @@ void ABountyClass::ActivateFirstCheckpoint()
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) return;
BountyCheckpoints[0]->Active = true;
BountyCheckpoints[0]->SpawnWaypoint(BountyTitle);
BountyCheckpoints[0]->CheckpointActivated();
BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
CheckpointActivated.Broadcast(BountyCheckpoints[0]->GetCheckpointTip());
}
void ABountyClass::DeActivateFirstCheckpoint()
{
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) return;
BountyCheckpoints[0]->CompletedCheckpoint.RemoveDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
BountyCheckpoints[0]->Active = false;
BountyCheckpoints[0]->DestroyWaypoint();
}
void ABountyClass::SpawnCheckpoints()
@ -41,38 +49,10 @@ void ABountyClass::SpawnCheckpoints()
ACheckpointClass* SpawnedCheckpoint = Cast<ACheckpointClass>(GetWorld()->SpawnActor<AActor>(CheckpointClass, Loc, Rot, SpawnParameters));
BountyCheckpoints.Add(SpawnedCheckpoint);
}
ActivateFirstCheckpoint();
}
void ABountyClass::IncrementBountyCheckpoint()
{
// ---------------------------------------------------------------------------------------------------------------------
// Broadcast that the first Checkpoint has been completed so that side bounties can be destroyed
// if (!BountyStarted)
// {
// BountyStarted = true;
// CompletedFirstCheckpoint.Broadcast();
// }
//
// // Bounty Completion Condition
// if (BountyCheckpoints.Num() <= 1)
// {
// Completed = true;
// BountyCheckpoints[0]->Active = false;
// BountyCheckpoints[0]->Destroy();
// BountyCheckpoints.RemoveAt(0);
// UE_LOG(LogTemp, Warning, TEXT(" You've Completed the Bounty!! Well done"));
// return;
// }
//
// if (BountyCheckpoints[0] == nullptr)
// {
// UE_LOG(LogTemp, Fatal, TEXT("Missing checkpoint in bounty checkpoints, could've failed to spawn or cast"));
// return;
// }
//---------------------------------------------------------------------------------------------------------------------
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) return;
// Destroy Actor and Shrink Array

View File

@ -9,6 +9,7 @@
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedFirstCheckpoint);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedACheckpoint);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCheckpointActivated, const FString&, CheckpointTip);
UCLASS()
class ENDLESSVENDETTA_API ABountyClass : public AActor
@ -24,15 +25,26 @@ class ENDLESSVENDETTA_API ABountyClass : public AActor
protected:
// Array of References to the Spawned in Checkpoints for this Bounty
TArray<ACheckpointClass*> BountyCheckpoints;
// Money Rewarded to Player for Completing this Bounty
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
int RewardMoney = 0;
public:
FCompletedACheckpoint CompletedACheckpoint;
FCheckpointActivated CheckpointActivated;
// Gets the Reward Money for Completing this Bounty, used by Players Character
int GetRewardMoney()
{
return RewardMoney;
}
// ------------------- METHODS ---------------------------------
private:
// Activate the First Checkpoint in Bounty Checkpoints and Listen for its Completion
void ActivateFirstCheckpoint();
protected:
// Called when a checkpoint is completed, handles moving onto next checkpoint and discarding the old one
@ -44,9 +56,13 @@ public:
ABountyClass();
// Spawns and stores this Bounties Checkpoints in order
void SpawnCheckpoints();
virtual void SpawnCheckpoints();
// Activate the First Checkpoint in Bounty Checkpoints and Listen for its Completion
virtual void ActivateFirstCheckpoint();
// De-Activate the First Checkpoint in Bounty Checkpoints
virtual void DeActivateFirstCheckpoint();
@ -61,8 +77,7 @@ protected:
// ------- Properties Set in Editor --------------
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
int RewardMoney = 0;
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
FString BountyTitle;
@ -71,10 +86,6 @@ protected:
FString BountyDesc;
// -----------------------------------------------
public:
// Broadcast when first checkpoint from this bounty is completed
FCompletedFirstCheckpoint CompletedFirstCheckpoint;

View File

@ -68,7 +68,7 @@ void ABountyDirector::SpawnBountyAndItsSideBounties()
ASideBountyClass* SideBounty = Cast<ASideBountyClass>(SideBountyActor);
if (!IsValid(SideBounty)) UE_LOG(LogTemp, Fatal, TEXT("A SideBounty for %s has been set to a wrong type"), *ActiveBounty->GetBountyTitle());
int i = ActiveSideBounties.Add(SideBounty);
ActiveSideBounties[i]->CompletedSideBounty.AddDynamic(this, &ABountyDirector::EarnFavours);
// ActiveSideBounties[i]->CompletedSideBounty.AddDynamic(this, &ABountyDirector::EarnFavours);
// ONCE AGAIN WHEN MARCEL STOPS PLAYING WITH THE CHARACTER, ADD THIS SIDE BOUNTY TO PLAYERS ARRAY OF ACTIVE BOUNTIES!!!!!
}
}

View File

@ -9,24 +9,6 @@ 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 = "";
}
// Called when the game starts or when spawned
void ACheckpointClass::BeginPlay()
{
Super::BeginPlay();
}
void ACheckpointClass::SpawnWaypoint(const FString& CurrentBountyTitle)
{
if (!IsValid(WaypointActorClass) || HideWaypoint) return;
BountyTitle = CurrentBountyTitle;
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
WaypointActor = Cast<AWaypointActor>(GetWorld()->SpawnActor<AActor>(WaypointActorClass, WaypointLoc, GetActorRotation(), SpawnParams));
WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle);
}
void ACheckpointClass::UpdateCheckpointWaypoint(FVector WaypointNewLoc)
@ -40,17 +22,19 @@ void ACheckpointClass::UpdateCheckpointWaypoint(FVector WaypointNewLoc)
WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle);
}
// Called every frame
void ACheckpointClass::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void ACheckpointClass::Destroyed()
{
if (WaypointActor) WaypointActor->Destroy();
DestroyWaypoint();
Super::Destroyed();
}
void ACheckpointClass::SpawnWaypoint(const FString& CurrentBountyTitle)
{
if (!IsValid(WaypointActorClass) || HideWaypoint) return;
BountyTitle = CurrentBountyTitle;
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
WaypointActor = Cast<AWaypointActor>(GetWorld()->SpawnActor<AActor>(WaypointActorClass, WaypointLoc, GetActorRotation(), SpawnParams));
WaypointActor->SetupWaypoint(WaypointIcon, BountyTitle);
}

View File

@ -16,8 +16,7 @@ class ENDLESSVENDETTA_API ACheckpointClass : public AActor
{
GENERATED_BODY()
FString BountyTitle;
// ------------------- ATTRIBUTES ------------------------------
// ------ Properties set from Editor ------
UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
FString CheckpointTip;
@ -32,9 +31,25 @@ class ENDLESSVENDETTA_API ACheckpointClass : public AActor
UPROPERTY(EditDefaultsOnly, Category = "Checkpoint")
bool HideWaypoint = false;
// Stored Title of Bounty, used by Update Checkpoint Waypoint Func
FString BountyTitle;
// Ref to Waypoint Actor
AWaypointActor* WaypointActor;
// ----------------------------------------
protected:
public:
// Delegate called when Checkpoint is Completed
FCompletedCheckpoint CompletedCheckpoint;
// Used by Checkpoint BPs to Determine weather to Run Checkpoint Logic
UPROPERTY(BlueprintReadOnly, Category = "Checkpoint")
bool Active = false;
// ------------------- METHODS ---------------------------------
private:
protected:
// Used by Checkpoints BPs to broadcast that they're Completed
UFUNCTION(BlueprintCallable, Category = "Checkpoint")
void BroadcastCompletion()
{
@ -42,30 +57,44 @@ protected:
Cast<AEndlessVendettaGameMode>(GetWorld()->GetAuthGameMode())->SendEvent("Check", CheckpointTip);
}
// Used by Checkpoint BPs to update Checkpoint Loc without Finishing Checkpoint itself
UFUNCTION(BlueprintCallable)
void UpdateCheckpointWaypoint(FVector WaypointNewLoc);
// Called when the game starts or when spawned
virtual void BeginPlay() override;
void UpdateCheckpointWaypoint(FVector WaypointNewLoc);
// Used to Destroy any Waypoint Actor Associated with this Checkpoint when it's Destroyed
virtual void Destroyed() override;
public:
FCompletedCheckpoint CompletedCheckpoint;
UPROPERTY(BlueprintReadOnly, Category = "Checkpoint")
bool Active = false;
// Sets default values for this actor's properties
ACheckpointClass();
// Used by Bounties to Spawn Waypoint for this Checkpoint when it's Activated
void SpawnWaypoint(const FString& BountyTitle);
// Destroys Waypoint Associated with this Checkpoint if one Exists
void DestroyWaypoint()
{
if (WaypointActor) WaypointActor->Destroy();
}
// Used by Bounty Class to broadcast checkpoint tip for current checkpoint
FString GetCheckpointTip()
{
return CheckpointTip;
}
// ------------------- LEGACY ---------------------------------
public:
UFUNCTION(BlueprintImplementableEvent)
void CheckpointActivated();
// ------ Getters for CP Properties ------
FString GetCheckpointTip()
{
return CheckpointTip;
}
FVector GetWaypointLoc()
{
@ -81,12 +110,5 @@ public:
{
return CheckpointSpawnTransform;
}
// ---------------------------------------
// Sets default values for this actor's properties
ACheckpointClass();
// Called every frame
virtual void Tick(float DeltaTime) override;
};

View File

@ -12,7 +12,21 @@ void AMainBountyClass::IncrementBountyCheckpoint()
// Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->CheckpointCompletedUI("", false);
}
void AMainBountyClass::SpawnOpenWorldCheckpoint()
void AMainBountyClass::ActivateFirstCheckpoint()
{
Super::ActivateFirstCheckpoint();
if (IsValid(OpenWorldcheckpoint)) OpenWorldcheckpoint->SpawnWaypoint(MainBountyStruct.TargetName);
if (BountyCheckpoints.IsEmpty() || BountyCheckpoints[0] == nullptr) return;
BountyCheckpoints[0]->SpawnWaypoint(MainBountyStruct.TargetName);
}
void AMainBountyClass::DeActivateFirstCheckpoint()
{
Super::DeActivateFirstCheckpoint();
if (IsValid(OpenWorldcheckpoint)) OpenWorldcheckpoint->DestroyWaypoint();
}
void AMainBountyClass::SpawnOpenWorldCheckpoint()
{
if (!IsValid(OpenWorldCheckpointClass)) return;
@ -22,7 +36,13 @@ void AMainBountyClass::SpawnOpenWorldCheckpoint()
FRotator Rot = OpenWorldCheckpointClass.GetDefaultObject()->GetCheckpointSpawnTransform().GetRotation().Rotator();
OpenWorldcheckpoint = GetWorld()->SpawnActor<ACheckpointClass>(OpenWorldCheckpointClass, Loc, Rot, SpawnParameters);
OpenWorldcheckpoint->SpawnWaypoint(BountyTitle);
ActivateFirstCheckpoint();
}
void AMainBountyClass::SpawnCheckpoints()
{
Super::SpawnCheckpoints();
ActivateFirstCheckpoint();
}
@ -30,7 +50,9 @@ void AMainBountyClass::SpawnOpenWorldCheckpoint()
void AMainBountyClass::SpawnAmmoDrops()
void AMainBountyClass::SpawnAmmoDrops()
{
UE_LOG(LogTemp, Display, TEXT("Bought Ammo Drops, but its not implemented yet"));
// FActorSpawnParameters SpawnParameters;

View File

@ -7,9 +7,33 @@
#include "SideBountyClass.h"
#include "MainBountyClass.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FMainBountyStruct
{
GENERATED_BODY();
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
FString TargetName = "";
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
FString TargetDOB = "";
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
FString TargetOccupation = "";
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
FString TargetLocation = "";
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
FString BountyDescription = "";
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
UTexture2D* TargetPhoto = nullptr;
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly)
UTexture2D* Floorplan = nullptr;
};
UCLASS()
class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
{
@ -27,10 +51,16 @@ class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
FTransform PlayerSpawnTransform;
// Used to Spawn Side Bounties Associated with this Main Bounty
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
TArray<TSubclassOf<ASideBountyClass>> SideBountiesToSpawn;
protected:
public:
// Struct Containing all Data to be Displayed about the Main Bounty
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
FMainBountyStruct MainBountyStruct;
// ------------------- METHODS ---------------------------------
private:
@ -38,26 +68,43 @@ private:
void IncrementBountyCheckpoint() override;
protected:
public:
// Used by Bounty Char to Save and Spawn Side Bounties Unlocked by Activating this Main Bounty
TArray<TSubclassOf<ASideBountyClass>> GetAssociatedSideBounties()
{
return SideBountiesToSpawn;
}
// Spawns the Single Checkpoint in the Open World for this Main Bounty
void SpawnOpenWorldCheckpoint();
void SpawnCheckpoints() override;
// Used by Players Character to Determine where to Spawn in the Open World after Completing Main Bounty
FTransform GetPlayerSpawnTransform()
{
return PlayerSpawnTransform;
}
// Overrides to Set Title of Waypoint
void ActivateFirstCheckpoint() override;
// Overrides to Desapwn Waypoint from OpenWorld Checkpoint
void DeActivateFirstCheckpoint() override;
// Returns open world checkpoints tip
FString GetOpenWorldCheckpointTip()
{
return OpenWorldcheckpoint->GetCheckpointTip();
}
// ------------------- LEGACY CODE TO BE REWORKED ---------------------------------
protected:
UPROPERTY(EditDefaultsOnly, Category = "Bounty")
TArray<TSubclassOf<ASideBountyClass>> SideBountiesToSpawn;
// ---------------- Bounty Alterations ----------------
UPROPERTY(EditDefaultsOnly, Category = "Bounty")

Some files were not shown because too many files have changed in this diff Show More