diff --git a/RobloxFileFormat.dll b/RobloxFileFormat.dll index 286d046..a3033d8 100644 Binary files a/RobloxFileFormat.dll and b/RobloxFileFormat.dll differ diff --git a/Tree/Instance.cs b/Tree/Instance.cs index 4cc0799..899d2d0 100644 --- a/Tree/Instance.cs +++ b/Tree/Instance.cs @@ -91,13 +91,12 @@ namespace RobloxFiles { get { - string fullString = string.Join("\0", Tags.ToArray()); + if (Tags.Count == 0) + return null; - byte[] buffer = fullString.ToCharArray() - .Select(ch => (byte)ch) - .ToArray(); - - return buffer; + string fullString = string.Join("\0", Tags); + char[] buffer = fullString.ToCharArray(); + return Encoding.UTF8.GetBytes(buffer); } set { @@ -587,11 +586,7 @@ namespace RobloxFiles string fieldName = field.Name; Type fieldType = field.FieldType; - if (field.GetCustomAttribute() != null) - continue; - // A few specific edge case hacks. I wish these didn't need to exist :( - if (fieldName == "Archivable" || fieldName.EndsWith("k__BackingField")) continue; else if (fieldName == "Bevel_Roundness") diff --git a/XmlFormat/XmlFileWriter.cs b/XmlFormat/XmlFileWriter.cs index b76d228..30c71b3 100644 --- a/XmlFormat/XmlFileWriter.cs +++ b/XmlFormat/XmlFileWriter.cs @@ -68,25 +68,42 @@ namespace RobloxFiles.XmlFormat { case PropertyType.CFrame: case PropertyType.Quaternion: + { propType = "CoordinateFrame"; break; + } case PropertyType.Enum: + { propType = "token"; break; + } case PropertyType.Rect: + { propType = "Rect2D"; break; + } case PropertyType.Int: case PropertyType.Bool: case PropertyType.Float: case PropertyType.Int64: case PropertyType.Double: + { propType = propType.ToLower(CultureInfo.InvariantCulture); break; + } case PropertyType.String: - propType = (prop.HasRawBuffer ? "BinaryString" : "string"); + { + if (prop.Value is Content) + propType = "Content"; + else if (prop.Value is ProtectedString) + propType = "ProtectedString"; + else if (prop.Value is byte[]) + propType = "BinaryString"; + else + propType = "string"; + break; - default: break; + } } }