diff --git a/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset b/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset index def3d97..3466999 100644 --- a/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset +++ b/Content/Blueprints/Merchant/Merchant_UI/BP_OPENDIAL.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea25a76832a591caa677a97dfac6c30e410974dd3c705d8923f3eea49dd79699 -size 74712 +oid sha256:b1fac66db3777a1f9169f558728f9968954f5f121ef112eb15fddf6f4e15975c +size 75696 diff --git a/Content/Blueprints/Merchant/Merchant_UI/BP_ShopSelector.uasset b/Content/Blueprints/Merchant/Merchant_UI/BP_ShopSelector.uasset index 737ca7e..555d903 100644 --- a/Content/Blueprints/Merchant/Merchant_UI/BP_ShopSelector.uasset +++ b/Content/Blueprints/Merchant/Merchant_UI/BP_ShopSelector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:61982627878a3fa5f5f433ddc2b2d1d781e18c0008d224fabb54388476f50915 -size 52764 +oid sha256:bb8747465ea11ce180bdba25539e7625e09e20685688b6302fe79bdd522d8fc6 +size 56996 diff --git a/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyBuff.uasset b/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyBuff.uasset index a711020..3ab4f71 100644 --- a/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyBuff.uasset +++ b/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyBuff.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f02d6f1b555bbb983a74a2a4534e22e262373f525b0f96234c48aa8a77c11f68 -size 64594 +oid sha256:dce75c5956fa2330472c7c6130d3aa37c8caad8c0bbfb75aab34e3313d3d2a5c +size 68696 diff --git a/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyHealing.uasset b/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyHealing.uasset index c2a8aca..c521a6f 100644 --- a/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyHealing.uasset +++ b/Content/Blueprints/Merchant/Merchant_UI/WBP_BuyHealing.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09dda50c557dcf82fb79de0a80551d3d6d838074015a7437f0c50e6a74e24ed6 -size 68084 +oid sha256:56186ac7df1d92f8e57d4ccc87f80187e3e4fd090de6a261a15f193b7dd54939 +size 69067 diff --git a/Content/Images/MerchantUI/BLCK_ArrowLeftFilled.uasset b/Content/Images/MerchantUI/BLCK_ArrowLeftFilled.uasset new file mode 100644 index 0000000..edb8fa3 --- /dev/null +++ b/Content/Images/MerchantUI/BLCK_ArrowLeftFilled.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94df9caa7916cb5e2f57f3f3ed597f4b8a2d77acfd2d1d695295fe9ddf09dcde +size 21284 diff --git a/Content/Images/MerchantUI/BLCK_ArrowLeftHollow.uasset b/Content/Images/MerchantUI/BLCK_ArrowLeftHollow.uasset new file mode 100644 index 0000000..4a29314 --- /dev/null +++ b/Content/Images/MerchantUI/BLCK_ArrowLeftHollow.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9cd6abe6bd1809efec8fbd89358c41e45b70dc685b76f01c44fa4e5d90186fd +size 44177 diff --git a/Content/Images/MerchantUI/BLCK_ArrowLeftShadowFilled.uasset b/Content/Images/MerchantUI/BLCK_ArrowLeftShadowFilled.uasset new file mode 100644 index 0000000..42dc7c2 --- /dev/null +++ b/Content/Images/MerchantUI/BLCK_ArrowLeftShadowFilled.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:304bda79b7076bc1e1d996ac51f8df1435ca4abbc2036c1c6e153a43c7468ff8 +size 47254 diff --git a/Content/Images/MerchantUI/BLCK_ArrowRightFilled.uasset b/Content/Images/MerchantUI/BLCK_ArrowRightFilled.uasset new file mode 100644 index 0000000..eae34c7 --- /dev/null +++ b/Content/Images/MerchantUI/BLCK_ArrowRightFilled.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:516dd005d4b3c1b1b8f3adfc8778c5da60d2535e1d4d054c159fd448d65d4d9b +size 21196 diff --git a/Content/Images/MerchantUI/BLCK_ArrowRightFilledShadow.uasset b/Content/Images/MerchantUI/BLCK_ArrowRightFilledShadow.uasset new file mode 100644 index 0000000..09de161 --- /dev/null +++ b/Content/Images/MerchantUI/BLCK_ArrowRightFilledShadow.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cac5340e1a58d5f49a290d63e2a0a892e8d43ab0b05171f30fe4c36054129c2c +size 46502 diff --git a/Content/Images/MerchantUI/BLCK_ArrowRightHollowi.uasset b/Content/Images/MerchantUI/BLCK_ArrowRightHollowi.uasset new file mode 100644 index 0000000..efb3922 --- /dev/null +++ b/Content/Images/MerchantUI/BLCK_ArrowRightHollowi.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de3e6f519363db918568ea4c3595a235b86d3b16a12011fe45de667f2045dc03 +size 44261 diff --git a/Content/Images/MerchantUI/BuyShadow.uasset b/Content/Images/MerchantUI/BuyShadow.uasset new file mode 100644 index 0000000..31bd8ea --- /dev/null +++ b/Content/Images/MerchantUI/BuyShadow.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56c38ad0e18cf413b73482acadaeb7ca996a1e2fc4961405c23779a19b1ae6f1 +size 120727 diff --git a/Content/Images/MerchantUI/BuyUI.uasset b/Content/Images/MerchantUI/BuyUI.uasset new file mode 100644 index 0000000..5d95f45 --- /dev/null +++ b/Content/Images/MerchantUI/BuyUI.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b978eddef5bbef43186879df7f382388714d9b905a3e2d104eedb3b16dd9a8ce +size 67890 diff --git a/Content/Images/MerchantUI/CancelShadow.uasset b/Content/Images/MerchantUI/CancelShadow.uasset new file mode 100644 index 0000000..38beebb --- /dev/null +++ b/Content/Images/MerchantUI/CancelShadow.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fee0b73cd4e77f48e1eef49859d02a28f36487ef98c0257016eddb648ecf1607 +size 115863 diff --git a/Content/Images/MerchantUI/CancelUi.uasset b/Content/Images/MerchantUI/CancelUi.uasset new file mode 100644 index 0000000..87efbca --- /dev/null +++ b/Content/Images/MerchantUI/CancelUi.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dedb8be65656f3a98d3457e8938407248c1cfa637e2fe5c7d691eaaf42efa1da +size 67578 diff --git a/Content/Images/MerchantUI/DialiougeBox.uasset b/Content/Images/MerchantUI/DialiougeBox.uasset new file mode 100644 index 0000000..7883bfe --- /dev/null +++ b/Content/Images/MerchantUI/DialiougeBox.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41870ae0bdeb52a9478a5c278d6d021c1bf2d596b55043e086b8087ffd861aa3 +size 34467 diff --git a/Content/Images/MerchantUI/ExitButtonBlack.uasset b/Content/Images/MerchantUI/ExitButtonBlack.uasset new file mode 100644 index 0000000..914d1c7 --- /dev/null +++ b/Content/Images/MerchantUI/ExitButtonBlack.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:204eaf20a858df1c5ea83ad3ecd93b61236dd63a402aea1301305bd78f198980 +size 56945 diff --git a/Content/Images/MerchantUI/ExitShadow.uasset b/Content/Images/MerchantUI/ExitShadow.uasset new file mode 100644 index 0000000..db02e5a --- /dev/null +++ b/Content/Images/MerchantUI/ExitShadow.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40eccaa4951e21dcbda542830d1040a5abab8d7821929b6264b1e36103abc265 +size 96251 diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index b8e098f..a73fc54 100644 --- a/Content/Levels/Build.umap +++ b/Content/Levels/Build.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:19bf2aa33e6f21589ff61f413acddfc65dc257f7add19727134083ccaf30b1fd -size 3654662 +oid sha256:31ca0ab77e13884d871763a5bd4d60f44f94f078470cb5d68eff284fce510ae3 +size 3655823 diff --git a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h index de0964b..2cdcf5c 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h +++ b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h @@ -76,7 +76,7 @@ public: class UInventoryComponent* StoredItems; //The buy class to purchase the item - virtual void Buy(class ATempCharacter* PurchaseItem) PURE_VIRTUAL(UBaseItem); // WILL SET THIS UP LATER + virtual void Buy(class ATempCharacter* BuyItem) PURE_VIRTUAL(UBaseItem); // WILL SET THIS UP LATER //The use Item class to use the item in the player Inventory virtual void Use(class ATempCharacter* Character); diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp index a3ee695..e9dbe65 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp @@ -25,8 +25,8 @@ void AInteraction::BeginPlay() Super::BeginPlay(); //Character & Camera refs - if (TempCharacterRef != nullptr) TempCharacterRef = Cast(GetWorld()->GetFirstPlayerController()->GetCharacter()); - if (MainCamera != nullptr) MainCamera = Cast(TempCharacterRef->FindComponentByClass()); + TempCharacterRef = Cast(GetWorld()->GetFirstPlayerController()->GetCharacter()); + MainCamera = Cast(TempCharacterRef->FindComponentByClass()); //Item refs TargetHealingLocation = HealingItem->GetActorLocation(); @@ -130,7 +130,14 @@ void AInteraction::CameraLeftMover() UE_LOG(LogTemp, Display, TEXT("Button Left is being pressed")); if (TempCharacterRef == nullptr || BuyHealingProperty == nullptr) { - UE_LOG(LogTemp, Display, TEXT("Character not found in Interaction.cpp")); + if (TempCharacterRef == nullptr) + { + UE_LOG(LogTemp, Display, TEXT("Character not found in Interaction.cpp")); + } + else if (BuyHealingProperty == nullptr) + { + UE_LOG(LogTemp, Display, TEXT("HealingItem Not Found")); + } return; } else diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index 77c5aa7..644df2d 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -271,19 +271,27 @@ void ATempCharacter::UseItem(class UBaseItem* Item) void ATempCharacter::BuyItem(AActor* Item) { - UE_LOG(LogTemp, Display, TEXT("Hit Merchant")); - auto ItemArray = Item->FindComponentByClass()->GetItem(0); - if (GoldBalance <= 0) + if (Item == nullptr) { - UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); + UE_LOG(LogTemp, Display, TEXT("Item is null")); + return; } - else if (GoldBalance >= ItemArray->ItemCostPrice) + else { - GoldBalance -= ItemArray->ItemCostPrice; - Inventory->AddItem(ItemArray); - UE_LOG(LogTemp, Display, TEXT("Item Purchased")); + UBaseItem* ItemArray = Item->FindComponentByClass()->GetItem(0); + if (GoldBalance <= 0) + { + UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); + } + else if (GoldBalance >= ItemArray->ItemCostPrice) + { + GoldBalance -= ItemArray->ItemCostPrice; + Inventory->AddItem(ItemArray); + UE_LOG(LogTemp, Display, TEXT("Item Purchased")); + } + UE_LOG(LogTemp, Display, TEXT("BUY ITEM FIRING")); + TraceDistance = 1000; + LineTraceLogic(); } - // UE_LOG(LogTemp, Display, TEXT("BUY ITEM FIRING")); - // TraceDistance = 1000; - // LineTraceLogic(); + }