diff --git a/Content/Blueprint/Core/BP_selectorPoi.uasset b/Content/Blueprint/Core/BP_selectorPoi.uasset deleted file mode 100644 index d7d18750..00000000 Binary files a/Content/Blueprint/Core/BP_selectorPoi.uasset and /dev/null differ diff --git a/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset b/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset index 7006f570..52390557 100644 Binary files a/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset and b/Content/Blueprint/RobotPawnActors/BP_mujokoStretch.uasset differ diff --git a/Content/GameBP/Core/BP_LuckyRobotsGameInstance.uasset b/Content/GameBP/Core/BP_LuckyRobotsGameInstance.uasset index 656627df..704563e2 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 349acd61..c64dd79c 100644 Binary files a/Content/GameBP/FunctionLibraries/BP_LuckyRobotsLibrary.uasset and b/Content/GameBP/FunctionLibraries/BP_LuckyRobotsLibrary.uasset differ diff --git a/Content/GameBP/Gameplay/BP_TargetSelector.uasset b/Content/GameBP/Gameplay/BP_TargetSelector.uasset new file mode 100644 index 00000000..e8804c7a Binary files /dev/null and b/Content/GameBP/Gameplay/BP_TargetSelector.uasset differ diff --git a/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset b/Content/GameBP/UI/Settings/WB_CaptureSettings.uasset index 7a29227e..77998aff 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 3d8c30e6..aa3f90c8 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/ChildItems/WB_NavigateSimpleEnvironments.uasset b/Content/luckyBot/Luckywidget/ChildItems/WB_NavigateSimpleEnvironments.uasset index f076a629..59c9216e 100644 Binary files a/Content/luckyBot/Luckywidget/ChildItems/WB_NavigateSimpleEnvironments.uasset and b/Content/luckyBot/Luckywidget/ChildItems/WB_NavigateSimpleEnvironments.uasset differ diff --git a/Source/LuckyWorldV2/LuckyWorldV2.Build.cs b/Source/LuckyWorldV2/LuckyWorldV2.Build.cs index 31f654f8..7829bc2c 100644 --- a/Source/LuckyWorldV2/LuckyWorldV2.Build.cs +++ b/Source/LuckyWorldV2/LuckyWorldV2.Build.cs @@ -18,7 +18,8 @@ public class LuckyWorldV2 : ModuleRules "LuckyTextWrite", "SocketIOClient", "VaRest", - "SIOJson" + "SIOJson", + "NavigationSystem" }); PrivateDependencyModuleNames.AddRange(new string[] { }); diff --git a/Source/LuckyWorldV2/Private/Gameplay/TargetSelector.cpp b/Source/LuckyWorldV2/Private/Gameplay/TargetSelector.cpp index ed36ad54..7a4ddc18 100644 --- a/Source/LuckyWorldV2/Private/Gameplay/TargetSelector.cpp +++ b/Source/LuckyWorldV2/Private/Gameplay/TargetSelector.cpp @@ -2,6 +2,8 @@ #include "Gameplay/TargetSelector.h" +#include "Kismet/GameplayStatics.h" +#include "NavigationSystem.h" // Sets default values ATargetSelector::ATargetSelector() @@ -23,5 +25,25 @@ void ATargetSelector::Tick(float DeltaTime) { Super::Tick(DeltaTime); + if (bIsTracing) + { + APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0); + if (PlayerController) + { + FHitResult HitResult; + PlayerController->GetHitResultUnderCursorByChannel(ETraceTypeQuery::TraceTypeQuery1, true, HitResult); + if (HitResult.bBlockingHit) + { + UNavigationSystemV1* NavSys = FNavigationSystem::GetCurrent(GetWorld()); + + if (NavSys) + { + FNavLocation NavLocation; + NavSys->ProjectPointToNavigation(HitResult.Location, NavLocation); + SetActorLocation(NavLocation); + } + } + } + } } diff --git a/Source/LuckyWorldV2/Private/UI/Settings/CaptureSettingsUserWidget.cpp b/Source/LuckyWorldV2/Private/UI/Settings/CaptureSettingsUserWidget.cpp index 98f5d39a..a6d4e302 100644 --- a/Source/LuckyWorldV2/Private/UI/Settings/CaptureSettingsUserWidget.cpp +++ b/Source/LuckyWorldV2/Private/UI/Settings/CaptureSettingsUserWidget.cpp @@ -9,6 +9,8 @@ void UCaptureSettingsUserWidget::NativeConstruct() { Super::NativeConstruct(); + SetVisibility(ESlateVisibility::Hidden); + BPRefreshTaskList(); ULuckyRobotsGameInstance* GameInstance = Cast(GetGameInstance()); if (GameInstance) diff --git a/Source/LuckyWorldV2/Public/UI/GameUserWidget.h b/Source/LuckyWorldV2/Public/UI/GameUserWidget.h index fb51cec0..78630da2 100644 --- a/Source/LuckyWorldV2/Public/UI/GameUserWidget.h +++ b/Source/LuckyWorldV2/Public/UI/GameUserWidget.h @@ -7,6 +7,9 @@ #include "SharedDef.h" #include "GameUserWidget.generated.h" +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnReset); + +class UCaptureSettingsUserWidget; /** * */ @@ -36,6 +39,11 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite) FString DownCountStr; + +public: + UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event") + FOnReset OnReset; + public: UFUNCTION(BlueprintCallable) void DoWaitSecond(); @@ -50,4 +58,7 @@ public: UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) void DoAutoConfirm(); + + UFUNCTION(BlueprintPure, BlueprintImplementableEvent) + UCaptureSettingsUserWidget* GetCaptureSettingsUserWidget(); }; diff --git a/Source/LuckyWorldV2/Public/UI/Settings/CaptureSettingsUserWidget.h b/Source/LuckyWorldV2/Public/UI/Settings/CaptureSettingsUserWidget.h index ba10716b..59e8b2d9 100644 --- a/Source/LuckyWorldV2/Public/UI/Settings/CaptureSettingsUserWidget.h +++ b/Source/LuckyWorldV2/Public/UI/Settings/CaptureSettingsUserWidget.h @@ -8,6 +8,8 @@ #include "CaptureSettingsUserWidget.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnOpenMenuStateChanged, bool, Open); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStartCapture); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStopCapture); /** * @@ -26,6 +28,12 @@ public: UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event") FOnOpenMenuStateChanged OnOpenMenuStateChanged; + UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event") + FOnStartCapture OnStartCapture; + + UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event") + FOnStopCapture OnStopCapture; + public: UFUNCTION(BlueprintCallable) void ToggleMenu(); @@ -37,9 +45,15 @@ public: UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) void BPOnRandomMeshesUpdated(); + UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) + void BPSaveSettings(); + UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) void BPLoadSettings(); UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) void ToggleMenuDisplay(); + + UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) + void BPChangeCaptureState(); };