Merge pull request #3 from Srkmn/5.0
Fix GetDependencyClasses For Set and Map
This commit is contained in:
1 file changed
+32
-16
@@ -343,22 +343,6 @@ bool FSourceCodeGeneratorModule::IsClassTypeSupported(const UClass* Class)
|
|||||||
|
|
||||||
bool FSourceCodeGeneratorModule::IsPropertyTypeSupported(const FProperty* Property)
|
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 (const auto ObjectProperty = CastField<FObjectProperty>(Property))
|
||||||
{
|
{
|
||||||
if (!IsClassTypeSupported(ObjectProperty->PropertyClass))
|
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;
|
auto bIsBitField = false;
|
||||||
|
|
||||||
if (const auto BoolProperty = CastField<FBoolProperty>(Property))
|
if (const auto BoolProperty = CastField<FBoolProperty>(Property))
|
||||||
@@ -851,6 +851,22 @@ void FSourceCodeGeneratorModule::GetDependencyClasses(const FProperty* Property,
|
|||||||
GetDependencyClasses(ArrayProperty->Inner, DependencyClasses);
|
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)
|
void FSourceCodeGeneratorModule::SaveIfChanged(const FString& FileName, const FString& String)
|
||||||
|
|||||||
Reference in new issue
Block a user