From 7d822f87cea5310125119365857b8ba091f5d1e6 Mon Sep 17 00:00:00 2001 From: Trevor Date: Tue, 21 Jul 2026 22:20:01 -0400 Subject: [PATCH] Support overriding EnumUnderlyingType --- Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs b/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs index a3173e81..f526d4d4 100644 --- a/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs +++ b/Cpp2IL.Core/Model/Contexts/TypeAnalysisContext.cs @@ -89,7 +89,15 @@ public TypeAnalysisContext? BaseType public TypeAnalysisContext? DeclaringType { get; protected internal set; } - public TypeAnalysisContext? EnumUnderlyingType => Definition == null ? null : AppContext.ResolveIl2CppType(Definition.EnumUnderlyingType); + public TypeAnalysisContext? OverrideEnumUnderlyingType { get; set; } + + public TypeAnalysisContext? EnumUnderlyingType + { + get => OverrideEnumUnderlyingType ?? DefaultEnumUnderlyingType; + set => OverrideEnumUnderlyingType = value; + } + + public TypeAnalysisContext? DefaultEnumUnderlyingType => Definition == null ? null : AppContext.ResolveIl2CppType(Definition.EnumUnderlyingType); private List? _interfaceContexts; public List InterfaceContexts