functionality finished now gussy up
This commit is contained in:
		@@ -141,3 +141,29 @@ EInventoryCapType UAC_PlayerInventory::GetInventoryCapType()
 | 
			
		||||
	return this->InventoryCapType;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int32 UAC_PlayerInventory::CountNumberOfSameItemsInInventory(const FBaseItemInfo& ItemToCheck)
 | 
			
		||||
{
 | 
			
		||||
	int32 ItemCount = 0;
 | 
			
		||||
 | 
			
		||||
	for (const FBaseItemInfo& Item : PlayerInventory)
 | 
			
		||||
	{
 | 
			
		||||
		if (Item == ItemToCheck)
 | 
			
		||||
		{
 | 
			
		||||
			ItemCount++;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return ItemCount;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void UAC_PlayerInventory::RequestDropItem(const FBaseItemInfo& ItemToDrop, const int32& ItemCount)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	for (int32 i = 0; i < ItemCount; i++)
 | 
			
		||||
	{
 | 
			
		||||
		PlayerInventory.RemoveSingle(ItemToDrop);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
		
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -195,3 +195,15 @@ UAC_PlayerStats* UBPFL_EpicInventory::GetPlayerStatsComponent(UObject* WorldCont
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool UBPFL_EpicInventory::AreItemsEqual(const FBaseItemInfo& ItemA, const FBaseItemInfo& ItemB)
 | 
			
		||||
{
 | 
			
		||||
	bool ItemsEqual = false;
 | 
			
		||||
 | 
			
		||||
	if (ItemA == ItemB)
 | 
			
		||||
	{
 | 
			
		||||
		ItemsEqual = true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return ItemsEqual;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,6 +27,9 @@ public:
 | 
			
		||||
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Inventory Configuration")
 | 
			
		||||
	bool bUseRequiredLevel;
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Inventory Configuration")
 | 
			
		||||
	bool bStackSameItemsInInventoryUI;
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Inventory Configuration")
 | 
			
		||||
	bool bUseInventoryCap;
 | 
			
		||||
 | 
			
		||||
@@ -61,6 +64,12 @@ public:
 | 
			
		||||
	UFUNCTION(BlueprintCallable)
 | 
			
		||||
	EInventoryCapType GetInventoryCapType();
 | 
			
		||||
 | 
			
		||||
	UFUNCTION(BlueprintCallable)
 | 
			
		||||
	int32 CountNumberOfSameItemsInInventory(const FBaseItemInfo& ItemToCheck);
 | 
			
		||||
 | 
			
		||||
	UFUNCTION(BlueprintCallable)
 | 
			
		||||
	void RequestDropItem(const FBaseItemInfo& ItemToDrop, const int32& ItemCount);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
 
 | 
			
		||||
@@ -31,5 +31,8 @@ public:
 | 
			
		||||
	UFUNCTION(BlueprintCallable, Category = "Player Stat Getters")
 | 
			
		||||
	static UAC_PlayerStats* GetPlayerStatsComponent(UObject* WorldContextObject);
 | 
			
		||||
 | 
			
		||||
	UFUNCTION(BlueprintCallable, Category = "Player Inventory Getters")
 | 
			
		||||
	static bool AreItemsEqual(const FBaseItemInfo& ItemA, const FBaseItemInfo& ItemB);
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -154,6 +154,18 @@ struct FBaseItemInfo : public FTableRowBase
 | 
			
		||||
{
 | 
			
		||||
	GENERATED_BODY()
 | 
			
		||||
 | 
			
		||||
	bool operator==(const FBaseItemInfo& Other) const
 | 
			
		||||
	{
 | 
			
		||||
		return Name.EqualTo(Other.Name) &&
 | 
			
		||||
			Description.EqualTo(Other.Description) &&
 | 
			
		||||
			(ItemType == Other.ItemType) &&
 | 
			
		||||
			(Price == Other.Price) &&
 | 
			
		||||
			(Rarity == Other.Rarity) &&
 | 
			
		||||
			(ItemWeight == Other.ItemWeight);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Base Item Info")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user