LoadingScreenManager no longer crashes when removing a non-existent loading screen.
This commit is contained in:
parent
621ef632bf
commit
9b0016a548
@ -128,9 +128,6 @@ public:
|
||||
|
||||
void ULoadingScreenManager::Initialize(FSubsystemCollectionBase &Collection)
|
||||
{
|
||||
//FCoreUObjectDelegates::PreLoadMapWithContext.AddUObject(this, &ThisClass::HandlePreLoadMap);
|
||||
//FCoreUObjectDelegates::PostLoadMapWithWorld.AddUObject(this, &ThisClass::HandlePostLoadMap);
|
||||
|
||||
const UGameInstance *LocalGameInstance = this->GetGameInstance();
|
||||
check(LocalGameInstance);
|
||||
}
|
||||
@ -139,9 +136,6 @@ void ULoadingScreenManager::Deinitialize()
|
||||
{
|
||||
this->StopBlockingInput();
|
||||
this->RemoveWidgetFromViewport();
|
||||
|
||||
//FCoreUObjectDelegates::PreLoadMap.RemoveAll(this);
|
||||
//FCoreUObjectDelegates::PostLoadMapWithWorld.RemoveAll(this);
|
||||
}
|
||||
|
||||
bool ULoadingScreenManager::ShouldCreateSubsystem(UObject *Outer) const
|
||||
@ -185,7 +179,6 @@ class ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen()
|
||||
if (this->LoadingScreenUMGWidget = CreateWidget<ULoadingScreenWidget>(LocalGameInstance, LoadingScreenWidgetClass, NAME_None))
|
||||
{
|
||||
this->LoadingScreenWidget = this->LoadingScreenUMGWidget->TakeWidget();
|
||||
this->LoadingScreenUMGWidget->OnLoadScreenClosed.BindUObject(this, &ULoadingScreenManager::RemoveLoadingScreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -210,8 +203,13 @@ class ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen()
|
||||
|
||||
void ULoadingScreenManager::HideLoadingScreen()
|
||||
{
|
||||
if (this->bCurrentlyShowingLoadingScreen)
|
||||
{
|
||||
this->ChangePerformanceSettings(/*bEnableLoadingScreen=*/ false);
|
||||
|
||||
this->LoadingScreenUMGWidget->OnLoadScreenClosed.BindUObject(this, &ULoadingScreenManager::RemoveLoadingScreen);
|
||||
this->LoadingScreenUMGWidget->BeginFadeOut();
|
||||
}
|
||||
}
|
||||
|
||||
void ULoadingScreenManager::RemoveLoadingScreen()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user