From 6ec77ff20247869152a98afc8899f1d1f40dd3e6 Mon Sep 17 00:00:00 2001 From: sharon2pan <156145910+sharon2pan@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:07:47 -0400 Subject: [PATCH] save/load souls, inventory items --- .../BP_HYPlayerCharacController.uasset | 4 +-- .../BP_PlayerCharacterBase.uasset | 4 +-- .../ItemBP/BP_DragDropCraftOperation.uasset | 2 +- .../Hwanyoung/Interactables/BP_Save.uasset | 4 +-- .../Interactables/ItemDataTable.uasset | 4 +-- .../Crafting_HUD/BP_CookingHUDWidget.uasset | 3 +++ .../Crafting_HUD/BP_CraftingHUDWidget.uasset | 4 +-- .../Crafting_HUD/BP_CraftingItemSlot.uasset | 4 +-- .../Hwanyoung/UI/Images/HUD_cooking.uasset | 3 +++ .../Hwanyoung/UI/Images/HUD_crafting.uasset | 3 +++ .../Assets/Combat/Buff_Haesol.uasset | 4 +-- .../Illusions/Assets/Combat/Creak_1.uasset | 4 +-- .../Illusions/Assets/Combat/Creak_2.uasset | 2 +- .../Assets/Combat/Water_arrow_trail3.uasset | 4 +-- .../Combat/Water_arrow_trail_version_4.uasset | 4 +-- .../Assets/ExplosionBlast_S08WA_111.uasset | 4 +-- .../Illusions/Assets/Sword_block_2.uasset | 4 +-- .../Illusions/Assets/bow_string.uasset | 2 +- .../Content/NewPreviewMeshCollection.uasset | 3 --- hwanyoung2/Source/hwanyoung2/CraftingInfo.h | 25 ++++++++++++++++--- .../hwanyoung2/HYPlayerCharacController.cpp | 17 ++++++++----- .../hwanyoung2/HYPlayerCharacController.h | 2 +- 22 files changed, 70 insertions(+), 40 deletions(-) create mode 100644 hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CookingHUDWidget.uasset create mode 100644 hwanyoung2/Content/Hwanyoung/UI/Images/HUD_cooking.uasset create mode 100644 hwanyoung2/Content/Hwanyoung/UI/Images/HUD_crafting.uasset delete mode 100644 hwanyoung2/Content/NewPreviewMeshCollection.uasset diff --git a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset index 13be95dd..8c63c7ef 100644 --- a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset +++ b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9705dda36e481d470905577e0263ecf12cc58df7a3bbc6dedb3b828b5c67b978 -size 175316 +oid sha256:b8f0cb2fbd74206794750300fcc303a2693f1e41d7ff49cd78fd15e9427f782c +size 212887 diff --git a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset index 744601c2..aa000e7b 100644 --- a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset +++ b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0f6944c8ea44dcefc9c569afd2fd618d5784142ef62b0db06ea08320c005972 -size 283982 +oid sha256:b5e46553db0de5aa1efd26695f6edbd3a1d69166f17eb235edfe096bc197cd83 +size 282630 diff --git a/hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_DragDropCraftOperation.uasset b/hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_DragDropCraftOperation.uasset index 63641f9b..5f848ee1 100644 --- a/hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_DragDropCraftOperation.uasset +++ b/hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_DragDropCraftOperation.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df35cf599838c4be2db4b1feeedc77f0f8d196837dc71bb5a68673354e5fa30a +oid sha256:102f0c24d982779336b87a8af8e101cfe1664f245932e1a954f03aa42ba88a85 size 10695 diff --git a/hwanyoung2/Content/Hwanyoung/Interactables/BP_Save.uasset b/hwanyoung2/Content/Hwanyoung/Interactables/BP_Save.uasset index 7c8e2e2f..eea3b97e 100644 --- a/hwanyoung2/Content/Hwanyoung/Interactables/BP_Save.uasset +++ b/hwanyoung2/Content/Hwanyoung/Interactables/BP_Save.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c95912c765093f13be3f8ebe4d5340c4ef1afd15eff1ef11d568f6b3567fdc72 -size 9314 +oid sha256:b88f8e8c2800196f99b340b29b21385b82c04dcaf3ca04f67e520c3b5732db27 +size 13623 diff --git a/hwanyoung2/Content/Hwanyoung/Interactables/ItemDataTable.uasset b/hwanyoung2/Content/Hwanyoung/Interactables/ItemDataTable.uasset index a17b0ffd..467d4f68 100644 --- a/hwanyoung2/Content/Hwanyoung/Interactables/ItemDataTable.uasset +++ b/hwanyoung2/Content/Hwanyoung/Interactables/ItemDataTable.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ed7339417e262ac9bf331b8b5b597f2d4ccd2b6f3d016f17a922c9e384610a0 -size 14292 +oid sha256:13c9c5bd8311aba659acd275c84b9bc885a929dee646be08afcce84f28587703 +size 14555 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CookingHUDWidget.uasset b/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CookingHUDWidget.uasset new file mode 100644 index 00000000..fa0398a0 --- /dev/null +++ b/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CookingHUDWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dd32cf5a354c0af6f8eae6acbe7d88081a513cdeb8b533c74939a71d6ec9d77 +size 118503 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingHUDWidget.uasset b/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingHUDWidget.uasset index adb48db6..4918bec7 100644 --- a/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingHUDWidget.uasset +++ b/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingHUDWidget.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:85c076aa7bdb63cb1056759df055aa15a463d19bcd2afcbcdeef10254aa60f83 -size 97492 +oid sha256:e14e8501f14481282a4859d1f899f59de295a650125edc8411e5d190a64411d6 +size 161440 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingItemSlot.uasset b/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingItemSlot.uasset index f79284bc..270a9185 100644 --- a/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingItemSlot.uasset +++ b/hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingItemSlot.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e94f339dc09d02617e2ef88e4c5eba7699153c9a9323cc449ddbb0edacf4647 -size 157242 +oid sha256:bd9e9a8562ad7ad740386afbcda0e80a14ef91030231f1dcae2c4f906e099436 +size 158937 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Images/HUD_cooking.uasset b/hwanyoung2/Content/Hwanyoung/UI/Images/HUD_cooking.uasset new file mode 100644 index 00000000..0c1098e9 --- /dev/null +++ b/hwanyoung2/Content/Hwanyoung/UI/Images/HUD_cooking.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:474ea9ece99a3a79319fa4c1e36a244f0b5e5ba07388dfb116a2e323cf665468 +size 1487638 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Images/HUD_crafting.uasset b/hwanyoung2/Content/Hwanyoung/UI/Images/HUD_crafting.uasset new file mode 100644 index 00000000..c864be03 --- /dev/null +++ b/hwanyoung2/Content/Hwanyoung/UI/Images/HUD_crafting.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e82f4e6f4e8c2d4aabd409399d024f5e7d1b28ab88f92bc78ec00080d6753a6a +size 1785204 diff --git a/hwanyoung2/Content/Illusions/Assets/Combat/Buff_Haesol.uasset b/hwanyoung2/Content/Illusions/Assets/Combat/Buff_Haesol.uasset index a5f44b31..ecd235ad 100644 --- a/hwanyoung2/Content/Illusions/Assets/Combat/Buff_Haesol.uasset +++ b/hwanyoung2/Content/Illusions/Assets/Combat/Buff_Haesol.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21f7134d4d1b02b644a25da180a1d6ee4f674c868fd1d2db6ce78cf70b62a4b7 -size 430316 +oid sha256:5edf58fee554c69188771bf8c56e3cebe477f89657b699a23737ccdf2f08fa0d +size 430258 diff --git a/hwanyoung2/Content/Illusions/Assets/Combat/Creak_1.uasset b/hwanyoung2/Content/Illusions/Assets/Combat/Creak_1.uasset index fd6d53b1..d9234438 100644 --- a/hwanyoung2/Content/Illusions/Assets/Combat/Creak_1.uasset +++ b/hwanyoung2/Content/Illusions/Assets/Combat/Creak_1.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b5da15d357c3734d5246ba5ad1ead1c22970cb1de93e9c9d1eb01fb807df36d -size 61107 +oid sha256:196a46762f72b7f7387a416121f4e5aa8b4bcf6ebd30e5c1206dba7c2bc4fe13 +size 61136 diff --git a/hwanyoung2/Content/Illusions/Assets/Combat/Creak_2.uasset b/hwanyoung2/Content/Illusions/Assets/Combat/Creak_2.uasset index f793a004..cf734841 100644 --- a/hwanyoung2/Content/Illusions/Assets/Combat/Creak_2.uasset +++ b/hwanyoung2/Content/Illusions/Assets/Combat/Creak_2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:947ee1eb1e919a9a1e36c49c2195c466c677ab91904053eed24d279a7dbf5df9 +oid sha256:3971d93a9f17526c506065c1ddf74d18b188a7281e298c6cd4d3e424d2fc0c65 size 74360 diff --git a/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail3.uasset b/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail3.uasset index 40ac3e8b..154882c2 100644 --- a/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail3.uasset +++ b/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail3.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e2477f184a984cd5a9f55355e9033ae97bd783203c4c5efdc4e946400a286ec -size 252643 +oid sha256:39a99428e94d764b7fb275adf3ac1b8441b46ac310081483fc7b180b310be2c2 +size 252662 diff --git a/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail_version_4.uasset b/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail_version_4.uasset index df8d291e..d2495e06 100644 --- a/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail_version_4.uasset +++ b/hwanyoung2/Content/Illusions/Assets/Combat/Water_arrow_trail_version_4.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc7b34fa83a97eecd7a3e61322f706da362091f771f5623286bf27238e11a6af -size 100142 +oid sha256:9435350b4ae88f3cb43ceaaaa01794ff8cc48f72343805546335f209dd961ff2 +size 100152 diff --git a/hwanyoung2/Content/Illusions/Assets/ExplosionBlast_S08WA_111.uasset b/hwanyoung2/Content/Illusions/Assets/ExplosionBlast_S08WA_111.uasset index 3c722eae..52dec99e 100644 --- a/hwanyoung2/Content/Illusions/Assets/ExplosionBlast_S08WA_111.uasset +++ b/hwanyoung2/Content/Illusions/Assets/ExplosionBlast_S08WA_111.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ffcd45da981b6fa1e554ff2b8e055a06edcd2d0714a1a6d88056a303ea005d8 -size 1156131 +oid sha256:5d7b66546887513755ccf3c4157ec16d7d1f9baeea28381eb43d73ddb0183015 +size 1156058 diff --git a/hwanyoung2/Content/Illusions/Assets/Sword_block_2.uasset b/hwanyoung2/Content/Illusions/Assets/Sword_block_2.uasset index ba40fcd6..b6074c85 100644 --- a/hwanyoung2/Content/Illusions/Assets/Sword_block_2.uasset +++ b/hwanyoung2/Content/Illusions/Assets/Sword_block_2.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d5304324c687182c684d324f23f0cb15db4f727d544a40527f8ae6d307e3248 -size 250054 +oid sha256:782f22cbb21df9d931e7621720b30ba38cef47aacc45e72f2bfc3389fe0e6c40 +size 250056 diff --git a/hwanyoung2/Content/Illusions/Assets/bow_string.uasset b/hwanyoung2/Content/Illusions/Assets/bow_string.uasset index 7e4c9b42..16a83627 100644 --- a/hwanyoung2/Content/Illusions/Assets/bow_string.uasset +++ b/hwanyoung2/Content/Illusions/Assets/bow_string.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:43f937e50adee152ae42ed1fdf19f37a465e251200374f1ce1ec680da46b02f1 +oid sha256:289e3a3fe84bb2e3d2ae1967157d39858bf8fc62725d923f47070982e376b36a size 196528 diff --git a/hwanyoung2/Content/NewPreviewMeshCollection.uasset b/hwanyoung2/Content/NewPreviewMeshCollection.uasset deleted file mode 100644 index 0ec03666..00000000 --- a/hwanyoung2/Content/NewPreviewMeshCollection.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b770bdd3e8465f99c9b5805e9758ec06cfcdc07e686a824da3612a3178916e4a -size 2363 diff --git a/hwanyoung2/Source/hwanyoung2/CraftingInfo.h b/hwanyoung2/Source/hwanyoung2/CraftingInfo.h index 0acae582..de14a80c 100644 --- a/hwanyoung2/Source/hwanyoung2/CraftingInfo.h +++ b/hwanyoung2/Source/hwanyoung2/CraftingInfo.h @@ -18,7 +18,18 @@ public: //unique ID of item that is being used to create the item UPROPERTY(EditAnywhere, BlueprintReadWrite) - FName ComponentID; + FName ItemAID; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName ItemBID; + + //unique ID of item that is being used to create the item + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName ItemCID; + + //unique ID of item that is being used to create the item + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName ItemDID; //unique ID of the item that gets created UPROPERTY(EditAnywhere, BlueprintReadWrite) @@ -28,12 +39,20 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool bDestroyItemA; - // UPROPERTY(EditAnywhere, BlueprintReadWrite) bool bDestroyItemB; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bDestroyItemC; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bDestroyItemD; + bool operator==(const FCraftingInfo& OtherItem) const { - return ComponentID == OtherItem.ComponentID; + return ItemAID == OtherItem.ItemAID + && ItemBID == OtherItem.ItemBID + && ItemCID == OtherItem.ItemCID + && ItemDID == OtherItem.ItemDID; } diff --git a/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.cpp b/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.cpp index 768f01fb..55f06544 100644 --- a/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.cpp +++ b/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.cpp @@ -39,13 +39,18 @@ bool AHYPlayerCharacController::AddItemToInventoryByID(FName ID) return false; } -void AHYPlayerCharacController::CraftItem(FInventoryItem ItemA, FInventoryItem ItemB) +void AHYPlayerCharacController::CraftItem(FInventoryItem ItemA, FInventoryItem ItemB, FInventoryItem ItemC, FInventoryItem ItemD) { - for (auto Pair : ItemB.CraftCombinations) { - if (Pair.ComponentID == ItemA.ItemID) { - if (Pair.bDestroyItemA) Inventory.RemoveSingle(ItemA); - if (Pair.bDestroyItemB) Inventory.RemoveSingle(ItemB); - AddItemToInventoryByID(Pair.ProductID); + for (auto Combination : ItemB.CraftCombinations) { + if (Combination.ItemAID == ItemA.ItemID + && Combination.ItemBID == ItemB.ItemID + && Combination.ItemCID == ItemC.ItemID + && Combination.ItemDID == ItemD.ItemID) { + if (Combination.bDestroyItemA) Inventory.RemoveSingle(ItemA); + if (Combination.bDestroyItemB) Inventory.RemoveSingle(ItemB); + if (Combination.bDestroyItemC) Inventory.RemoveSingle(ItemC); + if (Combination.bDestroyItemD) Inventory.RemoveSingle(ItemD); + AddItemToInventoryByID(Combination.ProductID); ReloadCraftUI(); } } diff --git a/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.h b/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.h index f140f7a1..d4ebcfb4 100644 --- a/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.h +++ b/hwanyoung2/Source/hwanyoung2/HYPlayerCharacController.h @@ -38,7 +38,7 @@ public: bool AddItemToInventoryByID(FName ID); UFUNCTION(BlueprintCallable, Category = "Utils") - void CraftItem(FInventoryItem ItemA, FInventoryItem ItemB); + void CraftItem(FInventoryItem ItemA, FInventoryItem ItemB, FInventoryItem ItemC, FInventoryItem ItemD); UPROPERTY(BlueprintReadWrite, VisibleAnywhere) class AHYInteractableActor* CurrentInteractable;