From cf526110b369727132775cb27b443f30155a19dd Mon Sep 17 00:00:00 2001 From: Ji Yoon Rhee Date: Tue, 10 Sep 2024 10:46:13 +0900 Subject: [PATCH] lmfao --- .../BP_HYPlayerCharacController.uasset | 4 +-- .../BP_PlayerCharacterBase.uasset | 4 +-- .../ItemBP/BP_DragDropCraftOperation.uasset | 2 +- .../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 +++ .../Content/NewPreviewMeshCollection.uasset | 3 --- hwanyoung2/Source/hwanyoung2/CraftingInfo.h | 25 ++++++++++++++++--- .../hwanyoung2/HYPlayerCharacController.cpp | 17 ++++++++----- .../hwanyoung2/HYPlayerCharacController.h | 2 +- 13 files changed, 54 insertions(+), 24 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..9ffaedbb 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:42d86761eb5b807c64802426c89acf0c606ae8bbb756fa6dec43963dcf60ef91 +size 172417 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/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/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;