Merge pull request #3 from Srkmn/5.0

Fix GetDependencyClasses For Set and Map
5.0
crazytuzi 2 years ago committed by GitHub
commit 47adbbfb88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 48
      Private/SourceCodeGenerator.cpp

@ -343,22 +343,6 @@ bool FSourceCodeGeneratorModule::IsClassTypeSupported(const UClass* Class)
bool FSourceCodeGeneratorModule::IsPropertyTypeSupported(const FProperty* Property)
{
if (const auto ArrayProperty = CastField<FArrayProperty>(Property))
{
return IsPropertyTypeSupported(ArrayProperty->Inner);
}
if (const auto SetProperty = CastField<FSetProperty>(Property))
{
return IsPropertyTypeSupported(SetProperty->ElementProp);
}
if (const auto MapProperty = CastField<FMapProperty>(Property))
{
return IsPropertyTypeSupported(MapProperty->KeyProp) &&
IsPropertyTypeSupported(MapProperty->ValueProp);
}
if (const auto ObjectProperty = CastField<FObjectProperty>(Property))
{
if (!IsClassTypeSupported(ObjectProperty->PropertyClass))
@ -416,6 +400,22 @@ bool FSourceCodeGeneratorModule::IsPropertyTypeSupported(const FProperty* Proper
}
}
if (const auto ArrayProperty = CastField<FArrayProperty>(Property))
{
return IsPropertyTypeSupported(ArrayProperty->Inner);
}
if (const auto SetProperty = CastField<FSetProperty>(Property))
{
return IsPropertyTypeSupported(SetProperty->ElementProp);
}
if (const auto MapProperty = CastField<FMapProperty>(Property))
{
return IsPropertyTypeSupported(MapProperty->KeyProp) &&
IsPropertyTypeSupported(MapProperty->ValueProp);
}
auto bIsBitField = false;
if (const auto BoolProperty = CastField<FBoolProperty>(Property))
@ -851,6 +851,22 @@ void FSourceCodeGeneratorModule::GetDependencyClasses(const FProperty* Property,
GetDependencyClasses(ArrayProperty->Inner, DependencyClasses);
}
}
else if (const auto SetProperty = CastField<FSetProperty>(Property))
{
if (SetProperty->ElementProp != nullptr)
{
GetDependencyClasses(SetProperty->ElementProp, DependencyClasses);
}
}
else if (const auto MapProperty = CastField<FMapProperty>(Property))
{
if (MapProperty->KeyProp != nullptr && MapProperty->ValueProp != nullptr)
{
GetDependencyClasses(MapProperty->KeyProp, DependencyClasses);
GetDependencyClasses(MapProperty->ValueProp, DependencyClasses);
}
}
}
void FSourceCodeGeneratorModule::SaveIfChanged(const FString& FileName, const FString& String)

Loading…
Cancel
Save