martin #19
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,6 +11,7 @@
|
|||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
||||||
#include "VaRestSubsystem.h"
|
#include "VaRestSubsystem.h"
|
||||||
#include "Subsystems/SubsystemBlueprintLibrary.h"
|
#include "Subsystems/SubsystemBlueprintLibrary.h"
|
||||||
|
#include "Gameplay/TargetSelector.h"
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::DoSendMessage(const FString& SendValue)
|
void ULuckyRobotsGameInstance::DoSendMessage(const FString& SendValue)
|
||||||
{
|
{
|
||||||
@ -46,22 +47,22 @@ void ULuckyRobotsGameInstance::SwitchGamePaused()
|
|||||||
|
|
||||||
void ULuckyRobotsGameInstance::ClearTaskList()
|
void ULuckyRobotsGameInstance::ClearTaskList()
|
||||||
{
|
{
|
||||||
TaskList.Empty();
|
CurrentCaptureSettingsData.TaskList.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::AddTask(const FGoalsTaskData& TaskData)
|
void ULuckyRobotsGameInstance::AddTask(const FGoalsTaskData& TaskData)
|
||||||
{
|
{
|
||||||
TaskList.Add(TaskData);
|
CurrentCaptureSettingsData.TaskList.Add(TaskData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::RemoveTask(const FGoalsTaskData& TaskData)
|
void ULuckyRobotsGameInstance::RemoveTask(const FGoalsTaskData& TaskData)
|
||||||
{
|
{
|
||||||
TaskList.Remove(TaskData);
|
CurrentCaptureSettingsData.TaskList.Remove(TaskData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::RemoveTaskByGoalType(EGoalType GoalType)
|
void ULuckyRobotsGameInstance::RemoveTaskByGoalType(EGoalType GoalType)
|
||||||
{
|
{
|
||||||
for (const FGoalsTaskData& Task : TaskList)
|
for (FGoalsTaskData Task : CurrentCaptureSettingsData.TaskList)
|
||||||
{
|
{
|
||||||
if (Task.GoalType == GoalType)
|
if (Task.GoalType == GoalType)
|
||||||
{
|
{
|
||||||
@ -73,18 +74,18 @@ void ULuckyRobotsGameInstance::RemoveTaskByGoalType(EGoalType GoalType)
|
|||||||
|
|
||||||
int32 ULuckyRobotsGameInstance::GetTaskNum() const
|
int32 ULuckyRobotsGameInstance::GetTaskNum() const
|
||||||
{
|
{
|
||||||
return TaskList.Num();
|
return CurrentCaptureSettingsData.TaskList.Num();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetTask(int32 Index, const FGoalsTaskData& TaskData)
|
void ULuckyRobotsGameInstance::SetTask(int32 Index, const FGoalsTaskData& TaskData)
|
||||||
{
|
{
|
||||||
if (TaskList.IsValidIndex(Index))
|
if (CurrentCaptureSettingsData.TaskList.IsValidIndex(Index))
|
||||||
{
|
{
|
||||||
TaskList[Index] = TaskData;
|
CurrentCaptureSettingsData.TaskList[Index] = TaskData;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (TaskList.Num() < Index)
|
while (CurrentCaptureSettingsData.TaskList.Num() < Index)
|
||||||
{
|
{
|
||||||
FGoalsTaskData TempTaskData;
|
FGoalsTaskData TempTaskData;
|
||||||
AddTask(TempTaskData);
|
AddTask(TempTaskData);
|
||||||
@ -95,9 +96,9 @@ void ULuckyRobotsGameInstance::SetTask(int32 Index, const FGoalsTaskData& TaskDa
|
|||||||
|
|
||||||
bool ULuckyRobotsGameInstance::GetTask(int32 Index, FGoalsTaskData& OutTaskData) const
|
bool ULuckyRobotsGameInstance::GetTask(int32 Index, FGoalsTaskData& OutTaskData) const
|
||||||
{
|
{
|
||||||
if (TaskList.IsValidIndex(Index))
|
if (CurrentCaptureSettingsData.TaskList.IsValidIndex(Index))
|
||||||
{
|
{
|
||||||
OutTaskData = TaskList[Index];
|
OutTaskData = CurrentCaptureSettingsData.TaskList[Index];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -106,19 +107,19 @@ bool ULuckyRobotsGameInstance::GetTask(int32 Index, FGoalsTaskData& OutTaskData)
|
|||||||
void ULuckyRobotsGameInstance::ReSetTaskList()
|
void ULuckyRobotsGameInstance::ReSetTaskList()
|
||||||
{
|
{
|
||||||
TArray<FGoalsTaskData> TempTaskList;
|
TArray<FGoalsTaskData> TempTaskList;
|
||||||
for (FGoalsTaskData& Task : TaskList)
|
for (FGoalsTaskData& Task : CurrentCaptureSettingsData.TaskList)
|
||||||
{
|
{
|
||||||
Task.bIsStart = false;
|
Task.bIsStart = false;
|
||||||
Task.bIsComplete = false;
|
Task.bIsComplete = false;
|
||||||
Task.bActive = false;
|
Task.bActive = false;
|
||||||
TempTaskList.Add(Task);
|
TempTaskList.Add(Task);
|
||||||
}
|
}
|
||||||
TaskList = TempTaskList;
|
CurrentCaptureSettingsData.TaskList = TempTaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<FGoalsTaskData> ULuckyRobotsGameInstance::GetTaskList() const
|
TArray<FGoalsTaskData> ULuckyRobotsGameInstance::GetTaskList() const
|
||||||
{
|
{
|
||||||
return TaskList;
|
return CurrentCaptureSettingsData.TaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::DoSetTempTaskValueChange(bool bIsClear)
|
void ULuckyRobotsGameInstance::DoSetTempTaskValueChange(bool bIsClear)
|
||||||
@ -379,6 +380,38 @@ FParsedData ULuckyRobotsGameInstance::DoJsonParse(const FString& JsonString)
|
|||||||
return ParsedData;
|
return ParsedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ULuckyRobotsGameInstance::UpdateTargetSelector()
|
||||||
|
{
|
||||||
|
TArray<AActor*> AllTargetSelector;
|
||||||
|
UGameplayStatics::GetAllActorsOfClass(this, ATargetSelector::StaticClass(), AllTargetSelector);
|
||||||
|
for (auto TargetSelector : AllTargetSelector)
|
||||||
|
{
|
||||||
|
if (TargetSelector)
|
||||||
|
{
|
||||||
|
TargetSelector->Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TArray<FGoalsTaskData> GoalsTaskList = GetTaskList();
|
||||||
|
for (int i = 0; i < GoalsTaskList.Num() ; ++i)
|
||||||
|
{
|
||||||
|
if (GoalsTaskList[i].GoalType == EGoalType::NavigateSimpleEnvironments)
|
||||||
|
{
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
TargetPosition = GoalsTaskList[i].TargetLocation;
|
||||||
|
}
|
||||||
|
ATargetSelector* TargetSelector = GetWorld()->SpawnActorDeferred<ATargetSelector>(TargetSelectorClass, GoalsTaskList[i].TargetLocation, nullptr, nullptr,
|
||||||
|
ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
|
||||||
|
if (TargetSelector)
|
||||||
|
{
|
||||||
|
TargetSelector->FinishSpawning(GoalsTaskList[i].TargetLocation);
|
||||||
|
TargetSelector->bIsTracing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentFolderName(const FString& FolderName)
|
void ULuckyRobotsGameInstance::SetCurrentFolderName(const FString& FolderName)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.FolderName = FText::FromString(FolderName);
|
CurrentCaptureSettingsData.FolderName = FText::FromString(FolderName);
|
||||||
|
27
Source/Luckyrobots/Private/Gameplay/TargetSelector.cpp
Normal file
27
Source/Luckyrobots/Private/Gameplay/TargetSelector.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "Gameplay/TargetSelector.h"
|
||||||
|
|
||||||
|
// Sets default values
|
||||||
|
ATargetSelector::ATargetSelector()
|
||||||
|
{
|
||||||
|
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||||
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
void ATargetSelector::BeginPlay()
|
||||||
|
{
|
||||||
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every frame
|
||||||
|
void ATargetSelector::Tick(float DeltaTime)
|
||||||
|
{
|
||||||
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@
|
|||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
||||||
#include "Subsystems/SubsystemBlueprintLibrary.h"
|
#include "Subsystems/SubsystemBlueprintLibrary.h"
|
||||||
#include "VaRestSubsystem.h"
|
#include "VaRestSubsystem.h"
|
||||||
#include <Kismet/GameplayStatics.h>
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
|
||||||
void UMainScreenUserWidget::NativeConstruct()
|
void UMainScreenUserWidget::NativeConstruct()
|
||||||
{
|
{
|
||||||
|
@ -2,4 +2,39 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "UI/Settings/CaptureSettingsUserWidget.h"
|
#include "UI/Settings/CaptureSettingsUserWidget.h"
|
||||||
|
#include "Core/LuckyRobotsGameInstance.h"
|
||||||
|
#include "UI/GameUserWidget.h"
|
||||||
|
|
||||||
|
void UCaptureSettingsUserWidget::NativeConstruct()
|
||||||
|
{
|
||||||
|
Super::NativeConstruct();
|
||||||
|
|
||||||
|
BPRefreshTaskList();
|
||||||
|
ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (GameInstance)
|
||||||
|
{
|
||||||
|
GameInstance->OnRandomMeshesUpdated.AddDynamic(this, &UCaptureSettingsUserWidget::BPOnRandomMeshesUpdated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UCaptureSettingsUserWidget::ToggleMenu()
|
||||||
|
{
|
||||||
|
bIsOpen = !bIsOpen;
|
||||||
|
|
||||||
|
if (bIsOpen)
|
||||||
|
{
|
||||||
|
BPLoadSettings();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (GameInstance && GameInstance->GameUserWidget)
|
||||||
|
{
|
||||||
|
GameInstance->GameUserWidget->DoAutoConfirm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OnOpenMenuStateChanged.Broadcast(bIsOpen);
|
||||||
|
|
||||||
|
ToggleMenuDisplay();
|
||||||
|
}
|
@ -42,6 +42,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
||||||
UDataTable* BathroomDataTable;
|
UDataTable* BathroomDataTable;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
||||||
|
TSubclassOf<AActor> TargetSelectorClass;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
||||||
TArray<FString> AlphabetForRandomList;
|
TArray<FString> AlphabetForRandomList;
|
||||||
@ -106,8 +109,6 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Random Mesh")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Random Mesh")
|
||||||
bool bIsRandomPannel;
|
bool bIsRandomPannel;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Random Mesh")
|
|
||||||
bool bIsRandomRobotPosition;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
@ -119,9 +120,6 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
EQualityEnum CurrentSelectQuality = EQualityEnum::Epic;
|
EQualityEnum CurrentSelectQuality = EQualityEnum::Epic;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
TArray<FGoalsTaskData> TaskList;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
FGoalsTaskData TempTask;
|
FGoalsTaskData TempTask;
|
||||||
|
|
||||||
@ -206,6 +204,9 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
FParsedData DoJsonParse(const FString& JsonString);
|
FParsedData DoJsonParse(const FString& JsonString);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void UpdateTargetSelector();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentFolderName(const FString& FolderName);
|
void SetCurrentFolderName(const FString& FolderName);
|
||||||
|
29
Source/Luckyrobots/Public/Gameplay/TargetSelector.h
Normal file
29
Source/Luckyrobots/Public/Gameplay/TargetSelector.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "GameFramework/Actor.h"
|
||||||
|
#include "TargetSelector.generated.h"
|
||||||
|
|
||||||
|
UCLASS()
|
||||||
|
class LUCKYROBOTS_API ATargetSelector : public AActor
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Sets default values for this actor's properties
|
||||||
|
ATargetSelector();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Called when the game starts or when spawned
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Called every frame
|
||||||
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
bool bIsTracing = true;
|
||||||
|
};
|
@ -47,4 +47,7 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
void DoRefreshListView();
|
void DoRefreshListView();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
|
void DoAutoConfirm();
|
||||||
};
|
};
|
||||||
|
@ -4,8 +4,11 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Blueprint/UserWidget.h"
|
#include "Blueprint/UserWidget.h"
|
||||||
|
#include "SharedDef.h"
|
||||||
#include "CaptureSettingsUserWidget.generated.h"
|
#include "CaptureSettingsUserWidget.generated.h"
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnOpenMenuStateChanged, bool, Open);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -13,5 +16,30 @@ UCLASS()
|
|||||||
class LUCKYROBOTS_API UCaptureSettingsUserWidget : public UUserWidget
|
class LUCKYROBOTS_API UCaptureSettingsUserWidget : public UUserWidget
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
protected:
|
||||||
|
virtual void NativeConstruct() override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
bool bIsOpen;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category = "Event")
|
||||||
|
FOnOpenMenuStateChanged OnOpenMenuStateChanged;
|
||||||
|
|
||||||
|
public:
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void ToggleMenu();
|
||||||
|
|
||||||
|
public:
|
||||||
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
|
void BPRefreshTaskList();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
|
void BPOnRandomMeshesUpdated();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
|
void BPLoadSettings();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
|
void ToggleMenuDisplay();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user