Open and close delegates changed to multicast delegates, since we need to use these in multiple places now.

This commit is contained in:
Jamie Greunbaum 2023-05-30 01:02:05 -04:00
parent ad35203527
commit af66792d04
2 changed files with 3 additions and 7 deletions

View File

@ -14,9 +14,7 @@ void ULoadingScreenWidget::NativePreConstruct()
void ULoadingScreenWidget::LoadScreenOpened() void ULoadingScreenWidget::LoadScreenOpened()
{ {
this->UnbindAllFromAnimationFinished(this->Fade); this->UnbindAllFromAnimationFinished(this->Fade);
#if !WITH_EDITOR this->OnLoadScreenOpened.Broadcast();
this->OnLoadScreenOpened.ExecuteIfBound();
#endif
} }
void ULoadingScreenWidget::BeginFadeOut_Implementation() void ULoadingScreenWidget::BeginFadeOut_Implementation()
@ -30,7 +28,5 @@ void ULoadingScreenWidget::BeginFadeOut_Implementation()
void ULoadingScreenWidget::LoadScreenClosed() void ULoadingScreenWidget::LoadScreenClosed()
{ {
this->UnbindAllFromAnimationFinished(this->Fade); this->UnbindAllFromAnimationFinished(this->Fade);
#if !WITH_EDITOR this->OnLoadScreenClosed.Broadcast();
this->OnLoadScreenClosed.ExecuteIfBound();
#endif
} }

View File

@ -28,7 +28,7 @@ public:
UFUNCTION(BlueprintNativeEvent) UFUNCTION(BlueprintNativeEvent)
void BeginFadeOut(); void BeginFadeOut();
DECLARE_DELEGATE(FOnLoadScreenEvent) DECLARE_MULTICAST_DELEGATE(FOnLoadScreenEvent)
FOnLoadScreenEvent OnLoadScreenOpened; FOnLoadScreenEvent OnLoadScreenOpened;
FOnLoadScreenEvent OnLoadScreenClosed; FOnLoadScreenEvent OnLoadScreenClosed;