diff --git a/Content/Blueprints/Items/BP_BuffJelly.uasset b/Content/Blueprints/Items/BP_BuffJelly.uasset index d96742f..c02d31a 100644 --- a/Content/Blueprints/Items/BP_BuffJelly.uasset +++ b/Content/Blueprints/Items/BP_BuffJelly.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5e848bfa9970c3ca45b347fd5fc8412d76f271c8773b6c8c67dbc4318b287d55 -size 6828 +oid sha256:576e1cd3b8c065e62aa79e816c7cf7da53478ec1540122f6430b7e22bc740a93 +size 6872 diff --git a/Content/Blueprints/Items/BP_HealingJelly.uasset b/Content/Blueprints/Items/BP_HealingJelly.uasset index 254ad6e..df344db 100644 --- a/Content/Blueprints/Items/BP_HealingJelly.uasset +++ b/Content/Blueprints/Items/BP_HealingJelly.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b723a5754a4c921a09eedfce3c90c246ed6ffee230d0a2f68887d1e2a0ecfbf -size 6780 +oid sha256:f00cd0794a1bebf9ec279e08c06925fc8c70e28e5e51f21e5834b1aa89d6ab12 +size 6824 diff --git a/Content/Blueprints/Player/BP_MyTempCharacter.uasset b/Content/Blueprints/Player/BP_MyTempCharacter.uasset index eade3bb..93bd6e5 100644 --- a/Content/Blueprints/Player/BP_MyTempCharacter.uasset +++ b/Content/Blueprints/Player/BP_MyTempCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f75c1a60b8b5ff0cfd87d50b69761c177d42897fe5881e3b2348ffe93964100e -size 50991 +oid sha256:cdb552dab713052cd07463c8a6cdb840878d73101872e5f076cebdb7f909b84a +size 51402 diff --git a/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp b/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp index 9fc609d..ccdda07 100644 --- a/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp +++ b/Source/the_twilight_abyss/BaseItems/InventoryComponent.cpp @@ -40,8 +40,12 @@ bool UInventoryComponent::AddItem(class UBaseItem* BaseItem) BaseItem->StoredItems = this; BaseItem->World = GetWorld(); Items.Add(BaseItem); + BaseItem->ItemID++; UE_LOG(LogTemp, Display, TEXT("ITEM HAS BEEN ADDED")); - //Update UI + //log the itemid + UE_LOG(LogTemp, Display, TEXT("ITEM ID: %d"), BaseItem->ItemID); + + //Refreshes the inventory OnInventoryUpdated.Broadcast(); return true; diff --git a/Source/the_twilight_abyss/BaseItems/InventoryComponent.h b/Source/the_twilight_abyss/BaseItems/InventoryComponent.h index af87438..41476b1 100644 --- a/Source/the_twilight_abyss/BaseItems/InventoryComponent.h +++ b/Source/the_twilight_abyss/BaseItems/InventoryComponent.h @@ -4,6 +4,7 @@ #include "CoreMinimal.h" #include "Components/ActorComponent.h" +#include "Items/EatableItems.h" #include "InventoryComponent.generated.h" //OUR DELEGATE IS CALLED FONINVENTORYUPDATED @@ -33,6 +34,9 @@ public: UPROPERTY(EditDefaultsOnly, Category= "Inventory") int32 MaxItemSlots; + UPROPERTY(EditDefaultsOnly, Category = "Inventory") + int MaxItemStack; + UPROPERTY(BlueprintAssignable, Category= "Inventory") FOnInventoryUpdated OnInventoryUpdated; //This is our delegate @@ -41,4 +45,5 @@ public: UFUNCTION(BlueprintCallable, Category= "Inventory") class UBaseItem* GetItem(int Index); + }; diff --git a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h index 666f391..d05fe0c 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h +++ b/Source/the_twilight_abyss/BaseItems/Items/BaseItem.h @@ -52,6 +52,9 @@ public: UPROPERTY(EditAnywhere, Category = "Item") bool isDamageBuffItem; + + UPROPERTY(EditAnywhere, Category = "Item") + int ItemID; //reference to the UInventoryComponent script UPROPERTY() diff --git a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp index 04f104d..09b1a43 100644 --- a/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp +++ b/Source/the_twilight_abyss/BaseItems/Items/EatableItems.cpp @@ -9,7 +9,7 @@ UEatableItems::UEatableItems() { - + ItemID; } void UEatableItems::Use(ATempCharacter* Character)