Luckyrobots->LuckyRobots

This commit is contained in:
martinluckyrobots
2025-03-30 11:46:50 +08:00
parent 18f930099d
commit c9b279e906
15 changed files with 583 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "LobbyGameMode.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALobbyGameMode : public AGameModeBase
{
GENERATED_BODY()
};

View File

@ -0,0 +1,24 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "LobbyPlayerController.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALobbyPlayerController : public APlayerController
{
GENERATED_BODY()
protected:
virtual void BeginPlay() override;
virtual void SetupInputComponent() override;
public:
void Init();
};

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "SharedDef.h"
#include "LuckyRobotsGameInstance.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ULuckyRobotsGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ERobotsName CurrentSelectRobot;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ELevelEnum CurrentSelectLevel;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EQualityEnum CurrentSelectQuality;
};

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "LuckyRobotsGameMode.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALuckyRobotsGameMode : public AGameModeBase
{
GENERATED_BODY()
};

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameStateBase.h"
#include "LuckyRobotsGameState.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALuckyRobotsGameState : public AGameStateBase
{
GENERATED_BODY()
};

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "LuckyRobotsPlayerController.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALuckyRobotsPlayerController : public APlayerController
{
GENERATED_BODY()
};

View File

@ -0,0 +1,84 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "SharedDef.h"
#include "MainScreenUserWidget.generated.h"
class UDataTable;
/**
*
*/
UCLASS()
class LUCKYROBOTS_API UMainScreenUserWidget : public UUserWidget
{
GENERATED_BODY()
protected:
virtual void NativeConstruct();
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
UDataTable* RobotDataDataTable;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
UDataTable* LevelDataTable;
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<FRobotData> RobotDataList;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<FLevelData> LevelDataList;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int iCurrentSelectRobot;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int iCurrentSelectLevel;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int iCurrentSelectQuality;
public:
UFUNCTION(BlueprintCallable)
void InitData();
UFUNCTION(BlueprintCallable)
void InitRobotData();
UFUNCTION(BlueprintCallable)
void InitLevelData();
UFUNCTION(BlueprintCallable)
FRobotData GetCurrentRobotData();
UFUNCTION(BlueprintCallable)
FLevelData GetCurrentLevelData();
UFUNCTION(BlueprintCallable)
void SelectNextRobot();
UFUNCTION(BlueprintCallable)
void SelectPreviousRobot();
UFUNCTION(BlueprintCallable)
void SelectNextLevel();
UFUNCTION(BlueprintCallable)
void SelectPreviousLevel();
UFUNCTION(BlueprintCallable)
void SelectNextQuality();
UFUNCTION(BlueprintCallable)
void SelectPreviousQuality();
void UpdateSelectRobot();
void UpdateSelectLevel();
void UpdateSelectQuality();
public:
UFUNCTION(BlueprintImplementableEvent)
void BPUpdateSelectRobot();
UFUNCTION(BlueprintImplementableEvent)
void BPUpdateSelectLevel();
UFUNCTION(BlueprintImplementableEvent)
void BPUpdateSelectQuality();
};

View File

@ -0,0 +1,126 @@
#pragma once
#include "SharedDef.generated.h"
UENUM(BlueprintType)
enum class ERobotsCategories : uint8
{
Wheeled UMETA(DisplayName = "Wheeled Robots"),
FourLegged UMETA(DisplayName = "Four-Legged Robots"),
TwoLegged UMETA(DisplayName = "Two-Legged Robots"),
Stationary UMETA(DisplayName = "Stationary Robots"),
IndoorFlying UMETA(DisplayName = "Indoor Flying Robots"),
SwimmingUnderwater UMETA(DisplayName = "Swimming/Underwater Robots"),
CrawlingModular UMETA(DisplayName = "Crawling/Modular Robots"),
Arm UMETA(DisplayName = "Arm-Robots"),
OutdoorFlying UMETA(DisplayName = "Outdoor Flying Robots")
};
UENUM(BlueprintType)
enum class ERobotsName : uint8
{
None UMETA(DisplayName = "None"),
Luck_e UMETA(DisplayName = "Luck-e"),
Stretch UMETA(DisplayName = "Stretch"),
LuckyDrone UMETA(DisplayName = "Lucky Drone"),
DJIDrone UMETA(DisplayName = "DJI Drone"),
ArmLucky UMETA(DisplayName = "Arm Lucky"),
UnitreeG1 UMETA(DisplayName = "Unitree G1"),
StretchRobotV1 UMETA(DisplayName = "Stretch Robot V1"),
PandaArmRobot UMETA(DisplayName = "Panda Arm Robot"),
PuralinkRobot UMETA(DisplayName = "Puralink Robot"),
UnitreeGo2 UMETA(DisplayName = "Unitree Go 2"),
RevoluteRobot UMETA(DisplayName = "Revolute Robot"),
BostonSpotRobot UMETA(DisplayName = "Boston Spot Robot")
};
UENUM(BlueprintType)
enum class ELevelType : uint8
{
Home UMETA(DisplayName = "Home"),
Office UMETA(DisplayName = "Office"),
Street UMETA(DisplayName = "Street"),
TestLevel UMETA(DisplayName = "TestLevel")
};
UENUM(BlueprintType)
enum class ELevelEnum : uint8
{
None UMETA(DisplayName = "None"),
TestLevel UMETA(DisplayName = "Test Level"),
Loft UMETA(DisplayName = "Loft"),
Rome UMETA(DisplayName = "Rome"),
Paris UMETA(DisplayName = "Paris"),
Marseille UMETA(DisplayName = "Marseille"),
Istanbul UMETA(DisplayName = "Istanbul"),
Office UMETA(DisplayName = "Office"),
BasicForest UMETA(DisplayName = "Basic Forest"),
NaturalForest UMETA(DisplayName = "Natural Forest"),
KitchenForArmRobot UMETA(DisplayName = "Kitchen for Arm Robot"),
PipeFabric UMETA(DisplayName = "Pipe Fabric")
};
UENUM(BlueprintType)
enum class EQualityEnum : uint8
{
Epic UMETA(DisplayName = "Epic"),
High UMETA(DisplayName = "High"),
Middle UMETA(DisplayName = "Middle"),
Low UMETA(DisplayName = "Low")
};
USTRUCT(BlueprintType)
struct FRobotData : public FTableRowBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ERobotsName Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<AActor> RobotClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FTransform Transform;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bActive;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UTexture2D* RobotImage;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ERobotsCategories RobotType;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText HelpText;
};
USTRUCT(BlueprintType)
struct FLevelData : public FTableRowBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int ID;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ELevelEnum LevelEnum;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ELevelType LevelType;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString LevelName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UTexture2D* LevelImage;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bActive;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<ERobotsCategories> RobotTypeList;
};