Compare commits
No commits in common. "537443339d3ee15ef60fc19d0bc8163ecaec3f32" and "592a43fa29f1e2fd031f7a9e12566808f4116d6b" have entirely different histories.
537443339d
...
592a43fa29
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EBathromm.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EBathromm.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EDecoration.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EDecoration.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EElectronics.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EElectronics.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EFurniture.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EFurniture.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EGoalList.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EGoalList.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EHoldHand.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EHoldHand.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EItemType.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EItemType.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EKitchenWware.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EKitchenWware.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ELevelType.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ELevelType.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/EListGroupModels.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/EListGroupModels.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesArms.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesArms.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesHands.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesHands.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesHeads.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesHeads.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesSensors.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ERobotAccessoriesSensors.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ERobotOtherAccessories.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ERobotOtherAccessories.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ERobotsMainCategories.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ERobotsMainCategories.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/Enums/ESenarioEnum.uasset
Normal file
BIN
Content/Blueprint/DATA/Enums/ESenarioEnum.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/datatables/DT_Bathroom.uasset
Normal file
BIN
Content/Blueprint/DATA/datatables/DT_Bathroom.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/datatables/DT_Decoration.uasset
Normal file
BIN
Content/Blueprint/DATA/datatables/DT_Decoration.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/datatables/DT_Electronics.uasset
Normal file
BIN
Content/Blueprint/DATA/datatables/DT_Electronics.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/datatables/DT_Furniture.uasset
Normal file
BIN
Content/Blueprint/DATA/datatables/DT_Furniture.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/datatables/DT_Item.uasset
Normal file
BIN
Content/Blueprint/DATA/datatables/DT_Item.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/datatables/DT_Kitchenware.uasset
Normal file
BIN
Content/Blueprint/DATA/datatables/DT_Kitchenware.uasset
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/EJsonTypeStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/EJsonTypeStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FBathroomStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FBathroomStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FDecorationStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FDecorationStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FElectronicsStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FElectronicsStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FFurnitureStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FFurnitureStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FItemStrucT.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FItemStrucT.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FKitchenwareStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FKitchenwareStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FLevelStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FLevelStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FLuckyCodeStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FLuckyCodeStruct.uasset
Normal file
Binary file not shown.
BIN
Content/Blueprint/DATA/structures/FMainBPCharacterStruct.uasset
Normal file
BIN
Content/Blueprint/DATA/structures/FMainBPCharacterStruct.uasset
Normal file
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.
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.
@ -1,5 +1,5 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "UI/Settings/CaptureSettingsUserWidget.h"
|
#include "CaptureSettingsUserWidget.h"
|
||||||
|
|
@ -1,125 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
|
||||||
#include "Core/LuckyRobotsGameInstance.h"
|
|
||||||
#include "GameFramework/GameUserSettings.h"
|
|
||||||
#include "Kismet/GameplayStatics.h"
|
|
||||||
#include "Settings/SG_CaptureSetting.h"
|
|
||||||
|
|
||||||
ULuckyRobotsGameInstance* ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(const UObject* WorldContextObject)
|
|
||||||
{
|
|
||||||
if (WorldContextObject && WorldContextObject->GetWorld())
|
|
||||||
{
|
|
||||||
return Cast<ULuckyRobotsGameInstance>(WorldContextObject->GetWorld()->GetGameInstance());
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
TArray<FRobotData> ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(const UObject* WorldContextObject)
|
|
||||||
{
|
|
||||||
TArray<FRobotData> RobotDataList;
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = GetLuckyRobotsGameInstance(WorldContextObject))
|
|
||||||
{
|
|
||||||
if (GameInstance->RobotDataDataTable)
|
|
||||||
{
|
|
||||||
FString ContextString;
|
|
||||||
TArray<FName> RowNames = GameInstance->RobotDataDataTable->GetRowNames();
|
|
||||||
for (const FName& RowName : RowNames)
|
|
||||||
{
|
|
||||||
FRobotData* pRow = GameInstance->RobotDataDataTable->FindRow<FRobotData>(RowName, ContextString);
|
|
||||||
if (pRow && pRow->bActive)
|
|
||||||
{
|
|
||||||
RobotDataList.Add(*pRow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return RobotDataList;
|
|
||||||
}
|
|
||||||
|
|
||||||
TArray<FLevelData> ULuckyRobotsFunctionLibrary::GetActiveLevelDataList(const UObject* WorldContextObject)
|
|
||||||
{
|
|
||||||
TArray<FLevelData> LevelDataList;
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = GetLuckyRobotsGameInstance(WorldContextObject))
|
|
||||||
{
|
|
||||||
if (GameInstance->LevelDataTable)
|
|
||||||
{
|
|
||||||
FString ContextString;
|
|
||||||
TArray<FName> RowNames = GameInstance->LevelDataTable->GetRowNames();
|
|
||||||
for (const FName& RowName : RowNames)
|
|
||||||
{
|
|
||||||
FLevelData* pRow = GameInstance->LevelDataTable->FindRow<FLevelData>(RowName, ContextString);
|
|
||||||
if (pRow && pRow->bActive)
|
|
||||||
{
|
|
||||||
LevelDataList.Add(*pRow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return LevelDataList;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ULuckyRobotsFunctionLibrary::UpdateQualitySettings(const UObject* WorldContextObject)
|
|
||||||
{
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = GetLuckyRobotsGameInstance(WorldContextObject))
|
|
||||||
{
|
|
||||||
if (UGameUserSettings* GameUserSettings = GEngine->GetGameUserSettings())
|
|
||||||
{
|
|
||||||
GameUserSettings->SetOverallScalabilityLevel(static_cast<int32>(GameInstance->CurrentSelectQuality));
|
|
||||||
GameUserSettings->SaveSettings();
|
|
||||||
GameUserSettings->ApplySettings(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FCaptureSettingsData ULuckyRobotsFunctionLibrary::LoadCaptureSettings(const UObject* WorldContextObject)
|
|
||||||
{
|
|
||||||
FCaptureSettingsData DefaultCaptureSetting;
|
|
||||||
DefaultCaptureSetting.FolderName = FText::FromString("robotdata");
|
|
||||||
DefaultCaptureSetting.FileName = FText::FromString("FILE");
|
|
||||||
DefaultCaptureSetting.WritesPerSec = FText::FromString("1");
|
|
||||||
DefaultCaptureSetting.NumberOfPeople = FText::FromString("1");
|
|
||||||
DefaultCaptureSetting.NumberOfObjects = FText::FromString("1");
|
|
||||||
DefaultCaptureSetting.NumberOfCaptures = FText::FromString("1");
|
|
||||||
|
|
||||||
USG_CaptureSetting* SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::LoadGameFromSlot("SGCaptureSettings", 0));
|
|
||||||
if (SaveGame)
|
|
||||||
{
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = GetLuckyRobotsGameInstance(WorldContextObject))
|
|
||||||
{
|
|
||||||
GameInstance->CurrentCaptureSettingsData = SaveGame->CaptureSetting;
|
|
||||||
}
|
|
||||||
return SaveGame->CaptureSetting;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::CreateSaveGameObject(USG_CaptureSetting::StaticClass()));
|
|
||||||
if (SaveGame)
|
|
||||||
{
|
|
||||||
SaveGame->CaptureSetting = DefaultCaptureSetting;
|
|
||||||
UGameplayStatics::SaveGameToSlot(SaveGame, "SGCaptureSettings", 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return DefaultCaptureSetting;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ULuckyRobotsFunctionLibrary::SaveCaptureSettings(const UObject* WorldContextObject, FCaptureSettingsData CaptureSetting)
|
|
||||||
{
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = GetLuckyRobotsGameInstance(WorldContextObject))
|
|
||||||
{
|
|
||||||
GameInstance->CurrentCaptureSettingsData = CaptureSetting;
|
|
||||||
}
|
|
||||||
|
|
||||||
USG_CaptureSetting* SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::LoadGameFromSlot("SGCaptureSettings", 0));
|
|
||||||
if (!SaveGame)
|
|
||||||
{
|
|
||||||
SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::CreateSaveGameObject(USG_CaptureSetting::StaticClass()));
|
|
||||||
}
|
|
||||||
if (SaveGame)
|
|
||||||
{
|
|
||||||
SaveGame->CaptureSetting = CaptureSetting;
|
|
||||||
UGameplayStatics::SaveGameToSlot(SaveGame, "SGCaptureSettings", 0);
|
|
||||||
}
|
|
||||||
}
|
|
17
Source/Luckyrobots/Private/GameUserWidget.cpp
Normal file
17
Source/Luckyrobots/Private/GameUserWidget.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "GameUserWidget.h"
|
||||||
|
#include "LuckyRobotsFunctionLibrary.h"
|
||||||
|
#include "LuckyRobotsGameInstance.h"
|
||||||
|
|
||||||
|
void UGameUserWidget::NativeConstruct()
|
||||||
|
{
|
||||||
|
Super::NativeConstruct();
|
||||||
|
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
LuckyRobotsGameInstance->GameUserWidget = this;
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "Lobby/LobbyGameMode.h"
|
#include "LobbyGameMode.h"
|
||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
#include "LuckyRobotsFunctionLibrary.h"
|
||||||
|
|
||||||
void ALobbyGameMode::BeginPlay()
|
void ALobbyGameMode::BeginPlay()
|
||||||
{
|
{
|
@ -1,7 +1,7 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "Lobby/LobbyPlayerController.h"
|
#include "LobbyPlayerController.h"
|
||||||
|
|
||||||
void ALobbyPlayerController::BeginPlay()
|
void ALobbyPlayerController::BeginPlay()
|
||||||
{
|
{
|
137
Source/Luckyrobots/Private/LuckyRobotsFunctionLibrary.cpp
Normal file
137
Source/Luckyrobots/Private/LuckyRobotsFunctionLibrary.cpp
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "LuckyRobotsFunctionLibrary.h"
|
||||||
|
#include "LuckyRobotsGameInstance.h"
|
||||||
|
#include "GameFramework/GameUserSettings.h"
|
||||||
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
#include "SG_CaptureSetting.h"
|
||||||
|
|
||||||
|
ULuckyRobotsGameInstance* ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(const UObject* WorldContextObject)
|
||||||
|
{
|
||||||
|
return Cast<ULuckyRobotsGameInstance>(WorldContextObject->GetWorld()->GetGameInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
TArray<FRobotData> ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(const UObject* WorldContextObject)
|
||||||
|
{
|
||||||
|
TArray<FRobotData> RobotDataList;
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = GetLuckyRobotsGameInstance(WorldContextObject);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
if (LuckyRobotsGameInstance->RobotDataDataTable)
|
||||||
|
{
|
||||||
|
FString ContextString;
|
||||||
|
TArray<FName> RowNames = LuckyRobotsGameInstance->RobotDataDataTable->GetRowNames();
|
||||||
|
for (auto RowString : RowNames)
|
||||||
|
{
|
||||||
|
FRobotData* pRow = LuckyRobotsGameInstance->RobotDataDataTable->FindRow<FRobotData>(FName(RowString), ContextString);
|
||||||
|
if (pRow)
|
||||||
|
{
|
||||||
|
if (pRow->bActive)
|
||||||
|
{
|
||||||
|
RobotDataList.Add(*pRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RobotDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
TArray<FLevelData> ULuckyRobotsFunctionLibrary::GetActiveLevelDataList(const UObject* WorldContextObject)
|
||||||
|
{
|
||||||
|
TArray<FLevelData> LevelDataList;
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = GetLuckyRobotsGameInstance(WorldContextObject);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
if (LuckyRobotsGameInstance->LevelDataTable)
|
||||||
|
{
|
||||||
|
FString ContextString;
|
||||||
|
TArray<FName> RowNames = LuckyRobotsGameInstance->LevelDataTable->GetRowNames();
|
||||||
|
for (auto RowString : RowNames)
|
||||||
|
{
|
||||||
|
FLevelData* pRow = LuckyRobotsGameInstance->LevelDataTable->FindRow<FLevelData>(FName(RowString), ContextString);
|
||||||
|
if (pRow)
|
||||||
|
{
|
||||||
|
if (pRow->bActive)
|
||||||
|
{
|
||||||
|
LevelDataList.Add(*pRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return LevelDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ULuckyRobotsFunctionLibrary::UpdateQualitySettings(const UObject* WorldContextObject)
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = GetLuckyRobotsGameInstance(WorldContextObject);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
// Load game user settings and apply
|
||||||
|
UGameUserSettings* GameUserSettings = GEngine->GetGameUserSettings();
|
||||||
|
if (GameUserSettings)
|
||||||
|
{
|
||||||
|
GameUserSettings->SetOverallScalabilityLevel(int(LuckyRobotsGameInstance->CurrentSelectQuality));
|
||||||
|
GameUserSettings->SaveSettings();
|
||||||
|
GameUserSettings->ApplySettings(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FCaptureSettingsData ULuckyRobotsFunctionLibrary::LoadCaptureSettings(const UObject* WorldContextObject)
|
||||||
|
{
|
||||||
|
FCaptureSettingsData DefaultCaptureSetting;
|
||||||
|
DefaultCaptureSetting.FolderName = FText::FromString("robotdata");
|
||||||
|
DefaultCaptureSetting.FileName = FText::FromString("FILE");
|
||||||
|
DefaultCaptureSetting.WritesPerSec = FText::FromString("1");
|
||||||
|
DefaultCaptureSetting.NumberOfPeople = FText::FromString("1");
|
||||||
|
DefaultCaptureSetting.NumberOfObjects = FText::FromString("1");
|
||||||
|
DefaultCaptureSetting.NumberOfCaptures = FText::FromString("1");
|
||||||
|
|
||||||
|
USG_CaptureSetting* SaveGame = nullptr;
|
||||||
|
SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::LoadGameFromSlot("SGCaptureSettings", 0));
|
||||||
|
if (SaveGame)
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = GetLuckyRobotsGameInstance(WorldContextObject);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
LuckyRobotsGameInstance->CurrentCaptureSettingsData = SaveGame->CaptureSetting;
|
||||||
|
}
|
||||||
|
return SaveGame->CaptureSetting;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::CreateSaveGameObject(USG_CaptureSetting::StaticClass()));
|
||||||
|
if (SaveGame)
|
||||||
|
{
|
||||||
|
SaveGame->CaptureSetting = DefaultCaptureSetting;
|
||||||
|
UGameplayStatics::SaveGameToSlot(SaveGame, "SGCaptureSettings", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return DefaultCaptureSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ULuckyRobotsFunctionLibrary::SaveCaptureSettings(const UObject* WorldContextObject, FCaptureSettingsData CaptureSetting)
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = GetLuckyRobotsGameInstance(WorldContextObject);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
LuckyRobotsGameInstance->CurrentCaptureSettingsData = CaptureSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
USG_CaptureSetting* SaveGame = nullptr;
|
||||||
|
SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::LoadGameFromSlot("SGCaptureSettings", 0));
|
||||||
|
if (!SaveGame)
|
||||||
|
{
|
||||||
|
SaveGame = Cast<USG_CaptureSetting>(UGameplayStatics::CreateSaveGameObject(USG_CaptureSetting::StaticClass()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SaveGame)
|
||||||
|
{
|
||||||
|
SaveGame->CaptureSetting = CaptureSetting;
|
||||||
|
UGameplayStatics::SaveGameToSlot(SaveGame, "SGCaptureSettings", 0);
|
||||||
|
}
|
||||||
|
}
|
@ -1,22 +1,23 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "Core/LuckyRobotsGameInstance.h"
|
#include "LuckyRobotsGameInstance.h"
|
||||||
#include "GameModes/LuckyRobotsGameState.h"
|
#include "LuckyRobotsGameState.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "UI/GameUserWidget.h"
|
#include "GameUserWidget.h"
|
||||||
#include "Kismet/KismetSystemLibrary.h"
|
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::DoSendMessage(const FString& SendValue)
|
void ULuckyRobotsGameInstance::DoSendMessage(FString SendValue)
|
||||||
{
|
{
|
||||||
if (ALuckyRobotsGameState* GameState = Cast<ALuckyRobotsGameState>(UGameplayStatics::GetGameState(this)))
|
ALuckyRobotsGameState* LuckyRobotsGameState = Cast<ALuckyRobotsGameState>(UGameplayStatics::GetGameState(this));
|
||||||
|
if (LuckyRobotsGameState)
|
||||||
{
|
{
|
||||||
GameState->DoSendMessage(SendValue);
|
LuckyRobotsGameState->DoSendMessage(SendValue);
|
||||||
}
|
}
|
||||||
DoLogItemAdd(TEXT("Receive"), SendValue, ELogItemType::Debug);
|
|
||||||
|
DoLogItemAdd("Receive", SendValue, ELogItemType::Debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::DoLogItemAdd(const FString& Topic, const FString& MsgText, ELogItemType LogItemType)
|
void ULuckyRobotsGameInstance::DoLogItemAdd(FString Topic, FString MsgText, ELogItemType LogItemType)
|
||||||
{
|
{
|
||||||
if (GameUserWidget)
|
if (GameUserWidget)
|
||||||
{
|
{
|
||||||
@ -26,16 +27,15 @@ void ULuckyRobotsGameInstance::DoLogItemAdd(const FString& Topic, const FString&
|
|||||||
|
|
||||||
void ULuckyRobotsGameInstance::SwitchGamePaused()
|
void ULuckyRobotsGameInstance::SwitchGamePaused()
|
||||||
{
|
{
|
||||||
bool bPaused = UGameplayStatics::IsGamePaused(this);
|
UGameplayStatics::SetGamePaused(this, !UGameplayStatics::IsGamePaused(this));
|
||||||
UGameplayStatics::SetGamePaused(this, !bPaused);
|
|
||||||
|
|
||||||
if (!bPaused)
|
if (UGameplayStatics::IsGamePaused(this))
|
||||||
{
|
{
|
||||||
UKismetSystemLibrary::ExecuteConsoleCommand(this, TEXT("r.SceneRendering 0"));
|
UKismetSystemLibrary::ExecuteConsoleCommand(this, "r.SceneRendering 0");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UKismetSystemLibrary::ExecuteConsoleCommand(this, TEXT("r.SceneRendering 1"));
|
UKismetSystemLibrary::ExecuteConsoleCommand(this, "r.SceneRendering 1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,19 +44,18 @@ void ULuckyRobotsGameInstance::ClearTaskList()
|
|||||||
TaskList.Empty();
|
TaskList.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::AddTask(const FGoalsTaskData& TaskData)
|
void ULuckyRobotsGameInstance::AddTask(FGoalsTaskData TaskData)
|
||||||
{
|
{
|
||||||
TaskList.Add(TaskData);
|
TaskList.Add(TaskData);
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::RemoveTask(FGoalsTaskData TaskData)
|
||||||
void ULuckyRobotsGameInstance::RemoveTask(const FGoalsTaskData& TaskData)
|
|
||||||
{
|
{
|
||||||
TaskList.Remove(TaskData);
|
TaskList.Remove(TaskData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::RemoveTaskByGoalType(EGoalType GoalType)
|
void ULuckyRobotsGameInstance::RemoveTaskByGoalType(EGoalType GoalType)
|
||||||
{
|
{
|
||||||
for (const FGoalsTaskData& Task : TaskList)
|
for (auto Task : TaskList)
|
||||||
{
|
{
|
||||||
if (Task.GoalType == GoalType)
|
if (Task.GoalType == GoalType)
|
||||||
{
|
{
|
||||||
@ -66,12 +65,12 @@ void ULuckyRobotsGameInstance::RemoveTaskByGoalType(EGoalType GoalType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 ULuckyRobotsGameInstance::GetTaskNum() const
|
int ULuckyRobotsGameInstance::GetTaskNum()
|
||||||
{
|
{
|
||||||
return TaskList.Num();
|
return TaskList.Num();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetTask(int32 Index, const FGoalsTaskData& TaskData)
|
void ULuckyRobotsGameInstance::SetTask(int Index, FGoalsTaskData TaskData)
|
||||||
{
|
{
|
||||||
if (TaskList.IsValidIndex(Index))
|
if (TaskList.IsValidIndex(Index))
|
||||||
{
|
{
|
||||||
@ -79,7 +78,7 @@ void ULuckyRobotsGameInstance::SetTask(int32 Index, const FGoalsTaskData& TaskDa
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (TaskList.Num() < Index)
|
for (int i = TaskList.Num(); i < Index; i++)
|
||||||
{
|
{
|
||||||
FGoalsTaskData TempTaskData;
|
FGoalsTaskData TempTaskData;
|
||||||
AddTask(TempTaskData);
|
AddTask(TempTaskData);
|
||||||
@ -88,37 +87,39 @@ void ULuckyRobotsGameInstance::SetTask(int32 Index, const FGoalsTaskData& TaskDa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ULuckyRobotsGameInstance::GetTask(int32 Index, FGoalsTaskData& OutTaskData) const
|
bool ULuckyRobotsGameInstance::GetTask(int Index, FGoalsTaskData& TaskData)
|
||||||
{
|
{
|
||||||
if (TaskList.IsValidIndex(Index))
|
if (TaskList.IsValidIndex(Index))
|
||||||
{
|
{
|
||||||
OutTaskData = TaskList[Index];
|
TaskData = TaskList[Index];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::ReSetTaskList()
|
void ULuckyRobotsGameInstance::ReSetTaskList()
|
||||||
{
|
{
|
||||||
TArray<FGoalsTaskData> TempTaskList;
|
TArray<FGoalsTaskData> TempTaskList;
|
||||||
for (FGoalsTaskData& Task : TaskList)
|
for (auto Task : TaskList)
|
||||||
{
|
{
|
||||||
Task.bIsStart = false;
|
Task.bIsStart = false;
|
||||||
Task.bIsComplete = false;
|
Task.bIsStart = false;
|
||||||
Task.bActive = false;
|
Task.bActive = false;
|
||||||
TempTaskList.Add(Task);
|
TempTaskList.Add(Task);
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskList = TempTaskList;
|
TaskList = TempTaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<FGoalsTaskData> ULuckyRobotsGameInstance::GetTaskList() const
|
TArray<FGoalsTaskData> ULuckyRobotsGameInstance::GetTaskList()
|
||||||
{
|
{
|
||||||
return TaskList;
|
return TaskList;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::DoSetTempTaskValueChange(bool bIsClear)
|
void ULuckyRobotsGameInstance::DoSetTempTaskValueChange(bool IsClear)
|
||||||
{
|
{
|
||||||
if (bIsClear)
|
if (IsClear)
|
||||||
{
|
{
|
||||||
ClearTaskList();
|
ClearTaskList();
|
||||||
}
|
}
|
||||||
@ -133,162 +134,133 @@ void ULuckyRobotsGameInstance::DoSetTempTaskValueChange(bool bIsClear)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentFolderName(const FString& FolderName)
|
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentFolderName(FString FolderName)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.FolderName = FText::FromString(FolderName);
|
CurrentCaptureSettingsData.FolderName = FText::FromString(FolderName);
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentFileName(FString FileName)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentFileName(const FString& FileName)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.FileName = FText::FromString(FileName);
|
CurrentCaptureSettingsData.FileName = FText::FromString(FileName);
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentWritesPerSec(int WritesPerSec)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentWritesPerSec(int32 WritesPerSec)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.WritesPerSec = FText::FromString(FString::FromInt(WritesPerSec));
|
CurrentCaptureSettingsData.WritesPerSec = FText::FromString(FString::FromInt(WritesPerSec));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsScenario(bool IsScenario)
|
void ULuckyRobotsGameInstance::SetCurrentIsScenario(bool IsScenario)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.IsScenario = IsScenario;
|
CurrentCaptureSettingsData.IsScenario = IsScenario;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsRandomLight(bool bLight)
|
void ULuckyRobotsGameInstance::SetCurrentIsRandomLight(bool bLight)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bLight = bLight;
|
CurrentCaptureSettingsData.bLight = bLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsRandomMaterials(bool bMaterials)
|
void ULuckyRobotsGameInstance::SetCurrentIsRandomMaterials(bool bMaterials)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bMaterials = bMaterials;
|
CurrentCaptureSettingsData.bMaterials = bMaterials;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsRandomRobotPosition(bool bRobotPosition)
|
void ULuckyRobotsGameInstance::SetCurrentIsRandomRobotPosition(bool bRobotPosition)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bRobotPosition = bRobotPosition;
|
CurrentCaptureSettingsData.bRobotPosition = bRobotPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsRandomPets(bool bPets)
|
void ULuckyRobotsGameInstance::SetCurrentIsRandomPets(bool bPets)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bPets = bPets;
|
CurrentCaptureSettingsData.bPets = bPets;
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentPetsNumber(int PetsNumber)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentPetsNumber(int32 PetsNumber)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.NumberOfPets = FText::FromString(FString::FromInt(PetsNumber));
|
CurrentCaptureSettingsData.NumberOfPets = FText::FromString(FString::FromInt(PetsNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsRandomPeople(bool bPeople)
|
void ULuckyRobotsGameInstance::SetCurrentIsRandomPeople(bool bPeople)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bPeople = bPeople;
|
CurrentCaptureSettingsData.bPeople = bPeople;
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentPeopleNumber(int PeopleNumber)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentPeopleNumber(int32 PeopleNumber)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.NumberOfPeople = FText::FromString(FString::FromInt(PeopleNumber));
|
CurrentCaptureSettingsData.NumberOfPeople = FText::FromString(FString::FromInt(PeopleNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsRandomObjects(bool bObjects)
|
void ULuckyRobotsGameInstance::SetCurrentIsRandomObjects(bool bObjects)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bObjects = bObjects;
|
CurrentCaptureSettingsData.bObjects = bObjects;
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentObjectsNumber(int ObjectsNumber)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentObjectsNumber(int32 ObjectsNumber)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.NumberOfObjects = FText::FromString(FString::FromInt(ObjectsNumber));
|
CurrentCaptureSettingsData.NumberOfObjects = FText::FromString(FString::FromInt(ObjectsNumber));
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentRandomMeshes(TArray<TSoftObjectPtr<UStaticMeshComponent>> RandomMeshes)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentRandomMeshes(const TArray<TSoftObjectPtr<UStaticMesh>>& RandomMeshes)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.RandomMeshes = RandomMeshes;
|
CurrentCaptureSettingsData.RandomMeshes = RandomMeshes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULuckyRobotsGameInstance::SetCurrentIsInfiniteCapture(bool bInfiniteCapture)
|
void ULuckyRobotsGameInstance::SetCurrentIsInfiniteCapture(bool bInfiniteCapture)
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.bInfiniteCapture = bInfiniteCapture;
|
CurrentCaptureSettingsData.bInfiniteCapture = bInfiniteCapture;
|
||||||
}
|
}
|
||||||
|
void ULuckyRobotsGameInstance::SetCurrentCaptureNumber(int CaptureNumber)
|
||||||
void ULuckyRobotsGameInstance::SetCurrentCaptureNumber(int32 CaptureNumber)
|
|
||||||
{
|
{
|
||||||
CurrentCaptureSettingsData.NumberOfCaptures = FText::FromString(FString::FromInt(CaptureNumber));
|
CurrentCaptureSettingsData.NumberOfCaptures = FText::FromString(FString::FromInt(CaptureNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
FString ULuckyRobotsGameInstance::GetCurrentFolderName() const
|
FString ULuckyRobotsGameInstance::GetCurrentFolderName()
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.FolderName.ToString();
|
return CurrentCaptureSettingsData.FolderName.ToString();
|
||||||
}
|
}
|
||||||
|
FString ULuckyRobotsGameInstance::GetCurrentFileName()
|
||||||
FString ULuckyRobotsGameInstance::GetCurrentFileName() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.FileName.ToString();
|
return CurrentCaptureSettingsData.FileName.ToString();
|
||||||
}
|
}
|
||||||
|
int ULuckyRobotsGameInstance::GetCurrentWritesPerSec()
|
||||||
int32 ULuckyRobotsGameInstance::GetCurrentWritesPerSec() const
|
|
||||||
{
|
{
|
||||||
return FCString::Atoi(*CurrentCaptureSettingsData.WritesPerSec.ToString());
|
return FCString::Atoi(*(CurrentCaptureSettingsData.WritesPerSec.ToString()));
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsScenario()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsScenario() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.IsScenario;
|
return CurrentCaptureSettingsData.IsScenario;
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsRandomLight()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsRandomLight() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bLight;
|
return CurrentCaptureSettingsData.bLight;
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsRandomMaterials()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsRandomMaterials() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bMaterials;
|
return CurrentCaptureSettingsData.bMaterials;
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsRandomRobotPosition()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsRandomRobotPosition() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bRobotPosition;
|
return CurrentCaptureSettingsData.bRobotPosition;
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsRandomPets()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsRandomPets() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bPets;
|
return CurrentCaptureSettingsData.bPets;
|
||||||
}
|
}
|
||||||
|
int ULuckyRobotsGameInstance::GetCurrentPetsNumber()
|
||||||
int32 ULuckyRobotsGameInstance::GetCurrentPetsNumber() const
|
|
||||||
{
|
{
|
||||||
return FCString::Atoi(*CurrentCaptureSettingsData.NumberOfPets.ToString());
|
return FCString::Atoi(*(CurrentCaptureSettingsData.NumberOfPets.ToString()));
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsRandomPeople()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsRandomPeople() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bPeople;
|
return CurrentCaptureSettingsData.bPeople;
|
||||||
}
|
}
|
||||||
|
int ULuckyRobotsGameInstance::GetCurrentPeopleNumber()
|
||||||
int32 ULuckyRobotsGameInstance::GetCurrentPeopleNumber() const
|
|
||||||
{
|
{
|
||||||
return FCString::Atoi(*CurrentCaptureSettingsData.NumberOfPeople.ToString());
|
return FCString::Atoi(*(CurrentCaptureSettingsData.NumberOfPeople.ToString()));
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsRandomObjects()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsRandomObjects() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bObjects;
|
return CurrentCaptureSettingsData.bObjects;
|
||||||
}
|
}
|
||||||
|
int ULuckyRobotsGameInstance::GetCurrentObjectsNumber()
|
||||||
int32 ULuckyRobotsGameInstance::GetCurrentObjectsNumber() const
|
|
||||||
{
|
{
|
||||||
return FCString::Atoi(*CurrentCaptureSettingsData.NumberOfObjects.ToString());
|
return FCString::Atoi(*(CurrentCaptureSettingsData.NumberOfObjects.ToString()));
|
||||||
}
|
}
|
||||||
|
TArray<TSoftObjectPtr<UStaticMeshComponent>> ULuckyRobotsGameInstance::GetCurrentRandomMeshes()
|
||||||
TArray<TSoftObjectPtr<UStaticMesh>> ULuckyRobotsGameInstance::GetCurrentRandomMeshes() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.RandomMeshes;
|
return CurrentCaptureSettingsData.RandomMeshes;
|
||||||
}
|
}
|
||||||
|
bool ULuckyRobotsGameInstance::GetCurrentIsInfiniteCapture()
|
||||||
bool ULuckyRobotsGameInstance::GetCurrentIsInfiniteCapture() const
|
|
||||||
{
|
{
|
||||||
return CurrentCaptureSettingsData.bInfiniteCapture;
|
return CurrentCaptureSettingsData.bInfiniteCapture;
|
||||||
}
|
}
|
||||||
|
int ULuckyRobotsGameInstance::GetCurrentCaptureNumber()
|
||||||
int32 ULuckyRobotsGameInstance::GetCurrentCaptureNumber() const
|
|
||||||
{
|
{
|
||||||
return FCString::Atoi(*CurrentCaptureSettingsData.NumberOfCaptures.ToString());
|
return FCString::Atoi(*(CurrentCaptureSettingsData.NumberOfCaptures.ToString()));
|
||||||
}
|
}
|
@ -1,13 +1,14 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "GameModes/LuckyRobotsGameMode.h"
|
#include "LuckyRobotsGameMode.h"
|
||||||
#include "Core/LuckyRobotsGameInstance.h"
|
#include "LuckyRobotsGameInstance.h"
|
||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
#include "LuckyRobotsFunctionLibrary.h"
|
||||||
|
|
||||||
void ALuckyRobotsGameMode::BeginPlay()
|
void ALuckyRobotsGameMode::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
ULuckyRobotsFunctionLibrary::UpdateQualitySettings(this);
|
ULuckyRobotsFunctionLibrary::UpdateQualitySettings(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,21 +17,24 @@ UClass* ALuckyRobotsGameMode::GetDefaultPawnClassForController_Implementation(AC
|
|||||||
UClass* RobotClass = Super::GetDefaultPawnClassForController_Implementation(InController);
|
UClass* RobotClass = Super::GetDefaultPawnClassForController_Implementation(InController);
|
||||||
|
|
||||||
ERobotsName CurrentRobot = ERobotsName::None;
|
ERobotsName CurrentRobot = ERobotsName::None;
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
{
|
{
|
||||||
CurrentRobot = GameInstance->CurrentSelectRobot;
|
CurrentRobot = LuckyRobotsGameInstance->CurrentSelectRobot;
|
||||||
}
|
}
|
||||||
if (CurrentRobot != ERobotsName::None)
|
if (CurrentRobot != ERobotsName::None)
|
||||||
{
|
{
|
||||||
TArray<FRobotData> ActiveRobotDataList = ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(this);
|
TArray<FRobotData> ActiveRobotDataList = ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(this);
|
||||||
for (const FRobotData& RobotData : ActiveRobotDataList)
|
for (auto ActiveRobotData : ActiveRobotDataList)
|
||||||
{
|
{
|
||||||
if (RobotData.Name == CurrentRobot)
|
if (ActiveRobotData.Name == CurrentRobot)
|
||||||
{
|
{
|
||||||
RobotClass = RobotData.RobotClass;
|
RobotClass = ActiveRobotData.RobotClass;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return RobotClass;
|
return RobotClass;
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "GameModes/LuckyRobotsGameState.h"
|
#include "LuckyRobotsGameState.h"
|
||||||
#include "SocketIOClientComponent.h"
|
#include "SocketIOClientComponent.h"
|
||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
#include "LuckyRobotsFunctionLibrary.h"
|
||||||
#include "Core/LuckyRobotsGameInstance.h"
|
#include "LuckyRobotsGameInstance.h"
|
||||||
|
|
||||||
ALuckyRobotsGameState::ALuckyRobotsGameState()
|
ALuckyRobotsGameState::ALuckyRobotsGameState()
|
||||||
{
|
{
|
||||||
@ -14,6 +14,7 @@ ALuckyRobotsGameState::ALuckyRobotsGameState()
|
|||||||
void ALuckyRobotsGameState::BeginPlay()
|
void ALuckyRobotsGameState::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
if (SocketIOClientComponent)
|
if (SocketIOClientComponent)
|
||||||
{
|
{
|
||||||
SocketIOClientComponent->Connect(L"http://localhost:3000/");
|
SocketIOClientComponent->Connect(L"http://localhost:3000/");
|
||||||
@ -22,25 +23,33 @@ void ALuckyRobotsGameState::BeginPlay()
|
|||||||
|
|
||||||
void ALuckyRobotsGameState::DoSendMessage(FString SendValue)
|
void ALuckyRobotsGameState::DoSendMessage(FString SendValue)
|
||||||
{
|
{
|
||||||
if (SocketIOClientComponent && SocketIOClientComponent->bIsConnected)
|
if (SocketIOClientComponent)
|
||||||
{
|
{
|
||||||
USIOJsonValue* SIOJsonValue = USIOJsonValue::ConstructJsonValueString(this, SendValue);
|
if (SocketIOClientComponent->bIsConnected)
|
||||||
SocketIOClientComponent->Emit(TEXT("message"), SIOJsonValue);
|
{
|
||||||
|
USIOJsonValue* SIOJsonValue = USIOJsonValue::ConstructJsonValueString(this, SendValue);
|
||||||
|
SocketIOClientComponent->Emit("message", SIOJsonValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ALuckyRobotsGameState::DoSocketOnConnect(FString SocketId, FString SessionId, bool IsReconnection)
|
void ALuckyRobotsGameState::DoSocketOnConnect(FString SocketId, FString SessionId, bool IsReconnection)
|
||||||
{
|
{
|
||||||
if (SocketIOClientComponent && SocketIOClientComponent->bIsConnected)
|
if (SocketIOClientComponent)
|
||||||
{
|
{
|
||||||
SocketIOClientComponent->BindEventToGenericEvent(TEXT("response"));
|
if (SocketIOClientComponent->bIsConnected)
|
||||||
|
{
|
||||||
|
SocketIOClientComponent->BindEventToGenericEvent("response");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ALuckyRobotsGameState::DoSocketOnGenericEvent(FString EventName, USIOJsonValue* EventData)
|
void ALuckyRobotsGameState::DoSocketOnGenericEvent(FString EventName, USIOJsonValue* EventData)
|
||||||
{
|
{
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this))
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this);
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
{
|
{
|
||||||
GameInstance->DoGetDispatch(EventName, EventData);
|
LuckyRobotsGameInstance->DoGetDispatch(EventName, EventData);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "Controllers/LuckyRobotsPlayerController.h"
|
#include "LuckyRobotsPlayerController.h"
|
||||||
|
|
149
Source/Luckyrobots/Private/MainScreenUserWidget.cpp
Normal file
149
Source/Luckyrobots/Private/MainScreenUserWidget.cpp
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "MainScreenUserWidget.h"
|
||||||
|
#include "Engine/DataTable.h"
|
||||||
|
#include "LuckyRobotsGameInstance.h"
|
||||||
|
#include "LuckyRobotsFunctionLibrary.h"
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::NativeConstruct()
|
||||||
|
{
|
||||||
|
Super::NativeConstruct();
|
||||||
|
|
||||||
|
InitData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::InitData()
|
||||||
|
{
|
||||||
|
InitRobotData();
|
||||||
|
InitLevelData();
|
||||||
|
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
iCurrentSelectQuality = int(LuckyRobotsGameInstance->CurrentSelectQuality);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::InitRobotData()
|
||||||
|
{
|
||||||
|
RobotDataList = ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(this);
|
||||||
|
|
||||||
|
iCurrentSelectRobot = 0;
|
||||||
|
UpdateSelectRobot();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::InitLevelData()
|
||||||
|
{
|
||||||
|
LevelDataList = ULuckyRobotsFunctionLibrary::GetActiveLevelDataList(this);
|
||||||
|
|
||||||
|
FRobotData CurrentRobotData = GetCurrentRobotData();
|
||||||
|
if (CurrentRobotData.Name != ERobotsName::None)
|
||||||
|
{
|
||||||
|
TArray<FLevelData> ActiveLevelDataList = LevelDataList;
|
||||||
|
|
||||||
|
LevelDataList.Empty();
|
||||||
|
for (auto ActiveLevelData : ActiveLevelDataList)
|
||||||
|
{
|
||||||
|
if (ActiveLevelData.RobotTypeList.Find(CurrentRobotData.RobotType) >= 0)
|
||||||
|
{
|
||||||
|
LevelDataList.Add(ActiveLevelData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
iCurrentSelectLevel = 0;
|
||||||
|
UpdateSelectLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
FRobotData UMainScreenUserWidget::GetCurrentRobotData()
|
||||||
|
{
|
||||||
|
FRobotData CurrentRobotData;
|
||||||
|
if (RobotDataList.IsValidIndex(iCurrentSelectRobot))
|
||||||
|
{
|
||||||
|
CurrentRobotData = RobotDataList[iCurrentSelectRobot];
|
||||||
|
}
|
||||||
|
return CurrentRobotData;
|
||||||
|
}
|
||||||
|
|
||||||
|
FLevelData UMainScreenUserWidget::GetCurrentLevelData()
|
||||||
|
{
|
||||||
|
FLevelData CurrentLevelData;
|
||||||
|
if (LevelDataList.IsValidIndex(iCurrentSelectLevel))
|
||||||
|
{
|
||||||
|
CurrentLevelData = LevelDataList[iCurrentSelectLevel];
|
||||||
|
}
|
||||||
|
return CurrentLevelData;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::SelectNextRobot()
|
||||||
|
{
|
||||||
|
iCurrentSelectRobot = FMath::Clamp(iCurrentSelectRobot + 1, 0, RobotDataList.Num() - 1);
|
||||||
|
UpdateSelectRobot();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::SelectPreviousRobot()
|
||||||
|
{
|
||||||
|
iCurrentSelectRobot = FMath::Clamp(iCurrentSelectRobot - 1, 0, RobotDataList.Num() - 1);
|
||||||
|
UpdateSelectRobot();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::SelectNextLevel()
|
||||||
|
{
|
||||||
|
iCurrentSelectLevel = FMath::Clamp(iCurrentSelectLevel + 1, 0, LevelDataList.Num() - 1);
|
||||||
|
UpdateSelectLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::SelectPreviousLevel()
|
||||||
|
{
|
||||||
|
iCurrentSelectLevel = FMath::Clamp(iCurrentSelectLevel - 1, 0, LevelDataList.Num() - 1);
|
||||||
|
UpdateSelectLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::SelectNextQuality()
|
||||||
|
{
|
||||||
|
UEnum* QualityEnum = StaticEnum<EQualityEnum>();
|
||||||
|
int QualityEnumNum = QualityEnum->NumEnums() - 1;
|
||||||
|
iCurrentSelectQuality = FMath::Clamp(iCurrentSelectQuality - 1, 0, QualityEnumNum - 1);
|
||||||
|
|
||||||
|
UpdateSelectQuality();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::SelectPreviousQuality()
|
||||||
|
{
|
||||||
|
UEnum* QualityEnum = StaticEnum<EQualityEnum>();
|
||||||
|
int QualityEnumNum = QualityEnum->NumEnums() - 1;
|
||||||
|
iCurrentSelectQuality = FMath::Clamp(iCurrentSelectQuality + 1, 0, QualityEnumNum - 1);
|
||||||
|
|
||||||
|
UpdateSelectQuality();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::UpdateSelectRobot()
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
LuckyRobotsGameInstance->CurrentSelectRobot = GetCurrentRobotData().Name;
|
||||||
|
}
|
||||||
|
BPUpdateSelectRobot();
|
||||||
|
InitLevelData();
|
||||||
|
}
|
||||||
|
void UMainScreenUserWidget::UpdateSelectLevel()
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
LuckyRobotsGameInstance->CurrentSelectLevel = GetCurrentLevelData().LevelEnum;
|
||||||
|
}
|
||||||
|
BPUpdateSelectLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UMainScreenUserWidget::UpdateSelectQuality()
|
||||||
|
{
|
||||||
|
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
|
||||||
|
if (LuckyRobotsGameInstance)
|
||||||
|
{
|
||||||
|
LuckyRobotsGameInstance->CurrentSelectQuality = static_cast<EQualityEnum>(iCurrentSelectQuality);
|
||||||
|
}
|
||||||
|
BPUpdateSelectQuality();
|
||||||
|
}
|
@ -1,137 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "Menus/MainScreenUserWidget.h"
|
|
||||||
#include "Engine/DataTable.h"
|
|
||||||
#include "Core/LuckyRobotsGameInstance.h"
|
|
||||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::NativeConstruct()
|
|
||||||
{
|
|
||||||
Super::NativeConstruct();
|
|
||||||
InitData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::InitData()
|
|
||||||
{
|
|
||||||
InitRobotData();
|
|
||||||
InitLevelData();
|
|
||||||
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
|
||||||
{
|
|
||||||
CurrentQualityIndex = static_cast<int32>(GameInstance->CurrentSelectQuality);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::InitRobotData()
|
|
||||||
{
|
|
||||||
RobotDataList = ULuckyRobotsFunctionLibrary::GetActiveRobotDataList(this);
|
|
||||||
CurrentRobotIndex = 0;
|
|
||||||
UpdateSelectRobot();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::InitLevelData()
|
|
||||||
{
|
|
||||||
LevelDataList = ULuckyRobotsFunctionLibrary::GetActiveLevelDataList(this);
|
|
||||||
FRobotData CurrentRobotData = GetCurrentRobotData();
|
|
||||||
if (CurrentRobotData.Name != ERobotsName::None)
|
|
||||||
{
|
|
||||||
TArray<FLevelData> FilteredLevels;
|
|
||||||
for (const FLevelData& LevelData : LevelDataList)
|
|
||||||
{
|
|
||||||
if (LevelData.RobotTypeList.Contains(CurrentRobotData.RobotType))
|
|
||||||
{
|
|
||||||
FilteredLevels.Add(LevelData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LevelDataList = FilteredLevels;
|
|
||||||
}
|
|
||||||
CurrentLevelIndex = 0;
|
|
||||||
UpdateSelectLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
FRobotData UMainScreenUserWidget::GetCurrentRobotData() const
|
|
||||||
{
|
|
||||||
if (RobotDataList.IsValidIndex(CurrentRobotIndex))
|
|
||||||
{
|
|
||||||
return RobotDataList[CurrentRobotIndex];
|
|
||||||
}
|
|
||||||
return FRobotData();
|
|
||||||
}
|
|
||||||
|
|
||||||
FLevelData UMainScreenUserWidget::GetCurrentLevelData() const
|
|
||||||
{
|
|
||||||
if (LevelDataList.IsValidIndex(CurrentLevelIndex))
|
|
||||||
{
|
|
||||||
return LevelDataList[CurrentLevelIndex];
|
|
||||||
}
|
|
||||||
return FLevelData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::SelectNextRobot()
|
|
||||||
{
|
|
||||||
CurrentRobotIndex = FMath::Clamp(CurrentRobotIndex + 1, 0, RobotDataList.Num() - 1);
|
|
||||||
UpdateSelectRobot();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::SelectPreviousRobot()
|
|
||||||
{
|
|
||||||
CurrentRobotIndex = FMath::Clamp(CurrentRobotIndex - 1, 0, RobotDataList.Num() - 1);
|
|
||||||
UpdateSelectRobot();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::SelectNextLevel()
|
|
||||||
{
|
|
||||||
CurrentLevelIndex = FMath::Clamp(CurrentLevelIndex + 1, 0, LevelDataList.Num() - 1);
|
|
||||||
UpdateSelectLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::SelectPreviousLevel()
|
|
||||||
{
|
|
||||||
CurrentLevelIndex = FMath::Clamp(CurrentLevelIndex - 1, 0, LevelDataList.Num() - 1);
|
|
||||||
UpdateSelectLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::SelectNextQuality()
|
|
||||||
{
|
|
||||||
UEnum* QualityEnum = StaticEnum<EQualityEnum>();
|
|
||||||
int32 EnumCount = QualityEnum->NumEnums() - 1;
|
|
||||||
CurrentQualityIndex = FMath::Clamp(CurrentQualityIndex - 1, 0, EnumCount - 1);
|
|
||||||
UpdateSelectQuality();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::SelectPreviousQuality()
|
|
||||||
{
|
|
||||||
UEnum* QualityEnum = StaticEnum<EQualityEnum>();
|
|
||||||
int32 EnumCount = QualityEnum->NumEnums() - 1;
|
|
||||||
CurrentQualityIndex = FMath::Clamp(CurrentQualityIndex + 1, 0, EnumCount - 1);
|
|
||||||
UpdateSelectQuality();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::UpdateSelectRobot()
|
|
||||||
{
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
|
||||||
{
|
|
||||||
GameInstance->CurrentSelectRobot = GetCurrentRobotData().Name;
|
|
||||||
}
|
|
||||||
BPUpdateSelectRobot();
|
|
||||||
InitLevelData();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::UpdateSelectLevel()
|
|
||||||
{
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
|
||||||
{
|
|
||||||
GameInstance->CurrentSelectLevel = GetCurrentLevelData().LevelEnum;
|
|
||||||
}
|
|
||||||
BPUpdateSelectLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UMainScreenUserWidget::UpdateSelectQuality()
|
|
||||||
{
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
|
||||||
{
|
|
||||||
GameInstance->CurrentSelectQuality = static_cast<EQualityEnum>(CurrentQualityIndex);
|
|
||||||
}
|
|
||||||
BPUpdateSelectQuality();
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
#include "Settings/SG_CaptureSetting.h"
|
#include "SG_CaptureSetting.h"
|
@ -1,14 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "UI/GameUserWidget.h"
|
|
||||||
#include "Core/LuckyRobotsGameInstance.h"
|
|
||||||
|
|
||||||
void UGameUserWidget::NativeConstruct()
|
|
||||||
{
|
|
||||||
Super::NativeConstruct();
|
|
||||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
|
||||||
{
|
|
||||||
GameInstance->GameUserWidget = this;
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,7 +16,7 @@ class LUCKYROBOTS_API UGameUserWidget : public UUserWidget
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
@ -24,23 +24,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
||||||
UDataTable* LevelDataTable;
|
UDataTable* LevelDataTable;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
|
||||||
UDataTable* FurnitureDataTable;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
|
||||||
UDataTable* DecorationDataTable;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
|
||||||
UDataTable* KitchenwareDataTable;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
|
||||||
UDataTable* ElectronicsDataTable;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
|
|
||||||
UDataTable* BathroomDataTable;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool bIsFirstOpenGame;
|
bool bIsFirstOpenGame;
|
||||||
|
|
||||||
bool bIsDebug;
|
bool bIsDebug;
|
||||||
bool bIsWidgetTestMode;
|
bool bIsWidgetTestMode;
|
||||||
bool bIsShowPath;
|
bool bIsShowPath;
|
||||||
@ -62,10 +48,10 @@ public:
|
|||||||
bool bIsMouseOpen;
|
bool bIsMouseOpen;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
|
||||||
bool bIsChanged;
|
bool bIschange;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
|
||||||
int32 FolderCount;
|
int FolderCount;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
|
||||||
FTransform TargetPosition;
|
FTransform TargetPosition;
|
||||||
@ -104,10 +90,10 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void DoSendMessage(const FString& SendValue);
|
void DoSendMessage(FString SendValue);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void DoLogItemAdd(const FString& Topic, const FString& MsgText, ELogItemType LogItemType);
|
void DoLogItemAdd(FString Topic, FString MsgText, ELogItemType LogItemType);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SwitchGamePaused();
|
void SwitchGamePaused();
|
||||||
@ -117,41 +103,41 @@ public:
|
|||||||
void ClearTaskList();
|
void ClearTaskList();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void AddTask(const FGoalsTaskData& TaskData);
|
void AddTask(FGoalsTaskData TaskData);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void RemoveTask(const FGoalsTaskData& TaskData);
|
void RemoveTask(FGoalsTaskData TaskData);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void RemoveTaskByGoalType(EGoalType GoalType);
|
void RemoveTaskByGoalType(EGoalType GoalType);
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
int32 GetTaskNum() const;
|
int GetTaskNum();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetTask(int32 Index, const FGoalsTaskData& TaskData);
|
void SetTask(int Index, FGoalsTaskData TaskData);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
bool GetTask(int32 Index, FGoalsTaskData& OutTaskData) const;
|
bool GetTask(int Index, FGoalsTaskData& TaskData);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void ReSetTaskList();
|
void ReSetTaskList();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
TArray<FGoalsTaskData> GetTaskList() const;
|
TArray<FGoalsTaskData> GetTaskList();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void DoSetTempTaskValueChange(bool bIsClear);
|
void DoSetTempTaskValueChange(bool IsClear);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentFolderName(const FString& FolderName);
|
void SetCurrentFolderName(FString FolderName);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentFileName(const FString& FileName);
|
void SetCurrentFileName(FString FileName);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentWritesPerSec(int32 WritesPerSec);
|
void SetCurrentWritesPerSec(int WritesPerSec);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentIsScenario(bool IsScenario);
|
void SetCurrentIsScenario(bool IsScenario);
|
||||||
@ -169,77 +155,77 @@ public:
|
|||||||
void SetCurrentIsRandomPets(bool bPets);
|
void SetCurrentIsRandomPets(bool bPets);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentPetsNumber(int32 PetsNumber);
|
void SetCurrentPetsNumber(int PetsNumber);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentIsRandomPeople(bool bPeople);
|
void SetCurrentIsRandomPeople(bool bPeople);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentPeopleNumber(int32 PeopleNumber);
|
void SetCurrentPeopleNumber(int PeopleNumber);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentIsRandomObjects(bool bObjects);
|
void SetCurrentIsRandomObjects(bool bObjects);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentObjectsNumber(int32 ObjectsNumber);
|
void SetCurrentObjectsNumber(int ObjectsNumber);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentRandomMeshes(const TArray<TSoftObjectPtr<UStaticMesh>>& RandomMeshes);
|
void SetCurrentRandomMeshes(TArray<TSoftObjectPtr<UStaticMeshComponent>> RandomMeshes);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentIsInfiniteCapture(bool bInfiniteCapture);
|
void SetCurrentIsInfiniteCapture(bool bInfiniteCapture);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetCurrentCaptureNumber(int32 CaptureNumber);
|
void SetCurrentCaptureNumber(int CaptureNumber);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
FString GetCurrentFolderName() const;
|
FString GetCurrentFolderName();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
FString GetCurrentFileName() const;
|
FString GetCurrentFileName();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
int32 GetCurrentWritesPerSec() const;
|
int GetCurrentWritesPerSec();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsScenario() const;
|
bool GetCurrentIsScenario();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsRandomLight() const;
|
bool GetCurrentIsRandomLight();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsRandomMaterials() const;
|
bool GetCurrentIsRandomMaterials();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsRandomRobotPosition() const;
|
bool GetCurrentIsRandomRobotPosition();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsRandomPets() const;
|
bool GetCurrentIsRandomPets();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
int32 GetCurrentPetsNumber() const;
|
int GetCurrentPetsNumber();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsRandomPeople() const;
|
bool GetCurrentIsRandomPeople();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
int32 GetCurrentPeopleNumber() const;
|
int GetCurrentPeopleNumber();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsRandomObjects() const;
|
bool GetCurrentIsRandomObjects();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
int32 GetCurrentObjectsNumber() const;
|
int GetCurrentObjectsNumber();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
TArray<TSoftObjectPtr<UStaticMesh>> GetCurrentRandomMeshes() const;
|
TArray<TSoftObjectPtr<UStaticMeshComponent>> GetCurrentRandomMeshes();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
bool GetCurrentIsInfiniteCapture() const;
|
bool GetCurrentIsInfiniteCapture();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
int32 GetCurrentCaptureNumber() const;
|
int GetCurrentCaptureNumber();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
@ -1,3 +1,5 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
@ -5,12 +7,16 @@
|
|||||||
#include "SharedDef.h"
|
#include "SharedDef.h"
|
||||||
#include "MainScreenUserWidget.generated.h"
|
#include "MainScreenUserWidget.generated.h"
|
||||||
|
|
||||||
|
class UDataTable;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class LUCKYROBOTS_API UMainScreenUserWidget : public UUserWidget
|
class LUCKYROBOTS_API UMainScreenUserWidget : public UUserWidget
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
protected:
|
protected:
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
@ -20,29 +26,24 @@ public:
|
|||||||
TArray<FLevelData> LevelDataList;
|
TArray<FLevelData> LevelDataList;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int32 CurrentRobotIndex;
|
int iCurrentSelectRobot;
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
int iCurrentSelectLevel;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int32 CurrentLevelIndex;
|
int iCurrentSelectQuality;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
int32 CurrentQualityIndex;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void InitData();
|
void InitData();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void InitRobotData();
|
void InitRobotData();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void InitLevelData();
|
void InitLevelData();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
FRobotData GetCurrentRobotData() const;
|
FRobotData GetCurrentRobotData();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
FLevelData GetCurrentLevelData() const;
|
FLevelData GetCurrentLevelData();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SelectNextRobot();
|
void SelectNextRobot();
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user