From 703e650e40be1d5140f2ed595a137e086d3aa7b7 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Mon, 4 Aug 2025 23:35:06 -0500 Subject: [PATCH] Add required properties --- libs/UIX.DecompXml/Decompiler.cs | 12 +++++++ test/ManagementDisplay_decomp.uix | 52 +++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 test/ManagementDisplay_decomp.uix diff --git a/libs/UIX.DecompXml/Decompiler.cs b/libs/UIX.DecompXml/Decompiler.cs index 3659f3b..1ac7f99 100644 --- a/libs/UIX.DecompXml/Decompiler.cs +++ b/libs/UIX.DecompXml/Decompiler.cs @@ -59,6 +59,18 @@ public partial class Decompiler xExport.SetAttributeValue("Shared", true); } + // TODO: Combine this with InitializePropertiesOffset + if (export.Properties is { Length: > 0 }) + { + XElement xProperties = GetOrCreateElement(xExport, _nsUix + "Properties"); + + foreach (var property in export.Properties.Where(p => p.RequiredForCreation)) + { + IrisObject value = new("$Required", property.PropertyType); + PropertyDictionaryAddOnXElement(xProperties, value, property.Name); + } + } + if (export.InitializePropertiesOffset is not uint.MaxValue) AnalyzeMethodForInit(export.InitializePropertiesOffset, xExport, export, name + "_prop"); diff --git a/test/ManagementDisplay_decomp.uix b/test/ManagementDisplay_decomp.uix new file mode 100644 index 0000000..9e3b4ed --- /dev/null +++ b/test/ManagementDisplay_decomp.uix @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file