diff --git a/Content/Blueprint/Core/BP_3DtextHelp.uasset b/Content/Blueprint/Core/BP_3DtextHelp.uasset index 1b3ec85e..87196718 100644 Binary files a/Content/Blueprint/Core/BP_3DtextHelp.uasset and b/Content/Blueprint/Core/BP_3DtextHelp.uasset differ diff --git a/Content/Blueprint/Core/BP_DrawrCabin.uasset b/Content/Blueprint/Core/BP_DrawrCabin.uasset index c372f4d0..cc4e072c 100644 Binary files a/Content/Blueprint/Core/BP_DrawrCabin.uasset and b/Content/Blueprint/Core/BP_DrawrCabin.uasset differ diff --git a/Content/Blueprint/Core/BP_randomizeChangeMaterialTexture.uasset b/Content/Blueprint/Core/BP_randomizeChangeMaterialTexture.uasset index b3fd5a9f..c5c963fa 100644 Binary files a/Content/Blueprint/Core/BP_randomizeChangeMaterialTexture.uasset and b/Content/Blueprint/Core/BP_randomizeChangeMaterialTexture.uasset differ diff --git a/Content/Blueprint/RobotPawnActors/BP_DroneRobot.uasset b/Content/Blueprint/RobotPawnActors/BP_DroneRobot.uasset index 9d14c32d..56771288 100644 Binary files a/Content/Blueprint/RobotPawnActors/BP_DroneRobot.uasset and b/Content/Blueprint/RobotPawnActors/BP_DroneRobot.uasset differ diff --git a/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset b/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset index 194d2cbe..33572e33 100644 Binary files a/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset and b/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset differ diff --git a/Content/Blueprint/vehicle/StretchRobot_vehicle_BP.uasset b/Content/Blueprint/vehicle/StretchRobot_vehicle_BP.uasset index 67719287..a295091a 100644 Binary files a/Content/Blueprint/vehicle/StretchRobot_vehicle_BP.uasset and b/Content/Blueprint/vehicle/StretchRobot_vehicle_BP.uasset differ diff --git a/Content/GameBP/Core/BP_LuckyRobotsGameInstance.uasset b/Content/GameBP/Core/BP_LuckyRobotsGameInstance.uasset index 9bc56fea..8988116a 100644 Binary files a/Content/GameBP/Core/BP_LuckyRobotsGameInstance.uasset and b/Content/GameBP/Core/BP_LuckyRobotsGameInstance.uasset differ diff --git a/Content/GameBP/FunctionLibraries/BP_LuckyRobotsLibrary.uasset b/Content/GameBP/FunctionLibraries/BP_LuckyRobotsLibrary.uasset index bb541882..e774a9cd 100644 Binary files a/Content/GameBP/FunctionLibraries/BP_LuckyRobotsLibrary.uasset and b/Content/GameBP/FunctionLibraries/BP_LuckyRobotsLibrary.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset b/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset index c33d4f78..2db07bec 100644 Binary files a/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset and b/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset differ diff --git a/Content/GameBP/UI/WB_GameWidget.uasset b/Content/GameBP/UI/WB_GameWidget.uasset index bbb955d3..a9893f14 100644 Binary files a/Content/GameBP/UI/WB_GameWidget.uasset and b/Content/GameBP/UI/WB_GameWidget.uasset differ diff --git a/Content/luckyBot/Luckywidget/menu/WB_AllObjects.uasset b/Content/luckyBot/Luckywidget/menu/WB_AllObjects.uasset index d601ec0e..502b2ea8 100644 Binary files a/Content/luckyBot/Luckywidget/menu/WB_AllObjects.uasset and b/Content/luckyBot/Luckywidget/menu/WB_AllObjects.uasset differ diff --git a/Content/luckyBot/Luckywidget/menu/WB_AllRandom.uasset b/Content/luckyBot/Luckywidget/menu/WB_AllRandom.uasset index 38a2b2d6..575cca0f 100644 Binary files a/Content/luckyBot/Luckywidget/menu/WB_AllRandom.uasset and b/Content/luckyBot/Luckywidget/menu/WB_AllRandom.uasset differ diff --git a/Source/Luckyrobots/Private/Core/LuckyRobotsGameInstance.cpp b/Source/Luckyrobots/Private/Core/LuckyRobotsGameInstance.cpp index 3f6e548d..8ceb3dd2 100644 --- a/Source/Luckyrobots/Private/Core/LuckyRobotsGameInstance.cpp +++ b/Source/Luckyrobots/Private/Core/LuckyRobotsGameInstance.cpp @@ -215,6 +215,75 @@ void ULuckyRobotsGameInstance::DoQualitySettings(int32 Quality, bool Auto) } } +FString ULuckyRobotsGameInstance::GetWriteFolderPath() +{ + FString Directory = FPaths::ConvertRelativePathToFull(FPaths::ProjectDir()); + FString WriteFolderPath = FPaths::Combine(Directory, GetCurrentFolderName()) + "/"; + + return WriteFolderPath; +} + +TSoftObjectPtr ULuckyRobotsGameInstance::GetRandomMesh() +{ + int32 MeshCount = GetCurrentRandomMeshes().Num(); + if (MeshCount > 0) + { + int32 RandomIndex = UKismetMathLibrary::RandomIntegerInRange(0, MeshCount - 1); + if (GetCurrentRandomMeshes().IsValidIndex(RandomIndex)) + { + return GetCurrentRandomMeshes()[RandomIndex]; + } + } + + return nullptr; +} + +TArray ULuckyRobotsGameInstance::GetSelectableItemList(EItemCategory ItemCategory) +{ + TArray SelectableItemList; + UDataTable* SelectedDataTable = nullptr; + + switch (ItemCategory) + { + case EItemCategory::Furniture: + SelectedDataTable = FurnitureDataTable; + break; + case EItemCategory::Decoration: + SelectedDataTable = DecorationDataTable; + break; + case EItemCategory::Kitchenware: + SelectedDataTable = KitchenwareDataTable; + break; + case EItemCategory::Electronics: + SelectedDataTable = ElectronicsDataTable; + break; + case EItemCategory::Bathroom: + SelectedDataTable = BathroomDataTable; + break; + default: + break; + } + + if (SelectedDataTable) + { + FString ContextString; + TArray RowNames = SelectedDataTable->GetRowNames(); + for (const FName& RowName : RowNames) + { + FSelectableItemData* ItemData = SelectedDataTable->FindRow(RowName, ContextString); + if (ItemData) + { + if (ItemData->Category == ItemCategory && UKismetSystemLibrary::IsValidSoftObjectReference(ItemData->Mesh)) + { + SelectableItemList.Add(*ItemData); + } + } + } + } + + return SelectableItemList; +} + void ULuckyRobotsGameInstance::SetCurrentFolderName(const FString& FolderName) { CurrentCaptureSettingsData.FolderName = FText::FromString(FolderName); diff --git a/Source/Luckyrobots/Public/Core/LuckyRobotsGameInstance.h b/Source/Luckyrobots/Public/Core/LuckyRobotsGameInstance.h index 8b101327..c844bc95 100644 --- a/Source/Luckyrobots/Public/Core/LuckyRobotsGameInstance.h +++ b/Source/Luckyrobots/Public/Core/LuckyRobotsGameInstance.h @@ -180,6 +180,16 @@ public: UFUNCTION(BlueprintCallable) void DoQualitySettings(int32 Quality, bool Auto); + + UFUNCTION(BlueprintPure) + FString GetWriteFolderPath(); + + UFUNCTION(BlueprintPure) + TSoftObjectPtr GetRandomMesh(); + + UFUNCTION(BlueprintPure, Category = "Selectable Items") + TArray GetSelectableItemList(EItemCategory ItemCategory); + public: UFUNCTION(BlueprintCallable) void SetCurrentFolderName(const FString& FolderName);