diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll index 1343ee4..80c6bf3 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll differ diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll index 7be1eed..0f4953c 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll differ diff --git a/ProjectFish/Content/UI/Common/Container/UMG_Container_Grid.uasset b/ProjectFish/Content/UI/Common/Container/UMG_Container_Grid.uasset index 2076076..c0c2863 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 20a358a..a6f91f1 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/Source/ProjectFish/Data/ContainerInfo.cpp b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp index c04fdc1..eff53bf 100644 --- a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp +++ b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp @@ -22,17 +22,17 @@ void UContainerInfo::InitContainerByShape(UShapeAsset* InContainerShape) } } -bool UContainerInfo::AddContainerItem(FContainerItem Item, int32& ItemID) +int32 UContainerInfo::AddContainerItem(FContainerItem Item) { if (!IsItemInContainerShape(Item)) { - return false; + return -1; } if (IsItemOverlapOtherItem(Item)) { - return false; + return -1; } - ItemID = NextItemID; + int32 ItemID = NextItemID; Items.Add(NextItemID, Item); ++NextItemID; //设置容器指定位置的占用状态 @@ -46,7 +46,7 @@ bool UContainerInfo::AddContainerItem(FContainerItem Item, int32& ItemID) } } } - return true; + return ItemID; } bool UContainerInfo::RemoveContainerItem(const int32& ItemID) @@ -163,8 +163,7 @@ bool UContainerInfo::LoadFromSaveData(FPrimaryAssetId ShapeID, const TArray(RewardItemPath.TryLoad()); //添加物品到容器中 FIntPoint Position(ItemData.PosX, ItemData.PosY); - int32 ItemID; - AddContainerItem(NewItem, ItemID); + AddContainerItem(NewItem); } return true; diff --git a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h index 82aff57..6174697 100644 --- a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h +++ b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h @@ -112,7 +112,7 @@ public: void InitContainerByShape(UShapeAsset* InContainerShape); UFUNCTION(BlueprintPure) - bool AddContainerItem(FContainerItem Item, int32& ItemID); + int32 AddContainerItem(FContainerItem Item); UFUNCTION(BlueprintPure) bool RemoveContainerItem(const int32& ItemID);