diff --git a/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp b/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp index 1f42fb7..0bc508c 100644 --- a/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp +++ b/Source/CommonLoadingScreen/Private/LoadingScreenManager.cpp @@ -171,15 +171,16 @@ class ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen() CSV_EVENT(LoadingScreen, TEXT("Show")); - const UCommonLoadingScreenSettings *Settings = GetDefault(); - UGameInstance *LocalGameInstance = this->GetGameInstance(); - // Eat input while the loading screen is displayed this->StartBlockingInput(); this->LoadingScreenVisibilityChanged.Broadcast(/*bIsVisible=*/ true); // Create the loading screen widget + + const UCommonLoadingScreenSettings *Settings = GetDefault(); + UGameInstance *LocalGameInstance = this->GetGameInstance(); + TSubclassOf LoadingScreenWidgetClass = Settings->LoadingScreenWidget.LoadSynchronous(); if (this->LoadingScreenUMGWidget = CreateWidget(LocalGameInstance, LoadingScreenWidgetClass, NAME_None)) { @@ -209,6 +210,7 @@ class ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen() void ULoadingScreenManager::HideLoadingScreen() { + this->ChangePerformanceSettings(/*bEnableLoadingScreen=*/ false); this->LoadingScreenUMGWidget->BeginFadeOut(); } @@ -221,7 +223,6 @@ void ULoadingScreenManager::RemoveLoadingScreen() this->StopBlockingInput(); this->RemoveWidgetFromViewport(); - this->ChangePerformanceSettings(/*bEnableLoadingScreen=*/ false); this->LoadingScreenUMGWidget->OnLoadScreenOpened.Unbind(); this->LoadingScreenUMGWidget->OnLoadScreenClosed.Unbind();