From 7dceface923b7a8b8e2843a1c93acad21c2811fb Mon Sep 17 00:00:00 2001 From: Eliot Date: Wed, 4 Sep 2024 15:34:14 +0200 Subject: [PATCH] Address https://github.com/UE-Explorer/UE-Explorer/issues/64 --- src/Core/Classes/UEnumDecompiler.cs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Core/Classes/UEnumDecompiler.cs b/src/Core/Classes/UEnumDecompiler.cs index d9ed305..98ab54a 100644 --- a/src/Core/Classes/UEnumDecompiler.cs +++ b/src/Core/Classes/UEnumDecompiler.cs @@ -27,21 +27,32 @@ public override string FormatHeader() private string FormatNames() { - var output = string.Empty; + string output = string.Empty; UDecompilingState.AddTabs(1); - for (var index = 0; index < Names.Count; index++) + + for (int index = 0; index < Names.Count; index++) { - var enumName = Names[index]; - output += "\r\n" + UDecompilingState.Tabs + enumName; + var enumTagName = Names[index]; + string enumTagText = enumTagName.ToString(); + if (index != Names.Count - 1) { - output += ","; + enumTagText += ","; } + + if (!UnrealConfig.SuppressComments) + { + enumTagText = enumTagText.PadRight(32, ' '); + enumTagText += $"// {index}"; + } + + output += "\r\n" + UDecompilingState.Tabs + enumTagText; } UDecompilingState.RemoveTabs(1); + return output; } } } -#endif \ No newline at end of file +#endif