diff --git a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset index d93799c6..c5d78681 100644 --- a/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset +++ b/EndlessVendetta/Content/BountySystem/BountyDirector/WBP_PC_Display.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:13c33ca82184ce691baedd731c38c0cb26674a52fa498cfeed21268ef352e0c2 -size 1059571 +oid sha256:e18f1c5b5a87200f0a39ce1a55e9b8e5f1def9f890d5974e8fe5c767efe868d3 +size 1025165 diff --git a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset index fff63939..f805cb3d 100644 --- a/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset +++ b/EndlessVendetta/Content/BountySystem/TestBounties/FavourSystemBountyTest/MainBounty/MB_TestBounty.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e520486c08be16c37c2a57ef464db44baa0bfba73be3fa2e2ffe00891adc5961 -size 23685 +oid sha256:27d63c0acfd4fdceacc37b252fac625161c9feddfe9b2ccaeff6b4e84f1d9857 +size 25558 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index e549ad7a..75d4ae39 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -131,7 +131,7 @@ void ABountyDirector::BuyCustomBountyAlteration_1() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_1_Cost(); - if (Favours < Cost) return; + if (Cost == 0 || Favours < Cost) return; Favours -= Cost; ActiveBounty->BuyCustomBountyAlteration_1(); } @@ -141,7 +141,7 @@ void ABountyDirector::BuyCustomBountyAlteration_2() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_2_Cost(); - if (Favours < Cost) return; + if (Cost == 0 || Favours < Cost) return; Favours -= Cost; ActiveBounty->BuyCustomBountyAlteration_2(); } @@ -150,7 +150,7 @@ void ABountyDirector::BuyCustomBountyAlteration_3() { if (!IsValid(ActiveBounty)) return; int Cost = ActiveBounty->GetCustomBountyAlteration_3_Cost(); - if (Favours < Cost) return; + if (Cost == 0 || Favours < Cost) return; Favours -= Cost; ActiveBounty->BuyCustomBountyAlteration_3(); } @@ -245,6 +245,9 @@ void ABountyDirector::Interact() PC_Display->PC_Display_Info.CustomBountyAlteration_Cost.Add(ActiveBounty->GetCustomBountyAlteration_3_Cost()); PC_Display->PC_Display_Info.PlayersFavourAmount = Favours; + + // Button Delegates + PC_Display->BuyCba_1.AddDynamic(this, &ABountyDirector::BuyCustomBountyAlteration_1); PC_Display->LoadOS(); } diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 5469ddc1..a2a64d45 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -53,7 +53,7 @@ class ENDLESSVENDETTA_API ABountyDirector : public AInteractableActor void Interact() override; protected: - int Favours = 0; + int Favours = 20; // Called when the game starts or when spawned virtual void BeginPlay() override; @@ -71,7 +71,7 @@ protected: UFUNCTION() void EarnFavours(int FavoursEarned); - UFUNCTION(BlueprintCallable, Category = "Bounty Director") + UFUNCTION() void BuyCustomBountyAlteration_1(); UFUNCTION(BlueprintCallable, Category = "Bounty Director") diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h index 49b7ae9b..0a2df784 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/PC_Display.h @@ -46,6 +46,7 @@ struct FPC_Display_Info }; DECLARE_DYNAMIC_MULTICAST_DELEGATE(FLogoutFromBountyDirectorPC); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBuyCBA_1); UCLASS() class ENDLESSVENDETTA_API UPC_Display : public UUserWidget @@ -60,10 +61,12 @@ protected: public: FLogoutFromBountyDirectorPC LogoutFromBountyDirectorPC; - + UPROPERTY(BlueprintCallable, Category = PC_Display) + FBuyCBA_1 BuyCba_1; + UPROPERTY(BlueprintReadOnly) FPC_Display_Info PC_Display_Info; - + UFUNCTION(BlueprintImplementableEvent, Category = "PC_Display") void LoadOS();