diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h index 9f614102..88a6c5e7 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyClass.h @@ -66,7 +66,7 @@ public: return BountyDesc; } - int GetBountyreardMoney() + int GetBountyrewardMoney() { return RewardMoney; } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index ec65c7a5..4fa18855 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -201,11 +201,44 @@ void ABountyDirector::Interact() PlayerController->bEnableClickEvents = true; PlayerController->bEnableMouseOverEvents = true; - bool GO = IsValid(ActiveBounty); - - UPC_Display* PC_Display = Cast(PC_DisplayWidget); - PC_Display->PC_Display_Info.IsGameOver = true; - Cast(PC_DisplayWidget)->LoadOS(); + bool GameOver = IsValid(ActiveBounty); + PC_Display->PC_Display_Info.IsGameOver = GameOver; + + if (GameOver) return; + + // Info about main bounty + PC_Display->PC_Display_Info.MB_Title = GetBountyTitle(); + PC_Display->PC_Display_Info.MB_Icon = GetBountyIcon(); + PC_Display->PC_Display_Info.MB_Desc = GetBountyDescription(); + PC_Display->PC_Display_Info.MB_Reward = GetBountyReward(); + + // Info about side bounties + PC_Display->PC_Display_Info.SB_Title.Reset(); + PC_Display->PC_Display_Info.SB_Icon.Reset(); + PC_Display->PC_Display_Info.SB_Desc.Reset(); + PC_Display->PC_Display_Info.SB_Reward.Reset(); + for (ASideBountyClass* SideBounty : ActiveSideBounties) + { + if (!IsValid(SideBounty)) continue; + PC_Display->PC_Display_Info.SB_Title.Add(SideBounty->GetBountyTitle()); + PC_Display->PC_Display_Info.SB_Icon.Add(SideBounty->GetActiveWaypointIcon()); + PC_Display->PC_Display_Info.SB_Desc.Add(SideBounty->GetBountyDesc()); + PC_Display->PC_Display_Info.SB_Reward.Add(SideBounty->GetBountyrewardMoney()); + } + + // Info about main bounty alterations + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Reset(); + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Reset(); + + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Add(ActiveBounty->GetCustomBountyAlteration_1_Description()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Add(ActiveBounty->GetCustomBountyAlteration_2_Description()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Desc.Add(ActiveBounty->GetCustomBountyAlteration_3_Description()); + + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_1_Cost()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_2_Cost()); + PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_3_Cost()); + + PC_Display->LoadOS(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index cf36c427..790b7d1d 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -114,16 +114,7 @@ public: int GetBountyReward() { - return !IsValid(ActiveBounty) ? 0 : ActiveBounty->GetBountyreardMoney(); + return !IsValid(ActiveBounty) ? 0 : ActiveBounty->GetBountyrewardMoney(); } - FString GetSideBountyTitle(int SideBountyIndex) - { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyTitle(); - } - - FString GetSideBountyDescription(int SideBountyIndex) - { - return (SideBountyIndex > 2 || SideBountyIndex < 0 || !IsValid(ActiveSideBounties[SideBountyIndex])) ? FString("") : ActiveSideBounties[SideBountyIndex]->GetBountyDesc(); - } }; diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h index a539b84c..f2a3aca3 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/MainBountyClass.h @@ -21,22 +21,10 @@ protected: // ---------------- Bounty Alterations ---------------- UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_1_Description; + TArray CustomBountyAlteration_Description; UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_1_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_2_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_2_Cost = 2; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - FString CustomBountyAlteration_3_Description; - - UPROPERTY(EditDefaultsOnly, Category = "Bounty") - int CustomBountyAlteration_3_Cost = 2; + TArray CustomBountyAlteration_Cost; UPROPERTY(EditDefaultsOnly, Category = "Bounty") TArray AmmoDropSpawnTransforms; @@ -71,37 +59,37 @@ public: UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_1_Description() { - return CustomBountyAlteration_1_Description; + return CustomBountyAlteration_Description.IsEmpty() ? FString("") : CustomBountyAlteration_Description[0]; } UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_2_Description() { - return CustomBountyAlteration_2_Description; + return CustomBountyAlteration_Description.Num() < 1 ? FString("") : CustomBountyAlteration_Description[1]; } UFUNCTION(BlueprintCallable, Category = "Bounty") FString GetCustomBountyAlteration_3_Description() { - return CustomBountyAlteration_3_Description; + return CustomBountyAlteration_Description.Num() < 2 ? FString("") : CustomBountyAlteration_Description[2]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_1_Cost() { - return CustomBountyAlteration_1_Cost; + return CustomBountyAlteration_Cost.IsEmpty() ? 0 : CustomBountyAlteration_Cost[0]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_2_Cost() { - return CustomBountyAlteration_2_Cost; + return CustomBountyAlteration_Cost.Num() < 1 ? 0 : CustomBountyAlteration_Cost[1]; } UFUNCTION(BlueprintCallable, Category = "Bounty") int GetCustomBountyAlteration_3_Cost() { - return CustomBountyAlteration_3_Cost; + return CustomBountyAlteration_Cost.Num() < 2 ? 0 : CustomBountyAlteration_Cost[2]; } // ------------- Simple Bounty Alterations ------------- diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index 86c8579f..f8e50a38 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -27,16 +27,22 @@ struct FPC_Display_Info int MB_Reward; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - FString SB_1_Title; + TArray SB_Title; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - UTexture2D* SB_1_Icon; + TArray SB_Icon; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - FString SB_1_Desc; + TArray SB_Desc; UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") - int SB_1_Reward; + TArray SB_Reward; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + TArray CustomBountyAlteration_Desc; + + UPROPERTY(BlueprintReadWrite, Category = "PC_Display_Info") + TArray CustomBountyAlteration_Cost; }; UCLASS() @@ -50,6 +56,5 @@ public: UPROPERTY(BlueprintReadOnly) FPC_Display_Info PC_Display_Info; - //bool IsGameOver, FString& MB_Title, UTexture2D* MB_Icon, FString& MB_Desc, int MB_Reward };