diff --git a/.gitignore b/.gitignore index 7a9161f8..c02c4cf8 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,9 @@ Binaries/* # Builds Build/* +# robotdata +robotdata/ + # Whitelist PakBlacklist-.txt files !Build/*/ Build/*/** diff --git a/Content/GameBP/Datatable/SelectableItemData/DT_Decoration.uasset b/Content/GameBP/Datatable/SelectableItemData/DT_Decoration.uasset index 4486763a..f033336f 100644 Binary files a/Content/GameBP/Datatable/SelectableItemData/DT_Decoration.uasset and b/Content/GameBP/Datatable/SelectableItemData/DT_Decoration.uasset differ diff --git a/Content/GameBP/Datatable/SelectableItemData/DT_Electronics.uasset b/Content/GameBP/Datatable/SelectableItemData/DT_Electronics.uasset index 2b60ff1b..60bbf575 100644 Binary files a/Content/GameBP/Datatable/SelectableItemData/DT_Electronics.uasset and b/Content/GameBP/Datatable/SelectableItemData/DT_Electronics.uasset differ diff --git a/Content/GameBP/Datatable/SelectableItemData/DT_Furniture.uasset b/Content/GameBP/Datatable/SelectableItemData/DT_Furniture.uasset index 7b2857b4..69447587 100644 Binary files a/Content/GameBP/Datatable/SelectableItemData/DT_Furniture.uasset and b/Content/GameBP/Datatable/SelectableItemData/DT_Furniture.uasset differ diff --git a/Content/GameBP/Datatable/SelectableItemData/DT_Kitchenware.uasset b/Content/GameBP/Datatable/SelectableItemData/DT_Kitchenware.uasset index 3afe95fa..5f418910 100644 Binary files a/Content/GameBP/Datatable/SelectableItemData/DT_Kitchenware.uasset and b/Content/GameBP/Datatable/SelectableItemData/DT_Kitchenware.uasset differ diff --git a/Content/GameBP/UI/Common/WB_LuckyTextFieldLayout.uasset b/Content/GameBP/UI/Common/WB_LuckyTextFieldLayout.uasset new file mode 100644 index 00000000..a9cf138a Binary files /dev/null and b/Content/GameBP/UI/Common/WB_LuckyTextFieldLayout.uasset differ diff --git a/Content/GameBP/UI/Common/WB_MenuTitle.uasset b/Content/GameBP/UI/Common/WB_MenuTitle.uasset new file mode 100644 index 00000000..4e2137f0 Binary files /dev/null and b/Content/GameBP/UI/Common/WB_MenuTitle.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_AllRandom.uasset b/Content/GameBP/UI/Settings/WB_AllRandom.uasset index 411f9f76..3efb16a3 100644 Binary files a/Content/GameBP/UI/Settings/WB_AllRandom.uasset and b/Content/GameBP/UI/Settings/WB_AllRandom.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset b/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset index 74ae203e..28cc5740 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/Settings/WB_ObjectListBox1.uasset b/Content/GameBP/UI/Settings/WB_ObjectListBox1.uasset new file mode 100644 index 00000000..fbf6ec17 Binary files /dev/null and b/Content/GameBP/UI/Settings/WB_ObjectListBox1.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_ObjectsListCheckbox.uasset b/Content/GameBP/UI/Settings/WB_ObjectsListCheckbox.uasset new file mode 100644 index 00000000..c5480daa Binary files /dev/null and b/Content/GameBP/UI/Settings/WB_ObjectsListCheckbox.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_SelectGoalMenu.uasset b/Content/GameBP/UI/Settings/WB_SelectGoalMenu.uasset index df9a00ed..ed300430 100644 Binary files a/Content/GameBP/UI/Settings/WB_SelectGoalMenu.uasset and b/Content/GameBP/UI/Settings/WB_SelectGoalMenu.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_TaskListBox.uasset b/Content/GameBP/UI/Settings/WB_TaskListBox.uasset new file mode 100644 index 00000000..cbceb3d2 Binary files /dev/null and b/Content/GameBP/UI/Settings/WB_TaskListBox.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_TaskListView.uasset b/Content/GameBP/UI/Settings/WB_TaskListView.uasset index a56a6ec5..e290fdca 100644 Binary files a/Content/GameBP/UI/Settings/WB_TaskListView.uasset and b/Content/GameBP/UI/Settings/WB_TaskListView.uasset differ diff --git a/Content/luckyBot/Luckywidget/ChildItems/WB_MenuTitle.uasset b/Content/luckyBot/Luckywidget/ChildItems/WB_MenuTitle.uasset deleted file mode 100644 index 33ca09b9..00000000 Binary files a/Content/luckyBot/Luckywidget/ChildItems/WB_MenuTitle.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectListBox1.uasset b/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectListBox1.uasset deleted file mode 100644 index 2d636a06..00000000 Binary files a/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectListBox1.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectsListBox.uasset b/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectsListBox.uasset deleted file mode 100644 index 80ebc9bc..00000000 Binary files a/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectsListBox.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectsListCheckbox.uasset b/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectsListCheckbox.uasset deleted file mode 100644 index a7db3059..00000000 Binary files a/Content/luckyBot/Luckywidget/ChildItems/WB_ObjectsListCheckbox.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/ChildItems/WB_TaskListBox.uasset b/Content/luckyBot/Luckywidget/ChildItems/WB_TaskListBox.uasset deleted file mode 100644 index 861354d8..00000000 Binary files a/Content/luckyBot/Luckywidget/ChildItems/WB_TaskListBox.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/Style/WB_LuckyTextFieldLayout.uasset b/Content/luckyBot/Luckywidget/Style/WB_LuckyTextFieldLayout.uasset index f7511f8b..b01d8df6 100644 Binary files a/Content/luckyBot/Luckywidget/Style/WB_LuckyTextFieldLayout.uasset and b/Content/luckyBot/Luckywidget/Style/WB_LuckyTextFieldLayout.uasset differ diff --git a/Content/luckyBot/Luckywidget/Style/WB_LuckyTextLayout.uasset b/Content/luckyBot/Luckywidget/Style/WB_LuckyTextLayout.uasset deleted file mode 100644 index d75bb339..00000000 Binary files a/Content/luckyBot/Luckywidget/Style/WB_LuckyTextLayout.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/Style/WB_LuckyThreeTextField.uasset b/Content/luckyBot/Luckywidget/Style/WB_LuckyThreeTextField.uasset deleted file mode 100644 index 06e60333..00000000 Binary files a/Content/luckyBot/Luckywidget/Style/WB_LuckyThreeTextField.uasset and /dev/null differ diff --git a/Content/luckyBot/Luckywidget/menu/WB_AllObjects.uasset b/Content/luckyBot/Luckywidget/menu/WB_AllObjects.uasset index 502b2ea8..6746fe0e 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_SideChannelBox.uasset b/Content/luckyBot/Luckywidget/menu/WB_SideChannelBox.uasset index 15a27185..f211e969 100644 Binary files a/Content/luckyBot/Luckywidget/menu/WB_SideChannelBox.uasset and b/Content/luckyBot/Luckywidget/menu/WB_SideChannelBox.uasset differ diff --git a/Content/luckyBot/Luckywidget/menu/WB_developperMenu.uasset b/Content/luckyBot/Luckywidget/menu/WB_developperMenu.uasset index 6e33ae79..cc7b2c15 100644 Binary files a/Content/luckyBot/Luckywidget/menu/WB_developperMenu.uasset and b/Content/luckyBot/Luckywidget/menu/WB_developperMenu.uasset differ diff --git a/Source/LuckyWorldV2/Private/UI/Common/MenuTitleUserWidget.cpp b/Source/LuckyWorldV2/Private/UI/Common/MenuTitleUserWidget.cpp new file mode 100644 index 00000000..21b618d8 --- /dev/null +++ b/Source/LuckyWorldV2/Private/UI/Common/MenuTitleUserWidget.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "UI/Common/MenuTitleUserWidget.h" + diff --git a/Source/LuckyWorldV2/Private/UI/Common/TextFieldUserWidget.cpp b/Source/LuckyWorldV2/Private/UI/Common/TextFieldUserWidget.cpp new file mode 100644 index 00000000..d119d9be --- /dev/null +++ b/Source/LuckyWorldV2/Private/UI/Common/TextFieldUserWidget.cpp @@ -0,0 +1,11 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "UI/Common/TextFieldUserWidget.h" + +void UTextFieldUserWidget::NativeConstruct() +{ + Super::NativeConstruct(); + + UpdateDisplay(); +} \ No newline at end of file diff --git a/Source/LuckyWorldV2/Private/UI/Settings/ObjectsListUserWidget.cpp b/Source/LuckyWorldV2/Private/UI/Settings/ObjectsListUserWidget.cpp index 12798d17..ca0f90af 100644 --- a/Source/LuckyWorldV2/Private/UI/Settings/ObjectsListUserWidget.cpp +++ b/Source/LuckyWorldV2/Private/UI/Settings/ObjectsListUserWidget.cpp @@ -2,4 +2,66 @@ #include "UI/Settings/ObjectsListUserWidget.h" +#include "Engine/StreamableManager.h" +#include "Engine/AssetManager.h" +#include "Engine/Texture2D.h" +#include "Core/LuckyRobotsGameInstance.h" +void UObjectsListUserWidget::NativeConstruct() +{ + Super::NativeConstruct(); + + SelectableItemData.Icon; + + SetVisibility(ESlateVisibility::Collapsed); + + if (!SelectableItemData.Icon.IsNull()) + { + FStreamableManager& Streamable = UAssetManager::GetStreamableManager(); + Streamable.RequestAsyncLoad(SelectableItemData.Icon.ToSoftObjectPath(), + FStreamableDelegate::CreateUObject(this, &UObjectsListUserWidget::OnIconLoaded)); + } + + DoUpdateChecked(); +} + +void UObjectsListUserWidget::OnIconLoaded() +{ + UTexture2D* LoadedTexture = Cast(SelectableItemData.Icon.Get()); + if (LoadedTexture) + { + UpdateIcon(LoadedTexture); + SetVisibility(ESlateVisibility::Visible); + } +} + +void UObjectsListUserWidget::DoUpdateChecked() +{ + ULuckyRobotsGameInstance* GameInstance = Cast(GetGameInstance()); + if (GameInstance) + { + bIsChecked = GameInstance->GetCurrentRandomMeshes().Find(SelectableItemData.Mesh) >= 0; + } + + DoDisplayChecked(); +} + +void UObjectsListUserWidget::ToggleChecked() +{ + ULuckyRobotsGameInstance* GameInstance = Cast(GetGameInstance()); + if (GameInstance) + { + if (GameInstance->GetCurrentRandomMeshes().Find(SelectableItemData.Mesh) >= 0) + { + GameInstance->CurrentCaptureSettingsData.RandomMeshes.Remove(SelectableItemData.Mesh); + } + else + { + GameInstance->CurrentCaptureSettingsData.RandomMeshes.Add(SelectableItemData.Mesh); + } + + GameInstance->OnRandomMeshesUpdated.Broadcast(); + } + + DoUpdateChecked(); +} \ No newline at end of file diff --git a/Source/LuckyWorldV2/Private/UI/Settings/TaskListViewUserWidget.cpp b/Source/LuckyWorldV2/Private/UI/Settings/TaskListViewUserWidget.cpp index 71f21a85..fede5148 100644 --- a/Source/LuckyWorldV2/Private/UI/Settings/TaskListViewUserWidget.cpp +++ b/Source/LuckyWorldV2/Private/UI/Settings/TaskListViewUserWidget.cpp @@ -2,3 +2,40 @@ #include "UI/Settings/TaskListViewUserWidget.h" +#include "Components/VerticalBox.h" +#include "Components/WidgetSwitcher.h" +#include "Core/LuckyRobotsGameInstance.h" +#include "UI/Settings/ObjectsListUserWidget.h" + +void UTaskListViewUserWidget::DoUpdateObject(TArray> StaticMeshList) +{ + if (GetObjectListView()) + { + GetObjectListView()->ClearChildren(); + + ULuckyRobotsGameInstance* GameInstance = Cast(GetGameInstance()); + if (GameInstance) + { + TArray SelectableItemList = GameInstance->GetSelectableItemList(EItemCategory::Furniture); + for (auto TempStaticMesh : StaticMeshList) + { + for (auto SelectableItem : SelectableItemList) + { + if (SelectableItem.Mesh == TempStaticMesh) + { + UObjectsListUserWidget* ObjectsListUserWidget = CreateWidget(this, ObjectsListUserWidgetClass); + if (ObjectsListUserWidget) + { + ObjectsListUserWidget->SelectableItemData = SelectableItem; + GetObjectListView()->AddChild(ObjectsListUserWidget); + ObjectsListUserWidget->SetPadding(FMargin(0.0f, 5.0f, 0.0f, 0.0f)); + } + break; + } + } + } + } + + GetWidgetSwitcher()->SetActiveWidgetIndex(1); + } +} \ No newline at end of file diff --git a/Source/LuckyWorldV2/Public/UI/Common/MenuTitleUserWidget.h b/Source/LuckyWorldV2/Public/UI/Common/MenuTitleUserWidget.h new file mode 100644 index 00000000..3ce1d0db --- /dev/null +++ b/Source/LuckyWorldV2/Public/UI/Common/MenuTitleUserWidget.h @@ -0,0 +1,27 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "MenuTitleUserWidget.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnClickCloseButton); + +/** + * + */ +UCLASS() +class LUCKYWORLDV2_API UMenuTitleUserWidget : public UUserWidget +{ + GENERATED_BODY() + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString MenuTitle; + +public: + UPROPERTY(BlueprintCallable, BlueprintAssignable) + FOnClickCloseButton OnClickCloseButton; + +}; diff --git a/Source/LuckyWorldV2/Public/UI/Common/TextFieldUserWidget.h b/Source/LuckyWorldV2/Public/UI/Common/TextFieldUserWidget.h new file mode 100644 index 00000000..67ed350c --- /dev/null +++ b/Source/LuckyWorldV2/Public/UI/Common/TextFieldUserWidget.h @@ -0,0 +1,42 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "TextFieldUserWidget.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEditText, FString, editstr); + +/** + * + */ +UCLASS() +class LUCKYWORLDV2_API UTextFieldUserWidget : public UUserWidget +{ + GENERATED_BODY() + +protected: + virtual void NativeConstruct() override; + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString SettingFieldLabel; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + UTexture2D* SettingIcon; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString SettingString; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FLinearColor SettingColor; + +public: + UPROPERTY(BlueprintCallable, BlueprintAssignable) + FOnEditText OnEditText; + +public: + UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) + void UpdateDisplay(); +}; diff --git a/Source/LuckyWorldV2/Public/UI/Settings/ObjectsListUserWidget.h b/Source/LuckyWorldV2/Public/UI/Settings/ObjectsListUserWidget.h index 242c50a0..a33066bc 100644 --- a/Source/LuckyWorldV2/Public/UI/Settings/ObjectsListUserWidget.h +++ b/Source/LuckyWorldV2/Public/UI/Settings/ObjectsListUserWidget.h @@ -14,8 +14,29 @@ UCLASS() class LUCKYWORLDV2_API UObjectsListUserWidget : public UUserWidget { GENERATED_BODY() - + +protected: + virtual void NativeConstruct() override; + void OnIconLoaded(); + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bIsChecked; + public: UPROPERTY(EditAnywhere, BlueprintReadWrite) FSelectableItemData SelectableItemData; + +public: + UFUNCTION(BlueprintCallable) + void DoUpdateChecked(); + + UFUNCTION(BlueprintCallable) + void ToggleChecked(); +public: + UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) + void UpdateIcon(UTexture2D* Image); + + UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) + void DoDisplayChecked(); }; diff --git a/Source/LuckyWorldV2/Public/UI/Settings/TaskListViewUserWidget.h b/Source/LuckyWorldV2/Public/UI/Settings/TaskListViewUserWidget.h index 88b40e43..3e42aada 100644 --- a/Source/LuckyWorldV2/Public/UI/Settings/TaskListViewUserWidget.h +++ b/Source/LuckyWorldV2/Public/UI/Settings/TaskListViewUserWidget.h @@ -6,7 +6,13 @@ #include "Blueprint/UserWidget.h" #include "TaskListViewUserWidget.generated.h" +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnAddButtonClick); + class UListView; +class UVerticalBox; +class UWidgetSwitcher; +class UObjectsListUserWidget; +class UStaticMesh; /** * */ @@ -15,7 +21,46 @@ class LUCKYWORLDV2_API UTaskListViewUserWidget : public UUserWidget { GENERATED_BODY() +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString TaskListLabel; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + bool bIsEnableSetting; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString SettingFieldLabel; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + UTexture2D* SettingIcon; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString SettingString; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + bool bIsEnableAddButton; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + FString AddButtonLabel; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config") + TSubclassOf ObjectsListUserWidgetClass; + +public: + UPROPERTY(BlueprintCallable, BlueprintAssignable) + FOnAddButtonClick OnAddButtonClick; + +public: + UFUNCTION(BlueprintCallable) + void DoUpdateObject(TArray> StaticMeshList); + public: UFUNCTION(BlueprintPure, BlueprintImplementableEvent) UListView* GetTaskListView(); + + UFUNCTION(BlueprintPure, BlueprintImplementableEvent) + UVerticalBox* GetObjectListView(); + + UFUNCTION(BlueprintPure, BlueprintImplementableEvent) + UWidgetSwitcher* GetWidgetSwitcher(); };