internal static FormControlInfo ReadWithoutDataType(BinaryReader reader, int length)
        {
            var startPosition = reader.BaseStream.Position;
            var elem          = new FormControlInfo()
            {
            };

            elem.UnknownBeforeName = reader.ReadBytes(20);
            elem.Name              = reader.ReadCStyleString();
            elem.Comment           = reader.ReadCStyleString();
            elem.UnknownBeforeLeft = reader.ReadInt32();
            elem.Left              = reader.ReadInt32();
            elem.Top    = reader.ReadInt32();
            elem.Width  = reader.ReadInt32();
            elem.Height = reader.ReadInt32();
            elem.UnknownBeforeParent = reader.ReadInt32();
            elem.Parent               = reader.ReadInt32();
            elem.Children             = reader.ReadInt32sWithLengthPrefix();
            elem.Cursor               = reader.ReadBytesWithLengthPrefix();
            elem.Tag                  = reader.ReadCStyleString();
            elem.UnknownBeforeVisible = reader.ReadInt32();
            {
                int showStatus = reader.ReadInt32();
                elem.Visible = (showStatus & 0x1) != 0;
                elem.Disable = (showStatus & 0x2) != 0;
            }
            elem.UnknownBeforeEvents = reader.ReadInt32();
            elem.Events = new object[reader.ReadInt32()].Select(x => new KeyValuePair <int, int>(reader.ReadInt32(), reader.ReadInt32())).ToArray();
            elem.UnknownBeforeExtensionData = reader.ReadBytes(20);
            elem.ExtensionData = reader.ReadBytes(length - (int)(reader.BaseStream.Position - startPosition));
            return(elem);
        }
Beispiel #2
0
 public static FormElementInfo[] ReadFormElements(BinaryReader r)
 {
     return(r.ReadBlocksWithIdAndOffest((reader, id, length) =>
     {
         var dataType = reader.ReadInt32();
         FormElementInfo elem;
         if (dataType == 65539)
         {
             elem = FormMenuInfo.ReadWithoutDataType(r, length - 4);
         }
         else
         {
             elem = FormControlInfo.ReadWithoutDataType(r, length - 4);
         }
         elem.Id = id;
         elem.DataType = dataType;
         return elem;
     }));
 }