diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.dll new file mode 100644 index 0000000..9ee7fe7 Binary files /dev/null and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.dll differ diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll index 4cf03e4..2146709 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-0001.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor-0001.dll new file mode 100644 index 0000000..0d0e3c2 Binary files /dev/null and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor-0001.dll differ diff --git a/ProjectFish/Binaries/Win64/UnrealEditor.modules b/ProjectFish/Binaries/Win64/UnrealEditor.modules index 22c08e6..fe900f8 100644 --- a/ProjectFish/Binaries/Win64/UnrealEditor.modules +++ b/ProjectFish/Binaries/Win64/UnrealEditor.modules @@ -2,7 +2,7 @@ "BuildId": "37670630", "Modules": { - "ProjectFish": "UnrealEditor-ProjectFish.dll", - "ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll" + "ProjectFish": "UnrealEditor-ProjectFish-0001.dll", + "ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0001.dll" } } \ No newline at end of file diff --git a/ProjectFish/Content/DataAssets/Ship/ShipShapeAsset.uasset b/ProjectFish/Content/DataAssets/Ship/ShipShapeAsset.uasset new file mode 100644 index 0000000..59ead46 Binary files /dev/null and b/ProjectFish/Content/DataAssets/Ship/ShipShapeAsset.uasset differ diff --git a/ProjectFish/Content/Maps/TestUI.umap b/ProjectFish/Content/Maps/TestUI.umap index 15ccbc2..240de56 100644 Binary files a/ProjectFish/Content/Maps/TestUI.umap and b/ProjectFish/Content/Maps/TestUI.umap differ diff --git a/ProjectFish/Content/UI/Battle/WBP_SkillCell.uasset b/ProjectFish/Content/UI/Battle/WBP_SkillCell.uasset index e9ced99..f447733 100644 Binary files a/ProjectFish/Content/UI/Battle/WBP_SkillCell.uasset and b/ProjectFish/Content/UI/Battle/WBP_SkillCell.uasset differ diff --git a/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/BP_RewardItem_DragOption.uasset b/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/BP_RewardItem_DragOption.uasset index d9e22d6..8b20a4d 100644 Binary files a/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/BP_RewardItem_DragOption.uasset and b/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/BP_RewardItem_DragOption.uasset differ diff --git a/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_RewardsGrid_Item.uasset b/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_RewardsGrid_Item.uasset index c9cc6bb..b7de47d 100644 Binary files a/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_RewardsGrid_Item.uasset and b/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_RewardsGrid_Item.uasset differ diff --git a/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_ShipContainer_Grid.uasset b/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_ShipContainer_Grid.uasset index b2a7816..9d37c0e 100644 Binary files a/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_ShipContainer_Grid.uasset and b/ProjectFish/Content/UI/Fishing/Widgets/ManagerRewards/UMG_ShipContainer_Grid.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 73af5b6..cf3c008 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/Plugins/DeskMode/Binaries/Win64/UnrealEditor-DeskMode-0001.dll b/ProjectFish/Plugins/DeskMode/Binaries/Win64/UnrealEditor-DeskMode-0001.dll new file mode 100644 index 0000000..8c5dffe Binary files /dev/null and b/ProjectFish/Plugins/DeskMode/Binaries/Win64/UnrealEditor-DeskMode-0001.dll differ diff --git a/ProjectFish/Plugins/DeskMode/Binaries/Win64/UnrealEditor.modules b/ProjectFish/Plugins/DeskMode/Binaries/Win64/UnrealEditor.modules index 437a3ab..b19fd1c 100644 --- a/ProjectFish/Plugins/DeskMode/Binaries/Win64/UnrealEditor.modules +++ b/ProjectFish/Plugins/DeskMode/Binaries/Win64/UnrealEditor.modules @@ -2,6 +2,6 @@ "BuildId": "37670630", "Modules": { - "DeskMode": "UnrealEditor-DeskMode.dll" + "DeskMode": "UnrealEditor-DeskMode-0001.dll" } } \ No newline at end of file diff --git a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp index 534ee1c..f2f1a44 100644 --- a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp +++ b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.cpp @@ -6,31 +6,43 @@ #include "Engine/AssetManager.h" #include "Engine/StreamableManager.h" -void UContainerInfo::InitContainer(FPrimaryAssetId ContainerShapeId) -{ - //加载形状资源 - TSharedPtr LoadHandle = GEngine->AssetManager->LoadPrimaryAsset(ContainerShapeId); - if (LoadHandle.IsValid()) - { - // 等待加载完成,这会阻塞线程 - LoadHandle->WaitUntilComplete(); +// void UContainerInfo::InitContainer(FPrimaryAssetId ContainerShapeId) +// { +// //加载形状资源 +// TSharedPtr LoadHandle = GEngine->AssetManager->LoadPrimaryAsset(ContainerShapeId); +// if (LoadHandle.IsValid()) +// { +// // 等待加载完成,这会阻塞线程 +// LoadHandle->WaitUntilComplete(); +// +// // 加载完成后,通过句柄获取资源 +// UObject* LoadedObject = LoadHandle->GetLoadedAsset(); +// if (LoadedObject) +// { +// ContainerShape = Cast(LoadedObject); +// for (int x = 0; x < ContainerShape->GetShapeWidth(); x++) +// { +// for (int y = 0; y < ContainerShape->GetShapeHeight(); y++) +// { +// SlotInUsing.Add(FIntPoint(x, y), false); +// } +// } +// } +// LoadHandle->ReleaseHandle(); +// } +// +// } - // 加载完成后,通过句柄获取资源 - UObject* LoadedObject = LoadHandle->GetLoadedAsset(); - if (LoadedObject) +void UContainerInfo::InitContainerByShape(UShapeAsset* InContainerShape) +{ + ContainerShape = InContainerShape; + for (int x = 0; x < ContainerShape->GetShapeWidth(); x++) + { + for (int y = 0; y < ContainerShape->GetShapeHeight(); y++) { - ContainerShape = Cast(LoadedObject); - for (int x = 0; x < ContainerShape->GetShapeWidth(); x++) - { - for (int y = 0; y < ContainerShape->GetShapeHeight(); y++) - { - SlotInUsing.Add(FIntPoint(x, y), false); - } - } + SlotInUsing.Add(FIntPoint(x, y), false); } - LoadHandle->ReleaseHandle(); } - } bool UContainerInfo::AddContainerItem(FContainerItem Item, FIntPoint Position) @@ -39,11 +51,12 @@ bool UContainerInfo::AddContainerItem(FContainerItem Item, FIntPoint Position) { return false; } - if (!IsItemOverlapOtherItem(Item, Position)) + if (IsItemOverlapOtherItem(Item, Position)) { return false; } + Items.Add(Position, Item); //设置容器指定位置的占用状态 for (int x = 0; x < Item.GetItemWIdth(); x++) { diff --git a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h index f9131a4..6335375 100644 --- a/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h +++ b/ProjectFish/Source/ProjectFish/Data/ContainerInfo.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" +#include "ProjectFish/DataAsset/FishingRewardDataAsset.h" #include "ProjectFish/DataAsset/ShapeAsset.h" #include "UObject/Object.h" #include "ContainerInfo.generated.h" @@ -27,19 +28,19 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite) EItemDegreeType DegreeType; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UShapeAsset* ItemShape; + UFishingRewardDataAsset* RewardItem; //旋转后的水平宽度 int32 GetItemWIdth() { - return DegreeType == EItemDegreeType::Ninety || DegreeType == EItemDegreeType::TwentySeven? ItemShape->GetShapeHeight() - : ItemShape->GetShapeWidth(); + return DegreeType == EItemDegreeType::Ninety || DegreeType == EItemDegreeType::TwentySeven? RewardItem->RewardShape->GetShapeHeight() + : RewardItem->RewardShape->GetShapeWidth(); } //旋转后的垂直高度 int32 GetItemHeight() { - return DegreeType == EItemDegreeType::Ninety || DegreeType == EItemDegreeType::TwentySeven? ItemShape->GetShapeWidth() - : ItemShape->GetShapeHeight(); + return DegreeType == EItemDegreeType::Ninety || DegreeType == EItemDegreeType::TwentySeven? RewardItem->RewardShape->GetShapeWidth() + : RewardItem->RewardShape->GetShapeHeight(); } bool IsSlotUsing(FIntPoint Position) @@ -70,7 +71,7 @@ public: break; } - return ItemShape->IsSlotActive(BeforeRotationPos.X, BeforeRotationPos.Y); + return RewardItem->RewardShape->IsSlotActive(BeforeRotationPos.X, BeforeRotationPos.Y); } }; @@ -79,13 +80,18 @@ public: /** * 仓库 */ -UCLASS() +UCLASS(BlueprintType) class PROJECTFISH_API UContainerInfo : public UObject { GENERATED_BODY() public: - void InitContainer(FPrimaryAssetId ContainerShapeId); + // UFUNCTION(BlueprintCallable, Category = "ContainerInfo") + // void InitContainer(FPrimaryAssetId ContainerShapeId); + + UFUNCTION(BlueprintCallable, Category = "ContainerInfo") + void InitContainerByShape(UShapeAsset* InContainerShape); + UFUNCTION(BlueprintPure) bool AddContainerItem(FContainerItem Item, FIntPoint Position); @@ -97,7 +103,7 @@ private: public: UPROPERTY(EditAnywhere, BlueprintReadWrite) - TMap Items; + TMap Items; UPROPERTY(EditAnywhere, BlueprintReadWrite) UShapeAsset* ContainerShape; diff --git a/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp index 69f43d5..01d678e 100644 --- a/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp +++ b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp @@ -4,6 +4,7 @@ #include "FishFunctionLibrary.h" #include "Kismet/GameplayStatics.h" +#include "ProjectFish/Data/ContainerInfo.h" void UFishFunctionLibrary::OpenLevelWithOptions(const UObject* WorldContextObject, FName LevelName, TMap OptionsPaairs) { @@ -14,3 +15,13 @@ void UFishFunctionLibrary::OpenLevelWithOptions(const UObject* WorldContextObjec } UGameplayStatics::OpenLevel(WorldContextObject, LevelName, true,OptionStr); } + +int32 UFishFunctionLibrary::GetContainerItemWiidth(const UObject* WorldContextObject, FContainerItem ContainerItem) +{ + return ContainerItem.GetItemWIdth(); +} + +int32 UFishFunctionLibrary::GetContainerItemHeight(const UObject* WorldContextObject, FContainerItem ContainerItem) +{ + return ContainerItem.GetItemWIdth(); +} diff --git a/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h index 23c23be..27eb7e3 100644 --- a/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h +++ b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h @@ -17,4 +17,10 @@ class PROJECTFISH_API UFishFunctionLibrary : public UBlueprintFunctionLibrary public: UFUNCTION(BlueprintCallable, Category = "FishFunctionLibrary", meta=(WorldContext="WorldContextObject")) static void OpenLevelWithOptions(const UObject* WorldContextObject, FName LevelName,TMap OptionsPaairs); + + UFUNCTION(BlueprintPure, Category = "FishFunctionLibrary", meta=(WorldContext="WorldContextObject")) + static int32 GetContainerItemWiidth(const UObject* WorldContextObject, FContainerItem ContainerItem); + + UFUNCTION(BlueprintPure, Category = "FishFunctionLibrary", meta=(WorldContext="WorldContextObject")) + static int32 GetContainerItemHeight(const UObject* WorldContextObject, FContainerItem ContainerItem); };