Updated Inventory Component for Dropping of Items
This commit is contained in:
parent
e4ff0735df
commit
3ac6ea3a27
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/FirstPerson/Blueprints/BP_PC.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_PC.uasset
(Stored with Git LFS)
Binary file not shown.
@ -8,6 +8,7 @@
|
|||||||
#include "InputActionValue.h"
|
#include "InputActionValue.h"
|
||||||
#include "Components/ArrowComponent.h"
|
#include "Components/ArrowComponent.h"
|
||||||
#include "GadgetSystem/GadgetManager.h"
|
#include "GadgetSystem/GadgetManager.h"
|
||||||
|
#include "Inventory/InventoryComponent.h"
|
||||||
|
|
||||||
#include "EndlessVendettaCharacter.generated.h"
|
#include "EndlessVendettaCharacter.generated.h"
|
||||||
|
|
||||||
|
@ -178,6 +178,9 @@ void UInventoryComponent::RemoveItem(UBaseItem* Item)
|
|||||||
|
|
||||||
void UInventoryComponent::SpawnItem(UBaseItem* Item, FVector Location)
|
void UInventoryComponent::SpawnItem(UBaseItem* Item, FVector Location)
|
||||||
{
|
{
|
||||||
|
if (!IsValid(Item)) return;
|
||||||
|
if (!IsValid(Item->ItemActor)) return;
|
||||||
|
GetWorld()->SpawnActor(Item->ItemActor, &Location);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UInventoryComponent::UpdateInventorySize(const int _Columns, const int _Rows)
|
void UInventoryComponent::UpdateInventorySize(const int _Columns, const int _Rows)
|
||||||
|
@ -48,20 +48,20 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
void Pickup();
|
void Pickup();
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
bool IsRoomAvailable(class UBaseItem* Item, const int TopLeftIndex);
|
bool IsRoomAvailable(UBaseItem* Item, const int TopLeftIndex);
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
FInventoryTile IndexToTile(const int Index) const;
|
FInventoryTile IndexToTile(const int Index) const;
|
||||||
TTuple<UBaseItem*, bool> GetItemAtIndex(const int Index);
|
TTuple<UBaseItem*, bool> GetItemAtIndex(const int Index);
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
int TileToIndex(const FInventoryTile InventoryTile) const;
|
int TileToIndex(const FInventoryTile InventoryTile) const;
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
void AddItemAt(class UBaseItem* Item, const int TopLeftIndex);
|
void AddItemAt(UBaseItem* Item, const int TopLeftIndex);
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
TMap<UBaseItem*, FInventoryTile> GetAllItems();
|
TMap<UBaseItem*, FInventoryTile> GetAllItems();
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
void RemoveItem(class UBaseItem* Item);
|
void RemoveItem(UBaseItem* Item);
|
||||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||||
void SpawnItem(class UBaseItem* Item, FVector Location);
|
void SpawnItem(UBaseItem* Item, FVector Location);
|
||||||
UFUNCTION(BlueprintCallable, Category = "Inventory")
|
UFUNCTION(BlueprintCallable, Category = "Inventory")
|
||||||
void UpdateInventorySize(const int _Columns, const int _Rows);
|
void UpdateInventorySize(const int _Columns, const int _Rows);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user