Implemented Bounty Rewards UI

This commit is contained in:
Rafal Swierczek 2024-02-28 22:35:28 +00:00
parent 3c1ff4412d
commit da0b5b516e
9 changed files with 25 additions and 13 deletions

Binary file not shown.

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c5f5f93dc4069790ac1279bfc1dbc24b241f2a133619d5818be629e28b7eab3d
size 526016
oid sha256:488def0310e09a50405d033f3c814c547dd56c68ac2c909a3a2a88200ca0d477
size 554299

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6b09feb9b8d78b3675fb5159f5400d568ae871b260ad185dfc216d4e55de460f
size 308710
oid sha256:78e28c42ac42a5669631ae881581ea94d84e5743b40145202a95def2a4bacebf
size 308758

View File

@ -56,7 +56,9 @@ void ABountyHunterCharacter::SpawnSideBounties(UEVGameInstance* GI)
void ABountyHunterCharacter::CompleteCurrentMainBounty(UEVGameInstance* GI)
{
EarnMoney(MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetRewardMoney());
int MoneyEarned = MainBountyClasses[CurrentMainBountyIndex]->GetDefaultObject<AMainBountyClass>()->GetRewardMoney();
EarnMoney(MoneyEarned);
BountyCompletedDisplay(MoneyEarned, 0);
if (IsValid(PauseMenu)) PauseMenu->UpdatePlayerStatistics(Money, Favours);
UE_LOG(LogTemp, Warning, TEXT("Would be collecting reward for completing bounty %d"), CurrentMainBountyIndex);
@ -81,6 +83,7 @@ void ABountyHunterCharacter::CompletedASideBounty(int CompletedSideBountiesUID)
if (SideBountyStructs[i].SideBountyUID != CompletedSideBountiesUID) continue;
EarnMoney(SideBountyStructs[i].MoneyEarnedForCompletion);
EarnFavours(SideBountyStructs[i].FavoursEarnedForCompletion);
BountyCompletedDisplay(SideBountyStructs[i].MoneyEarnedForCompletion, SideBountyStructs[i].FavoursEarnedForCompletion);
if (IsValid(PauseMenu)) PauseMenu->UpdatePlayerStatistics(Money, Favours);
TitleOfSideBountyToRemove = SideBountyStructs[i].BountyTitle;

View File

@ -93,8 +93,14 @@ protected:
// Called When Actor destroyed or Removed from Level
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
// Spawns Hold F to Access Bike UI in Open World Only
UFUNCTION(BlueprintImplementableEvent)
void SpawnBikeUI();
// Displays what rewards the player got after completing any bounty
UFUNCTION(BlueprintImplementableEvent)
void BountyCompletedDisplay(int MoneyEarned, int FavoursEarned);
public:
// Used by Final Checkpoint to always load the Level set as the Open Level in here
FString GetOpenWorldLevelName()