From 8c3629c7b5d316d8a413ce76b85d2781de11f340 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Thu, 14 Aug 2025 02:08:16 -0500 Subject: [PATCH] Support immediate dictionary adds --- libs/UIX.DecompXml/Decompiler.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/UIX.DecompXml/Decompiler.cs b/libs/UIX.DecompXml/Decompiler.cs index 1ac7f99..744705c 100644 --- a/libs/UIX.DecompXml/Decompiler.cs +++ b/libs/UIX.DecompXml/Decompiler.cs @@ -216,8 +216,6 @@ public partial class Decompiler break; case OpCode.PropertyDictionaryAdd: - var targetDictProperty = _context.GetImportedProperty(instruction.Operands.ElementAt(0)); - var keyReference = instruction.Operands.ElementAt(1); var key = _context.GetConstant(keyReference).Value.ToString(); @@ -226,9 +224,14 @@ public partial class Decompiler .FirstOrDefault(s => s.Name == key)? .Type; - var targetInstance = (XElement)stack.Peek(); + var targetInstance = (XElement)ToXmlFriendlyObject(stack.Peek()); + var dictValueObj = IrisObject.Create(dictValue, dictValueType, _context); - PropertyDictionaryAddOnXElement(targetInstance, targetDictProperty, IrisObject.Create(dictValue, dictValueType, _context), key); + var targetDictPropertyIndex = (ushort)instruction.Operands.ElementAt(0).Value; + if (targetDictPropertyIndex is ushort.MaxValue) + PropertyDictionaryAddOnXElement(targetInstance, dictValueObj, key); + else + PropertyDictionaryAddOnXElement(targetInstance, _context.ImportTables.PropertyImports[targetDictPropertyIndex], dictValueObj, key); break; case OpCode.PropertyListAdd: