I’ve got a fix, but it’s ugly and needs a source build of Unreal and some C++ skills.
If you are as desperate as I was here are the steps to follow.
- Create a custom delegate, do it the way you prefer
- Change these bindings to be bound to your delegate (only if not with editor)
Engine\Source\Runtime\UniversalObjectLocator\Private\UniversalObjectLocatorModule.cpp [27]
#if WITH_EDITOR
FDelayedAutoRegisterHelper(EDelayedRegisterRunPhase::ObjectSystemReady
#else
//Your delegate
#endif
Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp [321]
#if WITH_EDITOR
FDelayedAutoRegisterHelper(EDelayedRegisterRunPhase::RequestFragmentTypes,
#else
//Your delegate
#endif
- In
UniversalObjectLocatorFragment.cppexecute your delegate the first time the functionbool FUniversalObjectLocatorFragment::Serialize(FArchive& Ar)is called. Personnally I have put a simplebool bHasRequestedFragmentTypesRegistering
It should look like
if (FragmentTypeID == NAME_None)
{
Reset();
}
else
{
// ==== CHANGE ====
if(!bHasRequestedFragmentTypesRegistering)
{
// Broadcast your delegate
bHasRequestedFragmentTypesRegistering = true;
}
// ==== END CHANGE ====
// Find the FragmentType
const FFragmentType* SerializedFragmentType = FRegistry::Get().FindFragmentType(FragmentTypeID);
Compile, run and enjoy!
I hope Unreal comes with a better fix.