Apparently this code just never got pushed to the repository whenever I wrote it, and I don't really remember what it's supposed to do differently from before.
This commit is contained in:
parent
f63f25c51c
commit
75ae7a10d6
@ -146,7 +146,7 @@ bool ULoadingScreenManager::ShouldCreateSubsystem(UObject *Outer) const
|
|||||||
return !bIsServerWorld;
|
return !bIsServerWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen()
|
ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen()
|
||||||
{
|
{
|
||||||
if (this->bCurrentlyShowingLoadingScreen)
|
if (this->bCurrentlyShowingLoadingScreen)
|
||||||
{
|
{
|
||||||
@ -202,6 +202,22 @@ class ULoadingScreenWidget *ULoadingScreenManager::ShowLoadingScreen()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ULoadingScreenManager::HideLoadingScreen()
|
void ULoadingScreenManager::HideLoadingScreen()
|
||||||
|
{
|
||||||
|
const float HoldTime = GetDefault<UCommonLoadingScreenSettings>()->HoldLoadingScreenAdditionalSecs;
|
||||||
|
if (FMath::IsNearlyZero(HoldTime))
|
||||||
|
{
|
||||||
|
this->HideLoadingScreen_Private();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->GetWorld()->GetTimerManager().SetTimer(
|
||||||
|
this->HideLoadingScreenTimerHandle,
|
||||||
|
this, &ULoadingScreenManager::HideLoadingScreen_Private,
|
||||||
|
HoldTime
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void ULoadingScreenManager::HideLoadingScreen_Private()
|
||||||
{
|
{
|
||||||
if (this->bCurrentlyShowingLoadingScreen)
|
if (this->bCurrentlyShowingLoadingScreen)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,6 +46,9 @@ public:
|
|||||||
FORCEINLINE FOnLoadingScreenVisibilityChangedDelegate &OnLoadingScreenVisibilityChangedDelegate() { return LoadingScreenVisibilityChanged; }
|
FORCEINLINE FOnLoadingScreenVisibilityChangedDelegate &OnLoadingScreenVisibilityChangedDelegate() { return LoadingScreenVisibilityChanged; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/** Actually hides the loading screen, either immediately or after a delay if necessary. */
|
||||||
|
void HideLoadingScreen_Private();
|
||||||
|
|
||||||
/** Removes the loading screen. The loading screen widget will be destroyed. */
|
/** Removes the loading screen. The loading screen widget will be destroyed. */
|
||||||
void RemoveLoadingScreen();
|
void RemoveLoadingScreen();
|
||||||
|
|
||||||
@ -90,4 +93,7 @@ private:
|
|||||||
|
|
||||||
/** True when the loading screen is currently being shown */
|
/** True when the loading screen is currently being shown */
|
||||||
bool bCurrentlyShowingLoadingScreen = false;
|
bool bCurrentlyShowingLoadingScreen = false;
|
||||||
|
|
||||||
|
/** Handle for the timer that controls how much extra time to wait before fading the loading screen away */
|
||||||
|
FTimerHandle HideLoadingScreenTimerHandle;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user