Merge pull request 'martin' (#7) from martin into main

Reviewed-on: #7
This commit is contained in:
martinluckyrobots 2025-03-30 04:28:58 +00:00
commit 73fb958f07
12 changed files with 26 additions and 26 deletions

View File

@ -1,5 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "LuckyrobotsGameInstance.h"
#include "LuckyRobotsGameInstance.h"

View File

@ -1,5 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "LuckyrobotsGameMode.h"
#include "LuckyRobotsGameMode.h"

View File

@ -1,5 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "LuckyrobotsGameState.h"
#include "LuckyRobotsGameState.h"

View File

@ -1,5 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "LuckyrobotsPlayerController.h"
#include "LuckyRobotsPlayerController.h"

View File

@ -3,7 +3,7 @@
#include "MainScreenUserWidget.h"
#include "Engine/DataTable.h"
#include "LuckyrobotsGameInstance.h"
#include "LuckyRobotsGameInstance.h"
void UMainScreenUserWidget::NativeConstruct()
{
@ -17,13 +17,13 @@ void UMainScreenUserWidget::InitData()
InitRobotData();
InitLevelData();
ULuckyrobotsGameInstance* LuckyrobotsGameInstance = Cast<ULuckyrobotsGameInstance>(GetGameInstance());
if (LuckyrobotsGameInstance)
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
if (LuckyRobotsGameInstance)
{
UEnum* QualityEnum = StaticEnum<EQualityEnum>();
for (int32 i = 0; i < QualityEnum->NumEnums() - 1; i++)
{
if (EQualityEnum(QualityEnum->GetValueByIndex(i)) == LuckyrobotsGameInstance->CurrentSelectQuality)
if (EQualityEnum(QualityEnum->GetValueByIndex(i)) == LuckyRobotsGameInstance->CurrentSelectQuality)
{
iCurrentSelectRobot = i;
break;
@ -174,31 +174,31 @@ void UMainScreenUserWidget::SelectPreviousQuality()
void UMainScreenUserWidget::UpdateSelectRobot()
{
ULuckyrobotsGameInstance* LuckyrobotsGameInstance = Cast<ULuckyrobotsGameInstance>(GetGameInstance());
if (LuckyrobotsGameInstance)
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
if (LuckyRobotsGameInstance)
{
LuckyrobotsGameInstance->CurrentSelectRobot = GetCurrentRobotData().Name;
LuckyRobotsGameInstance->CurrentSelectRobot = GetCurrentRobotData().Name;
}
BPUpdateSelectRobot();
InitLevelData();
}
void UMainScreenUserWidget::UpdateSelectLevel()
{
ULuckyrobotsGameInstance* LuckyrobotsGameInstance = Cast<ULuckyrobotsGameInstance>(GetGameInstance());
if (LuckyrobotsGameInstance)
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
if (LuckyRobotsGameInstance)
{
LuckyrobotsGameInstance->CurrentSelectLevel = GetCurrentLevelData().LevelEnum;
LuckyRobotsGameInstance->CurrentSelectLevel = GetCurrentLevelData().LevelEnum;
}
BPUpdateSelectLevel();
}
void UMainScreenUserWidget::UpdateSelectQuality()
{
ULuckyrobotsGameInstance* LuckyrobotsGameInstance = Cast<ULuckyrobotsGameInstance>(GetGameInstance());
if (LuckyrobotsGameInstance)
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance());
if (LuckyRobotsGameInstance)
{
UEnum* QualityEnum = StaticEnum<EQualityEnum>();
LuckyrobotsGameInstance->CurrentSelectQuality = EQualityEnum(QualityEnum->GetValueByIndex(iCurrentSelectQuality));
LuckyRobotsGameInstance->CurrentSelectQuality = EQualityEnum(QualityEnum->GetValueByIndex(iCurrentSelectQuality));
}
BPUpdateSelectQuality();
}

View File

@ -5,13 +5,13 @@
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "SharedDef.h"
#include "LuckyrobotsGameInstance.generated.h"
#include "LuckyRobotsGameInstance.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ULuckyrobotsGameInstance : public UGameInstance
class LUCKYROBOTS_API ULuckyRobotsGameInstance : public UGameInstance
{
GENERATED_BODY()

View File

@ -4,13 +4,13 @@
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "LuckyrobotsGameMode.generated.h"
#include "LuckyRobotsGameMode.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALuckyrobotsGameMode : public AGameModeBase
class LUCKYROBOTS_API ALuckyRobotsGameMode : public AGameModeBase
{
GENERATED_BODY()

View File

@ -4,13 +4,13 @@
#include "CoreMinimal.h"
#include "GameFramework/GameStateBase.h"
#include "LuckyrobotsGameState.generated.h"
#include "LuckyRobotsGameState.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALuckyrobotsGameState : public AGameStateBase
class LUCKYROBOTS_API ALuckyRobotsGameState : public AGameStateBase
{
GENERATED_BODY()

View File

@ -4,13 +4,13 @@
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "LuckyrobotsPlayerController.generated.h"
#include "LuckyRobotsPlayerController.generated.h"
/**
*
*/
UCLASS()
class LUCKYROBOTS_API ALuckyrobotsPlayerController : public APlayerController
class LUCKYROBOTS_API ALuckyRobotsPlayerController : public APlayerController
{
GENERATED_BODY()

View File

@ -113,7 +113,7 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString LevelName;
TSoftObjectPtr<UWorld> LevelObject;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UTexture2D* LevelImage;