diff --git a/SourceCodeGenerator.cs b/SourceCodeGenerator.cs index b9774f1..bdd60d5 100644 --- a/SourceCodeGenerator.cs +++ b/SourceCodeGenerator.cs @@ -62,6 +62,8 @@ namespace SourceCodeGeneratorUbtPlugin private const string HeaderSuffix = ".header.inl"; + private readonly HashSet ClassNameBlacklist = new(); + public SourceCodeGenerator(IUhtExportFactory factory) { Factory = factory; @@ -119,6 +121,18 @@ namespace SourceCodeGeneratorUbtPlugin ExportModule.Add(value); } } + + if (SettingConfigHierarchySection.TryGetValues("ClassBlacklist", out var blacklistValues)) + { + foreach (var className in blacklistValues) + { + if (!string.IsNullOrEmpty(className)) + { + ClassNameBlacklist.Add(className); + Console.WriteLine($"[BlackList] {className} will be skipped."); + } + } + } } } @@ -179,6 +193,11 @@ namespace SourceCodeGeneratorUbtPlugin /// True if the class should be exported, false if not protected virtual bool CanExportClass(UhtClass classObj) { + if (ClassNameBlacklist.Contains(classObj.SourceName)) + { + return false; + } + return !classObj.ClassFlags.HasAnyFlags(EClassFlags.Interface) && IsClassTypeSupported(classObj); } @@ -275,14 +294,6 @@ namespace SourceCodeGeneratorUbtPlugin } } - if (property is UhtObjectPtrProperty objectPtrProperty) - { - if (!IsClassTypeSupported(objectPtrProperty.Class)) - { - return false; - } - } - if (property is UhtInterfaceProperty interfaceProperty) { if (interfaceProperty.InterfaceClass == interfaceProperty.Session.IInterface) @@ -463,10 +474,6 @@ namespace SourceCodeGeneratorUbtPlugin DependencyClasses.Add(classProperty.MetaClass); } } - else if (property is UhtObjectPtrProperty objectPtrProperty) - { - DependencyClasses.Add(objectPtrProperty.Class); - } else if (property is UhtObjectProperty objectProperty) { DependencyClasses.Add(objectProperty.Class);