Merge remote-tracking branch 'origin/Inventory-System' into dev
# Conflicts: # EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset # EndlessVendetta/Content/Levels/TrainingFacility.umap
This commit is contained in:
commit
a08f671114
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_Bed01.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_Bed01.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_Desk01.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_Desk01.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_SmallTable01.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_SmallTable01.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_Wardrobe01.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Assets/Objects/Tutorial-Level/Sm_Wardrobe01.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/BountyDirector/PC_Background.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF1.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF1.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF10.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF10.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF11.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF11.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF12.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF12.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF13.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF13.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF14.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF14.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF15.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF15.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF16.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF16.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF17.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF17.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF18.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF18.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF19.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF19.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF2.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF2.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF20.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF20.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF21.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF21.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF22.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF22.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF23.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF23.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF24.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF24.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF3.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF3.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF4.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF4.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF5.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF5.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF6.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF6.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF7.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF7.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF8.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF8.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF9.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/IntroF9.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/PlayersHomeShipImage.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/TutorialFacility/IntroCutscene/PlayersHomeShipImage.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/BountySystem/Waypoint/TempMainBountyIcon.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/Waypoint/TempMainBountyIcon.uasset
(Stored with Git LFS)
Binary file not shown.
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.
BIN
EndlessVendetta/Content/Inventory/M_Base_Rot.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Inventory/M_Base_Rot.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/MyBaseItem.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Inventory/MyBaseItem.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI/UI_Inventory.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Inventory/UI/UI_Inventory.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI/UI_InventoryGrid.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Inventory/UI/UI_InventoryGrid.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI/UI_ItemWidget.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/Inventory/UI/UI_ItemWidget.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI_Inventory.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Inventory/UI_Inventory.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI_InventoryGrid.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Inventory/UI_InventoryGrid.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Inventory/UI_ItemWidget.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Inventory/UI_ItemWidget.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/LevelPrototyping/Materials/Panel_Concrete_BaseColor.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/LevelPrototyping/Materials/Panel_Concrete_BaseColor.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/LevelPrototyping/Materials/Panel_Concrete_Normal.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/LevelPrototyping/Materials/Panel_Concrete_Normal.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/LevelPrototyping/Materials/Panel_Concrete_OcclusionRoughnessMetallic.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/LevelPrototyping/Materials/Panel_Concrete_OcclusionRoughnessMetallic.uasset
(Stored with Git LFS)
Binary file not shown.
@ -3,6 +3,13 @@
|
||||
|
||||
#include "BaseItem.h"
|
||||
|
||||
|
||||
void UBaseItem::PostInitProperties()
|
||||
{
|
||||
Super::PostInitProperties();
|
||||
ItemSize = FItemSize(DefaultItemSize.X, DefaultItemSize.Y);
|
||||
}
|
||||
|
||||
void UBaseItem::RotateItem()
|
||||
{
|
||||
if (CurrentItemRotation == Horizontal)
|
||||
|
@ -10,9 +10,9 @@ struct FItemSize
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ItemSize")
|
||||
UPROPERTY(BlueprintReadWrite, Category = "ItemSize")
|
||||
int X;
|
||||
UPROPERTY(BlueprintReadOnly, Category = "ItemSize")
|
||||
UPROPERTY(BlueprintReadWrite, Category = "ItemSize")
|
||||
int Y;
|
||||
|
||||
FItemSize(const int _X, const int _Y)
|
||||
@ -51,7 +51,9 @@ public:
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
||||
FText Description;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
||||
FItemSize ItemSize = FItemSize();
|
||||
FVector2D DefaultItemSize = FVector2D(1);
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
||||
FItemSize ItemSize;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
||||
UMaterialInterface* ItemTexture;
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
||||
@ -63,6 +65,8 @@ public:
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
||||
bool bIsRotated = false;
|
||||
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Item")
|
||||
void RotateItem();
|
||||
UFUNCTION(BlueprintCallable, Category = "Item")
|
||||
|
@ -107,9 +107,9 @@ bool UInventoryComponent::IsRoomAvailable(UBaseItem* Item, const int TopLeftInde
|
||||
TileToCheck.X = i;
|
||||
TileToCheck.Y = j;
|
||||
if (!IsTileValid(TileToCheck)) return false;
|
||||
const TTuple<UBaseItem*, bool> ItemAtIndex = GetItemAtIndex(TileToIndex(TileToCheck));
|
||||
TTuple<UBaseItem*, bool> ItemAtIndex = GetItemAtIndex(TileToIndex(TileToCheck));
|
||||
if (ItemAtIndex.Get<1>()) return false;
|
||||
if (IsValid(ItemAtIndex.Get<0>())) return true;
|
||||
if (IsValid(ItemAtIndex.Get<0>())) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -126,6 +126,7 @@ FInventoryTile UInventoryComponent::IndexToTile(const int Index) const
|
||||
TTuple<UBaseItem*, bool> UInventoryComponent::GetItemAtIndex(const int Index)
|
||||
{
|
||||
if (!InventoryItems.IsValidIndex(Index)) return MakeTuple(nullptr, false);
|
||||
if (!IsValid(InventoryItems[Index])) return MakeTuple(nullptr, false);
|
||||
return MakeTuple(InventoryItems[Index], true);
|
||||
}
|
||||
|
||||
@ -144,7 +145,7 @@ void UInventoryComponent::AddItemAt(UBaseItem* Item, const int TopLeftIndex)
|
||||
TileToCheck.X = i;
|
||||
TileToCheck.Y = j;
|
||||
if (!IsTileValid(TileToCheck)) return;
|
||||
InventoryItems.Insert(Item, TileToIndex(TileToCheck));
|
||||
InventoryItems[TileToIndex(TileToCheck)] = Item;
|
||||
}
|
||||
}
|
||||
IsDirty = true;
|
||||
@ -157,7 +158,7 @@ TMap<UBaseItem*, FInventoryTile> UInventoryComponent::GetAllItems()
|
||||
{
|
||||
UBaseItem* Item = InventoryItems[i];
|
||||
if (!IsValid(Item)) continue;
|
||||
if (!Items.Contains(Item)) continue;
|
||||
if (Items.Contains(Item)) continue;
|
||||
Items.Add(Item, IndexToTile(i));
|
||||
}
|
||||
return Items;
|
||||
@ -170,19 +171,26 @@ void UInventoryComponent::RemoveItem(UBaseItem* Item)
|
||||
{
|
||||
if (InventoryItems[i] == Item)
|
||||
{
|
||||
InventoryItems.RemoveAt(i);
|
||||
InventoryItems[i] = nullptr;
|
||||
IsDirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UInventoryComponent::SpawnItem(UBaseItem* Item, FVector Location, FRotator Rotation)
|
||||
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.Y < Columns && InventoryTile.Y < Rows)
|
||||
if (InventoryTile.X >= 0 && InventoryTile.Y >= 0 && InventoryTile.X < Columns && InventoryTile.Y < Columns && InventoryTile.Y <= Rows)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -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;
|
||||
@ -60,7 +59,10 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||
void RemoveItem(class UBaseItem* Item);
|
||||
UFUNCTION(BlueprintCallable, Category="Inventory")
|
||||
void SpawnItem(class UBaseItem* Item, FVector Location, FRotator Rotation);
|
||||
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…
Reference in New Issue
Block a user