Updated Inventory Component for Resising Functionality
This commit is contained in:
parent
2553f471e5
commit
c794a905da
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI/UI_Inventory.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Inventory/UI/UI_Inventory.uasset
(Stored with Git LFS)
Binary file not shown.
@ -181,6 +181,13 @@ void UInventoryComponent::SpawnItem(UBaseItem* Item, FVector Location)
|
||||
{
|
||||
}
|
||||
|
||||
void UInventoryComponent::UpdateInventorySize_Implementation(const int _Columns, const int _Rows)
|
||||
{
|
||||
Columns = _Columns;
|
||||
Rows = _Rows;
|
||||
InventoryItems.SetNum(Columns * Rows);
|
||||
}
|
||||
|
||||
bool UInventoryComponent::IsTileValid(const FInventoryTile InventoryTile) const
|
||||
{
|
||||
if (InventoryTile.X >= 0 && InventoryTile.Y >= 0 && InventoryTile.X < Columns && InventoryTile.Y < Columns && InventoryTile.Y <= Rows)
|
||||
|
@ -49,7 +49,6 @@ public:
|
||||
bool IsRoomAvailable(class UBaseItem* Item, const int TopLeftIndex);
|
||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||
FInventoryTile IndexToTile(const int Index) const;
|
||||
//UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||
TTuple<UBaseItem*, bool> GetItemAtIndex(const int Index);
|
||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||
int TileToIndex(const FInventoryTile InventoryTile) const;
|
||||
@ -61,6 +60,9 @@ public:
|
||||
void RemoveItem(class UBaseItem* Item);
|
||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||
void SpawnItem(class UBaseItem* Item, FVector Location);
|
||||
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Exec, Category = "Inventory")
|
||||
void UpdateInventorySize(const int _Columns, const int _Rows);
|
||||
virtual void UpdateInventorySize_Implementation(const int _Columns, const int _Rows);
|
||||
|
||||
private:
|
||||
bool IsTileValid(const FInventoryTile InventoryTile) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user