Optimizing WB_MainScreen

This commit is contained in:
martinluckyrobots
2025-04-10 00:12:27 +08:00
parent 17dc39a612
commit 28c87e6f85
5 changed files with 26 additions and 8 deletions

View File

@ -10,6 +10,14 @@ void UMainScreenUserWidget::NativeConstruct()
{
Super::NativeConstruct();
InitData();
BPSendReadyJson();
BPGetdataHTTP();
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
{
GameInstance->bIsFirstOpenGame = false;
GameInstance->DoResolutionChange(bIsFullScreen);
}
}
void UMainScreenUserWidget::InitData()

View File

@ -28,6 +28,12 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 CurrentQualityIndex;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bIsFullScreen = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSoftObjectPtr<UWorld> CurrentSelectLevelObject;
public:
UFUNCTION(BlueprintCallable)
void InitData();
@ -73,4 +79,8 @@ public:
void BPUpdateSelectLevel();
UFUNCTION(BlueprintImplementableEvent)
void BPUpdateSelectQuality();
UFUNCTION(BlueprintImplementableEvent)
void BPSendReadyJson();
UFUNCTION(BlueprintImplementableEvent)
void BPGetdataHTTP();
};