Reworked and Reimplemented Checkpoint Tips

This commit is contained in:
Rafal Swierczek 2024-02-23 05:11:17 +00:00
parent 9a2a365528
commit d46bc7e45f
16 changed files with 59 additions and 18 deletions

View File

@ -9,12 +9,16 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="dfa3053d-1d51-4dad-9270-4c17e086f627" name="Changes" comment=""> <list default="true" id="dfa3053d-1d51-4dad-9270-4c17e086f627" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EndlessVendetta/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Content/Levels/MainMenuLevel.umap" beforeDir="false" afterPath="$PROJECT_DIR$/Content/Levels/MainMenuLevel.umap" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Architecture/Floor_400x400.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Architecture/Floor_400x400.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset" beforeDir="false" afterPath="$PROJECT_DIR$/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/BountyClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/BountyClass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/BountyClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/BountyClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/CheckpointClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/CheckpointClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/BountySystem/MainBountyClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/Characters/BountyHunterCharacter.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Source/EndlessVendetta/MainSaveGameClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/Source/EndlessVendetta/MainSaveGameClass.h" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -146,7 +150,8 @@
<workItem from="1708180486567" duration="2641000" /> <workItem from="1708180486567" duration="2641000" />
<workItem from="1708269543495" duration="2914000" /> <workItem from="1708269543495" duration="2914000" />
<workItem from="1708434176965" duration="6053000" /> <workItem from="1708434176965" duration="6053000" />
<workItem from="1708607826264" duration="9842000" /> <workItem from="1708607826264" duration="10102000" />
<workItem from="1708654928143" duration="5419000" />
</task> </task>
<servers /> <servers />
</component> </component>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:fa952eb25972ab6e6dca1d46cf254f62d1684ba665ee45a7c3d6a8e3527ffac1 oid sha256:ce714c1367e0d2d8ef9fce14d5f34b7544d6b549f014dc1059dd51a3375ee080
size 308710 size 308710

View File

@ -17,6 +17,7 @@ void ABountyClass::ActivateFirstCheckpoint()
BountyCheckpoints[0]->Active = true; BountyCheckpoints[0]->Active = true;
BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint); BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
CheckpointActivated.Broadcast(BountyCheckpoints[0]->GetCheckpointTip());
} }
void ABountyClass::DeActivateFirstCheckpoint() void ABountyClass::DeActivateFirstCheckpoint()

View File

@ -9,6 +9,7 @@
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedFirstCheckpoint); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedFirstCheckpoint);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedACheckpoint); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedACheckpoint);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCheckpointActivated, const FString&, CheckpointTip);
UCLASS() UCLASS()
class ENDLESSVENDETTA_API ABountyClass : public AActor class ENDLESSVENDETTA_API ABountyClass : public AActor
@ -32,6 +33,8 @@ protected:
public: public:
FCompletedACheckpoint CompletedACheckpoint; FCompletedACheckpoint CompletedACheckpoint;
FCheckpointActivated CheckpointActivated;
// Gets the Reward Money for Completing this Bounty, used by Players Character // Gets the Reward Money for Completing this Bounty, used by Players Character
int GetRewardMoney() int GetRewardMoney()
{ {

View File

@ -76,7 +76,11 @@ public:
if (WaypointActor) WaypointActor->Destroy(); if (WaypointActor) WaypointActor->Destroy();
} }
// Used by Bounty Class to broadcast checkpoint tip for current checkpoint
FString GetCheckpointTip()
{
return CheckpointTip;
}
@ -90,10 +94,7 @@ public:
// ------ Getters for CP Properties ------ // ------ Getters for CP Properties ------
FString GetCheckpointTip()
{
return CheckpointTip;
}
FVector GetWaypointLoc() FVector GetWaypointLoc()
{ {

View File

@ -94,6 +94,12 @@ public:
// Overrides to Desapwn Waypoint from OpenWorld Checkpoint // Overrides to Desapwn Waypoint from OpenWorld Checkpoint
void DeActivateFirstCheckpoint() override; void DeActivateFirstCheckpoint() override;
// Returns open world checkpoints tip
FString GetOpenWorldCheckpointTip()
{
return OpenWorldcheckpoint->GetCheckpointTip();
}
// ------------------- LEGACY CODE TO BE REWORKED --------------------------------- // ------------------- LEGACY CODE TO BE REWORKED ---------------------------------

View File

@ -20,13 +20,15 @@ void ABountyHunterCharacter::SpawnMainBounty(UEVGameInstance* GI)
CurrentMainBounty = GetWorld()->SpawnActor<AMainBountyClass>(MainBountyClasses[CurrentMainBountyIndex]); CurrentMainBounty = GetWorld()->SpawnActor<AMainBountyClass>(MainBountyClasses[CurrentMainBountyIndex]);
const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true); const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, true);
CurrentMainBounty->AttachToComponent(GetRootComponent(), AttachmentTransformRules); CurrentMainBounty->AttachToComponent(GetRootComponent(), AttachmentTransformRules);
CurrentMainBounty->CheckpointActivated.AddDynamic(this, &ABountyHunterCharacter::DisplayCheckpointTip);
MainBountyStruct = CurrentMainBounty->MainBountyStruct; MainBountyStruct = CurrentMainBounty->MainBountyStruct;
if (UGameplayStatics::GetCurrentLevelName(GetWorld()) != OpenWorldLevelName) if (UGameplayStatics::GetCurrentLevelName(GetWorld()) != OpenWorldLevelName)
{ {
CurrentMainBounty->SpawnCheckpoints(); CurrentMainBounty->SpawnCheckpoints();
return; return;
} }
CurrentMainBounty->SpawnOpenWorldCheckpoint(); CurrentMainBounty->SpawnOpenWorldCheckpoint();
TrackMainBounty();
} }
void ABountyHunterCharacter::SpawnSideBounties(UEVGameInstance* GI) void ABountyHunterCharacter::SpawnSideBounties(UEVGameInstance* GI)
@ -39,6 +41,7 @@ void ABountyHunterCharacter::SpawnSideBounties(UEVGameInstance* GI)
SpawnedSideBounty->AttachToComponent(GetRootComponent(), AttachmentTransformRules); SpawnedSideBounty->AttachToComponent(GetRootComponent(), AttachmentTransformRules);
SpawnedSideBounty->SpawnCheckpoints(); SpawnedSideBounty->SpawnCheckpoints();
CurrentSideBounties.Add(SpawnedSideBounty); CurrentSideBounties.Add(SpawnedSideBounty);
SpawnedSideBounty->CheckpointActivated.AddDynamic(this, &ABountyHunterCharacter::DisplayCheckpointTip);
} }
SideBountyStructs.Empty(); SideBountyStructs.Empty();
@ -47,6 +50,8 @@ void ABountyHunterCharacter::SpawnSideBounties(UEVGameInstance* GI)
SideBountyStructs.Add(SideBounty->SideBountyStruct); SideBountyStructs.Add(SideBounty->SideBountyStruct);
SideBounty->CompletedSideBounty.AddDynamic(this, &ABountyHunterCharacter::CompletedASideBounty); SideBounty->CompletedSideBounty.AddDynamic(this, &ABountyHunterCharacter::CompletedASideBounty);
} }
if (!IsValid(CurrentMainBounty)) DisplayCheckpointTip("SELECT A NEW BOUNTY IN PAUSE MENU");
} }
void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI) void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI)
@ -81,6 +86,7 @@ void ABountyHunterCharacter::CompletedASideBounty(int CompletedSideBountiesUID)
TitleOfSideBountyToRemove = SideBountyStructs[i].BountyTitle; TitleOfSideBountyToRemove = SideBountyStructs[i].BountyTitle;
SideBountyStructs.RemoveAt(i); SideBountyStructs.RemoveAt(i);
UpdateBountyTabInfo(); UpdateBountyTabInfo();
DisplayCheckpointTip("SELECT A NEW BOUNTY IN PAUSE MENU");
break; break;
} }
@ -107,6 +113,7 @@ void ABountyHunterCharacter::SavePlayerMoneyAndFavours()
void ABountyHunterCharacter::BeginPlay() void ABountyHunterCharacter::BeginPlay()
{ {
Super::BeginPlay();
UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance()); UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (IsValid(GI->MainSaveGameInstanceRef)) if (IsValid(GI->MainSaveGameInstanceRef))
{ {
@ -122,7 +129,6 @@ void ABountyHunterCharacter::BeginPlay()
} }
} }
CreatePauseMenuTabs(); CreatePauseMenuTabs();
Super::BeginPlay();
} }
void ABountyHunterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) void ABountyHunterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)

View File

@ -84,6 +84,9 @@ protected:
// Called When Player Spawns // Called When Player Spawns
virtual void BeginPlay() override; virtual void BeginPlay() override;
UFUNCTION(BlueprintImplementableEvent)
void DisplayCheckpointTip(const FString& NewCheckpointTip);
// Overridden to Setup up Pause Menu Inputs // Overridden to Setup up Pause Menu Inputs
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
@ -271,6 +274,7 @@ private:
{ {
DeActivateAllBounties(); DeActivateAllBounties();
CurrentMainBounty->ActivateFirstCheckpoint(); CurrentMainBounty->ActivateFirstCheckpoint();
DisplayCheckpointTip(CurrentMainBounty->GetOpenWorldCheckpointTip());
} }
UFUNCTION() UFUNCTION()