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

@ -73,11 +73,11 @@ public:
/** Generate a delegates for callback events */
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnRequestComplete, class USIOJRequestJSON*, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnRequestFail, class USIOJRequestJSON*, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSIOJOnRequestComplete, class USIOJRequestJSON*, Request);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSIOJOnRequestFail, class USIOJRequestJSON*, Request);
DECLARE_MULTICAST_DELEGATE_OneParam(FOnStaticRequestComplete, class USIOJRequestJSON*);
DECLARE_MULTICAST_DELEGATE_OneParam(FOnStaticRequestFail, class USIOJRequestJSON*);
DECLARE_MULTICAST_DELEGATE_OneParam(FSIOJOnStaticRequestComplete, class USIOJRequestJSON*);
DECLARE_MULTICAST_DELEGATE_OneParam(FSIOJOnStaticRequestFail, class USIOJRequestJSON*);
/**
@ -216,17 +216,17 @@ private:
public:
/** Event occured when the request has been completed */
UPROPERTY(BlueprintAssignable, Category = "SIOJ|Event")
FOnRequestComplete OnRequestComplete;
FSIOJOnRequestComplete OnRequestComplete;
/** Event occured when the request wasn't successfull */
UPROPERTY(BlueprintAssignable, Category = "SIOJ|Event")
FOnRequestFail OnRequestFail;
FSIOJOnRequestFail OnRequestFail;
/** Event occured when the request has been completed */
FOnStaticRequestComplete OnStaticRequestComplete;
FSIOJOnStaticRequestComplete OnStaticRequestComplete;
/** Event occured when the request wasn't successfull */
FOnStaticRequestFail OnStaticRequestFail;
FSIOJOnStaticRequestFail OnStaticRequestFail;
//////////////////////////////////////////////////////////////////////////

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();
};