diff --git a/File_Format_Library/FileFormats/Layout/CAFE/Header.cs b/File_Format_Library/FileFormats/Layout/CAFE/Header.cs index 3a94d2c8..b5c3ee5d 100644 --- a/File_Format_Library/FileFormats/Layout/CAFE/Header.cs +++ b/File_Format_Library/FileFormats/Layout/CAFE/Header.cs @@ -411,16 +411,20 @@ namespace LayoutBXLYT.Cafe long dataPos = reader.Position; if (currentPane != null) + { ((PAN1)currentPane).UserData = new USD1(reader, this); + + reader.SeekBegin(dataPos); + ((PAN1)currentPane).UserData.Data = reader.ReadBytes((int)SectionSize - 8); + } else { - //User data before panes UserData = new USD1(reader, this); - } - reader.SeekBegin(dataPos); - UserData.Data = reader.ReadBytes((int)SectionSize - 8); + reader.SeekBegin(dataPos); + UserData.Data = reader.ReadBytes((int)SectionSize - 8); + } break; //If the section is not supported store the raw bytes default: diff --git a/File_Format_Library/FileFormats/Layout/CAFE/USD1.cs b/File_Format_Library/FileFormats/Layout/CAFE/USD1.cs index a091dd01..4220b980 100644 --- a/File_Format_Library/FileFormats/Layout/CAFE/USD1.cs +++ b/File_Format_Library/FileFormats/Layout/CAFE/USD1.cs @@ -33,6 +33,11 @@ namespace LayoutBXLYT.Cafe { long startPos = writer.Position - 8; + if (!Edited) { + writer.Write(this.Data); + return; + } + writer.Write((ushort)Entries.Count); writer.Write((ushort)0);