I created the OnDisplayLoginWidget like Josh’s example:
void AMyPlayerController::OnDisplayLoginWidget(const TSharedRef& DisplayWidget)
ILoginFlowManager::FOnDisplayPopup::CreateUObject(this, &AMyPlayerController::OnDisplayLoginWidget)
That code will try to create a new ILoginFlowManager::FOnDisplayPopup
delegate, and assign it to the AMyPlayerController::ONDisplayLoginWidget
, for the instance this
.
The problem here is that the signature is wrong so it can’t. This is wrong in the sample code provided as well.
If you take a look, ILoginFLowManager::FOnDisplayPopup
is declared as following:
DECLARE_DELEGATE_RetVal_OneParam(FOnPopupDismissed, FOnDisplayPopup, const TSharedRef& /*LoginWidget*/);
So, it needs to return an ILoginFlowManager::FOnPopupdDismissed
and takes in a const TSharedRef&
as an argument.
If you actually take a look at the error you received, it calls this out:
Error (active) E0304 no instance of overloaded function “TBaseDelegate ::CreateUObject [with WrappedRetValType=ILoginFlowManager::FOnPopupDismissed, ParamTypes= &>]” matches the argument list Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 77
Notice, it provides you with the correct signature
TBaseDelegate ::CreateUObject [with WrappedRetValType=ILoginFlowManager::FOnPopupDismissed, ParamTypes= &>]"
Then calls out where you were trying to improperly create it:
f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 77
Again, I wouldn’t take the sample code above as anything but pseudo code. You’ll need to take a look at these errors and the actual implementations of things to come up with actual usable code.
Thanks,
Jon N.