Пример #1
0
        public override void WriteData(ESPWriter writer)
        {
            if (EditorID != null)
            {
                EditorID.WriteBinary(writer);
            }
            if (ObjectBounds != null)
            {
                ObjectBounds.WriteBinary(writer);
            }
            if (Name != null)
            {
                Name.WriteBinary(writer);
            }
            if (Model != null)
            {
                Model.WriteBinary(writer);
            }
            if (LargeIcon != null)
            {
                LargeIcon.WriteBinary(writer);
            }
            if (SmallIcon != null)
            {
                SmallIcon.WriteBinary(writer);
            }
            if (PickUpSound != null)
            {
                PickUpSound.WriteBinary(writer);
            }
            if (DropSound != null)
            {
                DropSound.WriteBinary(writer);
            }
            if (Type != null)
            {
                Type.WriteBinary(writer);
            }
            if (Quests != null)
            {
                foreach (var item in Quests)
                {
                    item.WriteBinary(writer);
                }
            }
            if (Image != null)
            {
                Image.WriteBinary(writer);
            }

            WriteEntryData(writer);
            if (Audio != null)
            {
                Audio.WriteBinary(writer);
            }
        }
Пример #2
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (TextureFace != null)
     {
         TextureFace.WriteBinary(writer);
     }
     if (TextureBack != null)
     {
         TextureBack.WriteBinary(writer);
     }
     if (CardData != null)
     {
         CardData.WriteBinary(writer);
     }
     if (Value != null)
     {
         Value.WriteBinary(writer);
     }
 }
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (Script != null)
            {
                ele.TryPathTo("Script", true, out subEle);
                Script.WriteXML(subEle, master);
            }
            if (PickUpSound != null)
            {
                ele.TryPathTo("PickUpSound", true, out subEle);
                PickUpSound.WriteXML(subEle, master);
            }
            if (DropSound != null)
            {
                ele.TryPathTo("DropSound", true, out subEle);
                DropSound.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
        }
Пример #4
0
        /// <summary>
        /// Plays a given sound effect
        /// </summary>
        /// <param name="sound">The drop sound to play</param>
        public static void PlaySound(DropSound sound)
        {
            switch (sound)
            {
            case DropSound.call:
                callOut.Play();
                break;

            case DropSound.hit:
                hitOut.Play();
                break;
            }
        }
Пример #5
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Description != null)
     {
         Description.WriteBinary(writer);
     }
     if (Destructable != null)
     {
         Destructable.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
 }
Пример #6
0
        /// <summary>
        /// Stops a given sound effect
        /// </summary>
        /// <param name="sound">The drop sound to stop</param>
        public static void StopSound(DropSound sound)
        {
            switch (sound)
            {
            case DropSound.call:
                callOut.Stop();
                callRead.Seek(0, System.IO.SeekOrigin.Begin);
                break;

            case DropSound.hit:
                hitOut.Stop();
                hitRead.Seek(0, System.IO.SeekOrigin.Begin);
                break;
            }
        }
Пример #7
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (AbsoluteValue != null)
     {
         AbsoluteValue.WriteBinary(writer);
     }
 }
Пример #8
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "DEST":
                    if (Destructable == null)
                    {
                        Destructable = new Destructable();
                    }

                    Destructable.ReadBinary(reader);
                    break;

                case "YNAM":
                    if (PickUpSound == null)
                    {
                        PickUpSound = new RecordReference();
                    }

                    PickUpSound.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (DropSound == null)
                    {
                        DropSound = new RecordReference();
                    }

                    DropSound.ReadBinary(reader);
                    break;

                case "ETYP":
                    if (EquipmentType == null)
                    {
                        EquipmentType = new SimpleSubrecord <EquipmentType>();
                    }

                    EquipmentType.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Weight == null)
                    {
                        Weight = new SimpleSubrecord <Single>();
                    }

                    Weight.ReadBinary(reader);
                    break;

                case "ENIT":
                    if (Data == null)
                    {
                        Data = new IngestibleData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "EFID":
                    if (Effects == null)
                    {
                        Effects = new List <Effect>();
                    }

                    Effect tempEFID = new Effect();
                    tempEFID.ReadBinary(reader);
                    Effects.Add(tempEFID);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Пример #9
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Destructable", false, out subEle))
            {
                if (Destructable == null)
                {
                    Destructable = new Destructable();
                }

                Destructable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickUpSound", false, out subEle))
            {
                if (PickUpSound == null)
                {
                    PickUpSound = new RecordReference();
                }

                PickUpSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EquipmentType", false, out subEle))
            {
                if (EquipmentType == null)
                {
                    EquipmentType = new SimpleSubrecord <EquipmentType>();
                }

                EquipmentType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Weight", false, out subEle))
            {
                if (Weight == null)
                {
                    Weight = new SimpleSubrecord <Single>();
                }

                Weight.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new IngestibleData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Effects", false, out subEle))
            {
                if (Effects == null)
                {
                    Effects = new List <Effect>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Effect tempEFID = new Effect();
                    tempEFID.ReadXML(e, master);
                    Effects.Add(tempEFID);
                }
            }
        }
Пример #10
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (Script != null)
            {
                ele.TryPathTo("Script", true, out subEle);
                Script.WriteXML(subEle, master);
            }
            if (Destructable != null)
            {
                ele.TryPathTo("Destructable", true, out subEle);
                Destructable.WriteXML(subEle, master);
            }
            if (PickUpSound != null)
            {
                ele.TryPathTo("PickUpSound", true, out subEle);
                PickUpSound.WriteXML(subEle, master);
            }
            if (DropSound != null)
            {
                ele.TryPathTo("DropSound", true, out subEle);
                DropSound.WriteXML(subEle, master);
            }
            if (EquipmentType != null)
            {
                ele.TryPathTo("EquipmentType", true, out subEle);
                EquipmentType.WriteXML(subEle, master);
            }
            if (Weight != null)
            {
                ele.TryPathTo("Weight", true, out subEle);
                Weight.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (Effects != null)
            {
                ele.TryPathTo("Effects", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Effect"
                };
                int i = 0;
                foreach (var entry in Effects)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
        }
Пример #11
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Destructable != null)
     {
         Destructable.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (EquipmentType != null)
     {
         EquipmentType.WriteBinary(writer);
     }
     if (Weight != null)
     {
         Weight.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (Effects != null)
     {
         foreach (var item in Effects)
         {
             item.WriteBinary(writer);
         }
     }
 }
Пример #12
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "YNAM":
                    if (PickUpSound == null)
                    {
                        PickUpSound = new RecordReference();
                    }

                    PickUpSound.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (DropSound == null)
                    {
                        DropSound = new RecordReference();
                    }

                    DropSound.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Type == null)
                    {
                        Type = new SimpleSubrecord <NoteType>();
                    }

                    Type.ReadBinary(reader);
                    break;

                case "ONAM":
                    if (Quests == null)
                    {
                        Quests = new List <RecordReference>();
                    }

                    RecordReference tempONAM = new RecordReference();
                    tempONAM.ReadBinary(reader);
                    Quests.Add(tempONAM);
                    break;

                case "XNAM":
                    if (Image == null)
                    {
                        Image = new SimpleSubrecord <String>();
                    }

                    Image.ReadBinary(reader);
                    break;

                case "TNAM":
                    ReadEntryData(reader);
                    break;

                case "SNAM":
                    if (Audio == null)
                    {
                        Audio = new RecordReference();
                    }

                    Audio.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Пример #13
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "DESC":
                    if (Description == null)
                    {
                        Description = new SimpleSubrecord <String>();
                    }

                    Description.ReadBinary(reader);
                    break;

                case "DEST":
                    if (Destructable == null)
                    {
                        Destructable = new Destructable();
                    }

                    Destructable.ReadBinary(reader);
                    break;

                case "YNAM":
                    if (PickUpSound == null)
                    {
                        PickUpSound = new RecordReference();
                    }

                    PickUpSound.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (DropSound == null)
                    {
                        DropSound = new RecordReference();
                    }

                    DropSound.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Data == null)
                    {
                        Data = new BookData();
                    }

                    Data.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Пример #14
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickUpSound", false, out subEle))
            {
                if (PickUpSound == null)
                {
                    PickUpSound = new RecordReference();
                }

                PickUpSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("AbsoluteValue", false, out subEle))
            {
                if (AbsoluteValue == null)
                {
                    AbsoluteValue = new SimpleSubrecord <UInt32>();
                }

                AbsoluteValue.ReadXML(subEle, master);
            }
        }
Пример #15
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectEffect", false, out subEle))
            {
                if (ObjectEffect == null)
                {
                    ObjectEffect = new RecordReference();
                }

                ObjectEffect.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("BipedData", false, out subEle))
            {
                if (BipedData == null)
                {
                    BipedData = new BipedData();
                }

                BipedData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Male/FileName", false, out subEle))
            {
                if (MaleBipedModelFileName == null)
                {
                    MaleBipedModelFileName = new SimpleSubrecord <String>();
                }

                MaleBipedModelFileName.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Male/TextureHashes", false, out subEle))
            {
                if (MaleBipedModelTextureHashes == null)
                {
                    MaleBipedModelTextureHashes = new SimpleSubrecord <Byte[]>();
                }

                MaleBipedModelTextureHashes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Male/AlternateTextures", false, out subEle))
            {
                if (MaleBipedModelAlternateTextures == null)
                {
                    MaleBipedModelAlternateTextures = new AlternateTextures();
                }

                MaleBipedModelAlternateTextures.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Male/FaceGenModelFlags", false, out subEle))
            {
                if (MaleBipedModelFaceGenModelFlags == null)
                {
                    MaleBipedModelFaceGenModelFlags = new SimpleSubrecord <FaceGenModelFlags>();
                }

                MaleBipedModelFaceGenModelFlags.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/World/Male/FileName", false, out subEle))
            {
                if (MaleWorldModelFileName == null)
                {
                    MaleWorldModelFileName = new SimpleSubrecord <String>();
                }

                MaleWorldModelFileName.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/World/Male/TextureHashes", false, out subEle))
            {
                if (MaleWorldModelTextureHashes == null)
                {
                    MaleWorldModelTextureHashes = new SimpleSubrecord <Byte[]>();
                }

                MaleWorldModelTextureHashes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/World/Male/AlternateTextures", false, out subEle))
            {
                if (MaleWorldModelAlternateTextures == null)
                {
                    MaleWorldModelAlternateTextures = new AlternateTextures();
                }

                MaleWorldModelAlternateTextures.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Inventory/Male", false, out subEle))
            {
                if (MaleInventoryIcon == null)
                {
                    MaleInventoryIcon = new SimpleSubrecord <String>();
                }

                MaleInventoryIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Message/Male", false, out subEle))
            {
                if (MaleMessageIcon == null)
                {
                    MaleMessageIcon = new SimpleSubrecord <String>();
                }

                MaleMessageIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Female/FileName", false, out subEle))
            {
                if (FemaleBipedModelFileName == null)
                {
                    FemaleBipedModelFileName = new SimpleSubrecord <String>();
                }

                FemaleBipedModelFileName.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Female/TextureHashes", false, out subEle))
            {
                if (FemaleBipedModelTextureHashes == null)
                {
                    FemaleBipedModelTextureHashes = new SimpleSubrecord <Byte[]>();
                }

                FemaleBipedModelTextureHashes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Female/AlternateTextures", false, out subEle))
            {
                if (FemaleBipedModelAlternateTextures == null)
                {
                    FemaleBipedModelAlternateTextures = new AlternateTextures();
                }

                FemaleBipedModelAlternateTextures.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/Biped/Female/FaceGenModelFlags", false, out subEle))
            {
                if (FemaleBipedModelFaceGenModelFlags == null)
                {
                    FemaleBipedModelFaceGenModelFlags = new SimpleSubrecord <FaceGenModelFlags>();
                }

                FemaleBipedModelFaceGenModelFlags.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/World/Female/FileName", false, out subEle))
            {
                if (FemaleWorldModelFileName == null)
                {
                    FemaleWorldModelFileName = new SimpleSubrecord <String>();
                }

                FemaleWorldModelFileName.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/World/Female/TextureHashes", false, out subEle))
            {
                if (FemaleWorldModelTextureHashes == null)
                {
                    FemaleWorldModelTextureHashes = new SimpleSubrecord <Byte[]>();
                }

                FemaleWorldModelTextureHashes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Models/World/Female/AlternateTextures", false, out subEle))
            {
                if (FemaleWorldModelAlternateTextures == null)
                {
                    FemaleWorldModelAlternateTextures = new AlternateTextures();
                }

                FemaleWorldModelAlternateTextures.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Inventory/Female", false, out subEle))
            {
                if (FemaleInventoryIcon == null)
                {
                    FemaleInventoryIcon = new SimpleSubrecord <String>();
                }

                FemaleInventoryIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Message/Female", false, out subEle))
            {
                if (FemaleMessageIcon == null)
                {
                    FemaleMessageIcon = new SimpleSubrecord <String>();
                }

                FemaleMessageIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RagdollConstraintTemplate", false, out subEle))
            {
                if (RagdollConstraintTemplate == null)
                {
                    RagdollConstraintTemplate = new SimpleSubrecord <String>();
                }

                RagdollConstraintTemplate.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RepairList", false, out subEle))
            {
                if (RepairList == null)
                {
                    RepairList = new RecordReference();
                }

                RepairList.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("BipedModelList", false, out subEle))
            {
                if (BipedModelList == null)
                {
                    BipedModelList = new RecordReference();
                }

                BipedModelList.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EquipmentType", false, out subEle))
            {
                if (EquipmentType == null)
                {
                    EquipmentType = new SimpleSubrecord <EquipmentType>();
                }

                EquipmentType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickupSound", false, out subEle))
            {
                if (PickupSound == null)
                {
                    PickupSound = new RecordReference();
                }

                PickupSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new ArmorData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ExtraData", false, out subEle))
            {
                if (ExtraData == null)
                {
                    ExtraData = new ArmorExtraData();
                }

                ExtraData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("OverridesAnimationSounds", false, out subEle))
            {
                if (OverridesAnimationSounds == null)
                {
                    OverridesAnimationSounds = new SimpleSubrecord <NoYes>();
                }

                OverridesAnimationSounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("AnimationSounds", false, out subEle))
            {
                if (AnimationSounds == null)
                {
                    AnimationSounds = new List <AnimationSound>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    AnimationSound tempSNAM = new AnimationSound();
                    tempSNAM.ReadXML(e, master);
                    AnimationSounds.Add(tempSNAM);
                }
            }
            if (ele.TryPathTo("AnimationSoundsTemplate", false, out subEle))
            {
                if (AnimationSoundsTemplate == null)
                {
                    AnimationSoundsTemplate = new RecordReference();
                }

                AnimationSoundsTemplate.ReadXML(subEle, master);
            }
        }
Пример #16
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Script != null)
            {
                ele.TryPathTo("Script", true, out subEle);
                Script.WriteXML(subEle, master);
            }
            if (ObjectEffect != null)
            {
                ele.TryPathTo("ObjectEffect", true, out subEle);
                ObjectEffect.WriteXML(subEle, master);
            }
            if (BipedData != null)
            {
                ele.TryPathTo("BipedData", true, out subEle);
                BipedData.WriteXML(subEle, master);
            }
            if (MaleBipedModelFileName != null)
            {
                ele.TryPathTo("Models/Biped/Male/FileName", true, out subEle);
                MaleBipedModelFileName.WriteXML(subEle, master);
            }
            if (MaleBipedModelTextureHashes != null)
            {
                ele.TryPathTo("Models/Biped/Male/TextureHashes", true, out subEle);
                MaleBipedModelTextureHashes.WriteXML(subEle, master);
            }
            if (MaleBipedModelAlternateTextures != null)
            {
                ele.TryPathTo("Models/Biped/Male/AlternateTextures", true, out subEle);
                MaleBipedModelAlternateTextures.WriteXML(subEle, master);
            }
            if (MaleBipedModelFaceGenModelFlags != null)
            {
                ele.TryPathTo("Models/Biped/Male/FaceGenModelFlags", true, out subEle);
                MaleBipedModelFaceGenModelFlags.WriteXML(subEle, master);
            }
            if (MaleWorldModelFileName != null)
            {
                ele.TryPathTo("Models/World/Male/FileName", true, out subEle);
                MaleWorldModelFileName.WriteXML(subEle, master);
            }
            if (MaleWorldModelTextureHashes != null)
            {
                ele.TryPathTo("Models/World/Male/TextureHashes", true, out subEle);
                MaleWorldModelTextureHashes.WriteXML(subEle, master);
            }
            if (MaleWorldModelAlternateTextures != null)
            {
                ele.TryPathTo("Models/World/Male/AlternateTextures", true, out subEle);
                MaleWorldModelAlternateTextures.WriteXML(subEle, master);
            }
            if (MaleInventoryIcon != null)
            {
                ele.TryPathTo("Icon/Inventory/Male", true, out subEle);
                MaleInventoryIcon.WriteXML(subEle, master);
            }
            if (MaleMessageIcon != null)
            {
                ele.TryPathTo("Icon/Message/Male", true, out subEle);
                MaleMessageIcon.WriteXML(subEle, master);
            }
            if (FemaleBipedModelFileName != null)
            {
                ele.TryPathTo("Models/Biped/Female/FileName", true, out subEle);
                FemaleBipedModelFileName.WriteXML(subEle, master);
            }
            if (FemaleBipedModelTextureHashes != null)
            {
                ele.TryPathTo("Models/Biped/Female/TextureHashes", true, out subEle);
                FemaleBipedModelTextureHashes.WriteXML(subEle, master);
            }
            if (FemaleBipedModelAlternateTextures != null)
            {
                ele.TryPathTo("Models/Biped/Female/AlternateTextures", true, out subEle);
                FemaleBipedModelAlternateTextures.WriteXML(subEle, master);
            }
            if (FemaleBipedModelFaceGenModelFlags != null)
            {
                ele.TryPathTo("Models/Biped/Female/FaceGenModelFlags", true, out subEle);
                FemaleBipedModelFaceGenModelFlags.WriteXML(subEle, master);
            }
            if (FemaleWorldModelFileName != null)
            {
                ele.TryPathTo("Models/World/Female/FileName", true, out subEle);
                FemaleWorldModelFileName.WriteXML(subEle, master);
            }
            if (FemaleWorldModelTextureHashes != null)
            {
                ele.TryPathTo("Models/World/Female/TextureHashes", true, out subEle);
                FemaleWorldModelTextureHashes.WriteXML(subEle, master);
            }
            if (FemaleWorldModelAlternateTextures != null)
            {
                ele.TryPathTo("Models/World/Female/AlternateTextures", true, out subEle);
                FemaleWorldModelAlternateTextures.WriteXML(subEle, master);
            }
            if (FemaleInventoryIcon != null)
            {
                ele.TryPathTo("Icon/Inventory/Female", true, out subEle);
                FemaleInventoryIcon.WriteXML(subEle, master);
            }
            if (FemaleMessageIcon != null)
            {
                ele.TryPathTo("Icon/Message/Female", true, out subEle);
                FemaleMessageIcon.WriteXML(subEle, master);
            }
            if (RagdollConstraintTemplate != null)
            {
                ele.TryPathTo("RagdollConstraintTemplate", true, out subEle);
                RagdollConstraintTemplate.WriteXML(subEle, master);
            }
            if (RepairList != null)
            {
                ele.TryPathTo("RepairList", true, out subEle);
                RepairList.WriteXML(subEle, master);
            }
            if (BipedModelList != null)
            {
                ele.TryPathTo("BipedModelList", true, out subEle);
                BipedModelList.WriteXML(subEle, master);
            }
            if (EquipmentType != null)
            {
                ele.TryPathTo("EquipmentType", true, out subEle);
                EquipmentType.WriteXML(subEle, master);
            }
            if (PickupSound != null)
            {
                ele.TryPathTo("PickupSound", true, out subEle);
                PickupSound.WriteXML(subEle, master);
            }
            if (DropSound != null)
            {
                ele.TryPathTo("DropSound", true, out subEle);
                DropSound.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (ExtraData != null)
            {
                ele.TryPathTo("ExtraData", true, out subEle);
                ExtraData.WriteXML(subEle, master);
            }
            if (OverridesAnimationSounds != null)
            {
                ele.TryPathTo("OverridesAnimationSounds", true, out subEle);
                OverridesAnimationSounds.WriteXML(subEle, master);
            }
            if (AnimationSounds != null)
            {
                ele.TryPathTo("AnimationSounds", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Sound"
                };
                int i = 0;
                foreach (var entry in AnimationSounds)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (AnimationSoundsTemplate != null)
            {
                ele.TryPathTo("AnimationSoundsTemplate", true, out subEle);
                AnimationSoundsTemplate.WriteXML(subEle, master);
            }
        }
Пример #17
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (ObjectEffect != null)
     {
         ObjectEffect.WriteBinary(writer);
     }
     if (BipedData != null)
     {
         BipedData.WriteBinary(writer);
     }
     if (MaleBipedModelFileName != null)
     {
         MaleBipedModelFileName.WriteBinary(writer);
     }
     if (MaleBipedModelTextureHashes != null)
     {
         MaleBipedModelTextureHashes.WriteBinary(writer);
     }
     if (MaleBipedModelAlternateTextures != null)
     {
         MaleBipedModelAlternateTextures.WriteBinary(writer);
     }
     if (MaleBipedModelFaceGenModelFlags != null)
     {
         MaleBipedModelFaceGenModelFlags.WriteBinary(writer);
     }
     if (MaleWorldModelFileName != null)
     {
         MaleWorldModelFileName.WriteBinary(writer);
     }
     if (MaleWorldModelTextureHashes != null)
     {
         MaleWorldModelTextureHashes.WriteBinary(writer);
     }
     if (MaleWorldModelAlternateTextures != null)
     {
         MaleWorldModelAlternateTextures.WriteBinary(writer);
     }
     if (MaleInventoryIcon != null)
     {
         MaleInventoryIcon.WriteBinary(writer);
     }
     if (MaleMessageIcon != null)
     {
         MaleMessageIcon.WriteBinary(writer);
     }
     if (FemaleBipedModelFileName != null)
     {
         FemaleBipedModelFileName.WriteBinary(writer);
     }
     if (FemaleBipedModelTextureHashes != null)
     {
         FemaleBipedModelTextureHashes.WriteBinary(writer);
     }
     if (FemaleBipedModelAlternateTextures != null)
     {
         FemaleBipedModelAlternateTextures.WriteBinary(writer);
     }
     if (FemaleBipedModelFaceGenModelFlags != null)
     {
         FemaleBipedModelFaceGenModelFlags.WriteBinary(writer);
     }
     if (FemaleWorldModelFileName != null)
     {
         FemaleWorldModelFileName.WriteBinary(writer);
     }
     if (FemaleWorldModelTextureHashes != null)
     {
         FemaleWorldModelTextureHashes.WriteBinary(writer);
     }
     if (FemaleWorldModelAlternateTextures != null)
     {
         FemaleWorldModelAlternateTextures.WriteBinary(writer);
     }
     if (FemaleInventoryIcon != null)
     {
         FemaleInventoryIcon.WriteBinary(writer);
     }
     if (FemaleMessageIcon != null)
     {
         FemaleMessageIcon.WriteBinary(writer);
     }
     if (RagdollConstraintTemplate != null)
     {
         RagdollConstraintTemplate.WriteBinary(writer);
     }
     if (RepairList != null)
     {
         RepairList.WriteBinary(writer);
     }
     if (BipedModelList != null)
     {
         BipedModelList.WriteBinary(writer);
     }
     if (EquipmentType != null)
     {
         EquipmentType.WriteBinary(writer);
     }
     if (PickupSound != null)
     {
         PickupSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (ExtraData != null)
     {
         ExtraData.WriteBinary(writer);
     }
     if (OverridesAnimationSounds != null)
     {
         OverridesAnimationSounds.WriteBinary(writer);
     }
     if (AnimationSounds != null)
     {
         foreach (var item in AnimationSounds)
         {
             item.WriteBinary(writer);
         }
     }
     if (AnimationSoundsTemplate != null)
     {
         AnimationSoundsTemplate.WriteBinary(writer);
     }
 }
Пример #18
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "EITM":
                    if (ObjectEffect == null)
                    {
                        ObjectEffect = new RecordReference();
                    }

                    ObjectEffect.ReadBinary(reader);
                    break;

                case "BMDT":
                    if (BipedData == null)
                    {
                        BipedData = new BipedData();
                    }

                    BipedData.ReadBinary(reader);
                    break;

                case "MODL":
                    if (MaleBipedModelFileName == null)
                    {
                        MaleBipedModelFileName = new SimpleSubrecord <String>();
                    }

                    MaleBipedModelFileName.ReadBinary(reader);
                    break;

                case "MODT":
                    if (MaleBipedModelTextureHashes == null)
                    {
                        MaleBipedModelTextureHashes = new SimpleSubrecord <Byte[]>();
                    }

                    MaleBipedModelTextureHashes.ReadBinary(reader);
                    break;

                case "MODS":
                    if (MaleBipedModelAlternateTextures == null)
                    {
                        MaleBipedModelAlternateTextures = new AlternateTextures();
                    }

                    MaleBipedModelAlternateTextures.ReadBinary(reader);
                    break;

                case "MODD":
                    if (MaleBipedModelFaceGenModelFlags == null)
                    {
                        MaleBipedModelFaceGenModelFlags = new SimpleSubrecord <FaceGenModelFlags>();
                    }

                    MaleBipedModelFaceGenModelFlags.ReadBinary(reader);
                    break;

                case "MOD2":
                    if (MaleWorldModelFileName == null)
                    {
                        MaleWorldModelFileName = new SimpleSubrecord <String>();
                    }

                    MaleWorldModelFileName.ReadBinary(reader);
                    break;

                case "MO2T":
                    if (MaleWorldModelTextureHashes == null)
                    {
                        MaleWorldModelTextureHashes = new SimpleSubrecord <Byte[]>();
                    }

                    MaleWorldModelTextureHashes.ReadBinary(reader);
                    break;

                case "MO2S":
                    if (MaleWorldModelAlternateTextures == null)
                    {
                        MaleWorldModelAlternateTextures = new AlternateTextures();
                    }

                    MaleWorldModelAlternateTextures.ReadBinary(reader);
                    break;

                case "ICON":
                    if (MaleInventoryIcon == null)
                    {
                        MaleInventoryIcon = new SimpleSubrecord <String>();
                    }

                    MaleInventoryIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (MaleMessageIcon == null)
                    {
                        MaleMessageIcon = new SimpleSubrecord <String>();
                    }

                    MaleMessageIcon.ReadBinary(reader);
                    break;

                case "MOD3":
                    if (FemaleBipedModelFileName == null)
                    {
                        FemaleBipedModelFileName = new SimpleSubrecord <String>();
                    }

                    FemaleBipedModelFileName.ReadBinary(reader);
                    break;

                case "MO3T":
                    if (FemaleBipedModelTextureHashes == null)
                    {
                        FemaleBipedModelTextureHashes = new SimpleSubrecord <Byte[]>();
                    }

                    FemaleBipedModelTextureHashes.ReadBinary(reader);
                    break;

                case "MO3S":
                    if (FemaleBipedModelAlternateTextures == null)
                    {
                        FemaleBipedModelAlternateTextures = new AlternateTextures();
                    }

                    FemaleBipedModelAlternateTextures.ReadBinary(reader);
                    break;

                case "MOSD":
                    if (FemaleBipedModelFaceGenModelFlags == null)
                    {
                        FemaleBipedModelFaceGenModelFlags = new SimpleSubrecord <FaceGenModelFlags>();
                    }

                    FemaleBipedModelFaceGenModelFlags.ReadBinary(reader);
                    break;

                case "MOD4":
                    if (FemaleWorldModelFileName == null)
                    {
                        FemaleWorldModelFileName = new SimpleSubrecord <String>();
                    }

                    FemaleWorldModelFileName.ReadBinary(reader);
                    break;

                case "MO4T":
                    if (FemaleWorldModelTextureHashes == null)
                    {
                        FemaleWorldModelTextureHashes = new SimpleSubrecord <Byte[]>();
                    }

                    FemaleWorldModelTextureHashes.ReadBinary(reader);
                    break;

                case "MO4S":
                    if (FemaleWorldModelAlternateTextures == null)
                    {
                        FemaleWorldModelAlternateTextures = new AlternateTextures();
                    }

                    FemaleWorldModelAlternateTextures.ReadBinary(reader);
                    break;

                case "ICO2":
                    if (FemaleInventoryIcon == null)
                    {
                        FemaleInventoryIcon = new SimpleSubrecord <String>();
                    }

                    FemaleInventoryIcon.ReadBinary(reader);
                    break;

                case "MIC2":
                    if (FemaleMessageIcon == null)
                    {
                        FemaleMessageIcon = new SimpleSubrecord <String>();
                    }

                    FemaleMessageIcon.ReadBinary(reader);
                    break;

                case "BMCT":
                    if (RagdollConstraintTemplate == null)
                    {
                        RagdollConstraintTemplate = new SimpleSubrecord <String>();
                    }

                    RagdollConstraintTemplate.ReadBinary(reader);
                    break;

                case "REPL":
                    if (RepairList == null)
                    {
                        RepairList = new RecordReference();
                    }

                    RepairList.ReadBinary(reader);
                    break;

                case "BIPL":
                    if (BipedModelList == null)
                    {
                        BipedModelList = new RecordReference();
                    }

                    BipedModelList.ReadBinary(reader);
                    break;

                case "ETYP":
                    if (EquipmentType == null)
                    {
                        EquipmentType = new SimpleSubrecord <EquipmentType>();
                    }

                    EquipmentType.ReadBinary(reader);
                    break;

                case "YNAM":
                    if (PickupSound == null)
                    {
                        PickupSound = new RecordReference();
                    }

                    PickupSound.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (DropSound == null)
                    {
                        DropSound = new RecordReference();
                    }

                    DropSound.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Data == null)
                    {
                        Data = new ArmorData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (ExtraData == null)
                    {
                        ExtraData = new ArmorExtraData();
                    }

                    ExtraData.ReadBinary(reader);
                    break;

                case "BNAM":
                    if (OverridesAnimationSounds == null)
                    {
                        OverridesAnimationSounds = new SimpleSubrecord <NoYes>();
                    }

                    OverridesAnimationSounds.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (AnimationSounds == null)
                    {
                        AnimationSounds = new List <AnimationSound>();
                    }

                    AnimationSound tempSNAM = new AnimationSound();
                    tempSNAM.ReadBinary(reader);
                    AnimationSounds.Add(tempSNAM);
                    break;

                case "TNAM":
                    if (AnimationSoundsTemplate == null)
                    {
                        AnimationSoundsTemplate = new RecordReference();
                    }

                    AnimationSoundsTemplate.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Пример #19
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Destructable != null)
     {
         Destructable.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (ExtraData != null)
     {
         ExtraData.WriteBinary(writer);
     }
     if (ShortName != null)
     {
         ShortName.WriteBinary(writer);
     }
     if (Abbreviation != null)
     {
         Abbreviation.WriteBinary(writer);
     }
     if (AmmoEffects != null)
     {
         foreach (var item in AmmoEffects)
         {
             item.WriteBinary(writer);
         }
     }
 }
Пример #20
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickUpSound", false, out subEle))
            {
                if (PickUpSound == null)
                {
                    PickUpSound = new RecordReference();
                }

                PickUpSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Texture/Face", false, out subEle))
            {
                if (TextureFace == null)
                {
                    TextureFace = new SimpleSubrecord <String>();
                }

                TextureFace.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Texture/Back", false, out subEle))
            {
                if (TextureBack == null)
                {
                    TextureBack = new SimpleSubrecord <String>();
                }

                TextureBack.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("CardData", false, out subEle))
            {
                if (CardData == null)
                {
                    CardData = new Card();
                }

                CardData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Value", false, out subEle))
            {
                if (Value == null)
                {
                    Value = new SimpleSubrecord <UInt32>();
                }

                Value.ReadXML(subEle, master);
            }
        }
Пример #21
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Description", false, out subEle))
            {
                if (Description == null)
                {
                    Description = new SimpleSubrecord <String>();
                }

                Description.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Destructable", false, out subEle))
            {
                if (Destructable == null)
                {
                    Destructable = new Destructable();
                }

                Destructable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickUpSound", false, out subEle))
            {
                if (PickUpSound == null)
                {
                    PickUpSound = new RecordReference();
                }

                PickUpSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new BookData();
                }

                Data.ReadXML(subEle, master);
            }
        }
Пример #22
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (PickUpSound != null)
            {
                ele.TryPathTo("PickUpSound", true, out subEle);
                PickUpSound.WriteXML(subEle, master);
            }
            if (DropSound != null)
            {
                ele.TryPathTo("DropSound", true, out subEle);
                DropSound.WriteXML(subEle, master);
            }
            if (Type != null)
            {
                ele.TryPathTo("Type", true, out subEle);
                Type.WriteXML(subEle, master);
            }
            if (Quests != null)
            {
                ele.TryPathTo("Quests", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Quest"
                };
                int i = 0;
                foreach (var entry in Quests)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (Image != null)
            {
                ele.TryPathTo("Image", true, out subEle);
                Image.WriteXML(subEle, master);
            }

            WriteEntryDataXML(ele, master);
            if (Audio != null)
            {
                ele.TryPathTo("Audio", true, out subEle);
                Audio.WriteXML(subEle, master);
            }
        }
Пример #23
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Destructable", false, out subEle))
            {
                if (Destructable == null)
                {
                    Destructable = new Destructable();
                }

                Destructable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickUpSound", false, out subEle))
            {
                if (PickUpSound == null)
                {
                    PickUpSound = new RecordReference();
                }

                PickUpSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new AmmoData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ExtraData", false, out subEle))
            {
                if (ExtraData == null)
                {
                    ExtraData = new AmmoExtraData();
                }

                ExtraData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ShortName", false, out subEle))
            {
                if (ShortName == null)
                {
                    ShortName = new SimpleSubrecord <String>();
                }

                ShortName.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Abbreviation", false, out subEle))
            {
                if (Abbreviation == null)
                {
                    Abbreviation = new SimpleSubrecord <String>();
                }

                Abbreviation.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("AmmoEffects", false, out subEle))
            {
                if (AmmoEffects == null)
                {
                    AmmoEffects = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempRCIL = new RecordReference();
                    tempRCIL.ReadXML(e, master);
                    AmmoEffects.Add(tempRCIL);
                }
            }
        }
Пример #24
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PickUpSound", false, out subEle))
            {
                if (PickUpSound == null)
                {
                    PickUpSound = new RecordReference();
                }

                PickUpSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DropSound", false, out subEle))
            {
                if (DropSound == null)
                {
                    DropSound = new RecordReference();
                }

                DropSound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Type", false, out subEle))
            {
                if (Type == null)
                {
                    Type = new SimpleSubrecord <NoteType>();
                }

                Type.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Quests", false, out subEle))
            {
                if (Quests == null)
                {
                    Quests = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempONAM = new RecordReference();
                    tempONAM.ReadXML(e, master);
                    Quests.Add(tempONAM);
                }
            }
            if (ele.TryPathTo("Image", false, out subEle))
            {
                if (Image == null)
                {
                    Image = new SimpleSubrecord <String>();
                }

                Image.ReadXML(subEle, master);
            }

            ReadEntryDataXML(ele, master);
            if (ele.TryPathTo("Audio", false, out subEle))
            {
                if (Audio == null)
                {
                    Audio = new RecordReference();
                }

                Audio.ReadXML(subEle, master);
            }
        }
Пример #25
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "YNAM":
                    if (PickUpSound == null)
                    {
                        PickUpSound = new RecordReference();
                    }

                    PickUpSound.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (DropSound == null)
                    {
                        DropSound = new RecordReference();
                    }

                    DropSound.ReadBinary(reader);
                    break;

                case "TX00":
                    if (TextureFace == null)
                    {
                        TextureFace = new SimpleSubrecord <String>();
                    }

                    TextureFace.ReadBinary(reader);
                    break;

                case "TX01":
                    if (TextureBack == null)
                    {
                        TextureBack = new SimpleSubrecord <String>();
                    }

                    TextureBack.ReadBinary(reader);
                    break;

                case "INTV":
                    if (CardData == null)
                    {
                        CardData = new Card();
                    }

                    CardData.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Value == null)
                    {
                        Value = new SimpleSubrecord <UInt32>();
                    }

                    Value.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Пример #26
0
    // Use this for initialization
    void Start()
    {
        DropSound sndDpr = soundDropper.GetComponent <DropSound>();

        sndDpr.soundToPlay = powerupSound;
    }