Store original usd1 section for saving back unless edited to prevent v9 bflyt glitches.

This commit is contained in:
KillzXGaming 2020-09-12 15:33:28 -04:00
parent 2a1b7b1d97
commit ba0ac85543
2 changed files with 13 additions and 4 deletions

View file

@ -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:

View file

@ -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);