From ca92cee10ee19f004ca140709be64d5f76098a07 Mon Sep 17 00:00:00 2001 From: yawn831831 Date: Wed, 18 Jun 2025 22:41:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Eblacklist=E5=92=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8A=A5=E9=94=99=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SourceCodeGenerator.cs | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) 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);