diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll index 66ea4d9..d327b52 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll differ diff --git a/ProjectFish/Content/Maps/TestUI.umap b/ProjectFish/Content/Maps/TestUI.umap index d0367b7..f57df5a 100644 Binary files a/ProjectFish/Content/Maps/TestUI.umap and b/ProjectFish/Content/Maps/TestUI.umap differ diff --git a/ProjectFish/Content/UI/Common/Container/UMG_Container_Grid.uasset b/ProjectFish/Content/UI/Common/Container/UMG_Container_Grid.uasset index 25f8036..7de7b0e 100644 Binary files a/ProjectFish/Content/UI/Common/Container/UMG_Container_Grid.uasset and b/ProjectFish/Content/UI/Common/Container/UMG_Container_Grid.uasset differ diff --git a/ProjectFish/Content/UI/Common/Container/UMG_Container_Item.uasset b/ProjectFish/Content/UI/Common/Container/UMG_Container_Item.uasset index 3dc86a9..aaf877d 100644 Binary files a/ProjectFish/Content/UI/Common/Container/UMG_Container_Item.uasset and b/ProjectFish/Content/UI/Common/Container/UMG_Container_Item.uasset differ diff --git a/ProjectFish/Content/UI/Fishing/Windows/UMG_ManagerFishingREward_Window.uasset b/ProjectFish/Content/UI/Fishing/Windows/UMG_ManagerFishingREward_Window.uasset index 2b121d2..0b9dc2b 100644 Binary files a/ProjectFish/Content/UI/Fishing/Windows/UMG_ManagerFishingREward_Window.uasset and b/ProjectFish/Content/UI/Fishing/Windows/UMG_ManagerFishingREward_Window.uasset differ diff --git a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp index bc7b4a2..2de4af8 100644 --- a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp +++ b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp @@ -43,6 +43,7 @@ int32 UContainerInfo::AddContainerItem(FContainerItem Item) if (Item.IsSlotUsing(FIntPoint(x, y))) { SlotInUsing.Add(FIntPoint(x + Item.ContainerStartPos.X, y + Item.ContainerStartPos.Y), true); + SlotItems.Add(FIntPoint(x + Item.ContainerStartPos.X, y + Item.ContainerStartPos.Y), ItemID); } } } @@ -61,6 +62,7 @@ bool UContainerInfo::RemoveContainerItem(const int32& ItemID) if (Item.IsSlotUsing(FIntPoint(x, y ))) { SlotInUsing[FIntPoint(x + Item.ContainerStartPos.X, y + Item.ContainerStartPos.Y)] = false; + SlotItems[FIntPoint(x + Item.ContainerStartPos.X, y + Item.ContainerStartPos.Y)] = -1; } } } @@ -70,6 +72,32 @@ bool UContainerInfo::RemoveContainerItem(const int32& ItemID) return false; } +TSet UContainerInfo::GetOverlapOtherItem(FContainerItem Item) +{ + TSet OverlapItems; + if (IsItemInContainerShape(Item)) + { + for (int x = 0; x < Item.GetItemWIdth(); x++) + { + for (int y = 0; y < Item.GetItemHeight(); y++) + { + if (Item.IsSlotUsing(FIntPoint(x, y))) + { + + if (ContainerShape->IsSlotActive(Item.ContainerStartPos.X + x, Item.ContainerStartPos.Y + y) && + SlotItems[FIntPoint(x + Item.ContainerStartPos.X, y + Item.ContainerStartPos.Y)] != -1 + ) + { + OverlapItems.Add(SlotItems[FIntPoint(x + Item.ContainerStartPos.X, y + Item.ContainerStartPos.Y)] ); + } + + } + } + } + } + return OverlapItems; +} + bool UContainerInfo::IsItemOverlapOtherItem(FContainerItem NewItem) { @@ -143,6 +171,7 @@ bool UContainerInfo::LoadFromSaveData(FPrimaryAssetId ShapeID, const TArray(ShipShapePath.TryLoad()); diff --git a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h index 6174697..fc4df20 100644 --- a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h +++ b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h @@ -115,6 +115,8 @@ public: int32 AddContainerItem(FContainerItem Item); UFUNCTION(BlueprintPure) bool RemoveContainerItem(const int32& ItemID); + UFUNCTION(BlueprintPure) + TSet GetOverlapOtherItem(FContainerItem Item); // 获取存档数据 UFUNCTION(BlueprintCallable, Category = "ContainerInfo") @@ -142,4 +144,5 @@ public: private: int32 NextItemID = 0; TMap SlotInUsing; + TMap SlotItems; };