示例#1
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 "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 "DESC":
                    if (Description == null)
                    {
                        Description = new SimpleSubrecord <String>();
                    }

                    Description.ReadBinary(reader);
                    break;

                case "LNAM":
                    if (Locations == null)
                    {
                        Locations = new List <LoadScreenLocation>();
                    }

                    LoadScreenLocation tempLNAM = new LoadScreenLocation();
                    tempLNAM.ReadBinary(reader);
                    Locations.Add(tempLNAM);
                    break;

                case "WMI1":
                    if (LoadScreenType == null)
                    {
                        LoadScreenType = new RecordReference();
                    }

                    LoadScreenType.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
示例#2
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("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("Description", false, out subEle))
            {
                if (Description == null)
                {
                    Description = new SimpleSubrecord <String>();
                }

                Description.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Locations", false, out subEle))
            {
                if (Locations == null)
                {
                    Locations = new List <LoadScreenLocation>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    LoadScreenLocation tempLNAM = new LoadScreenLocation();
                    tempLNAM.ReadXML(e, master);
                    Locations.Add(tempLNAM);
                }
            }
            if (ele.TryPathTo("LoadScreenType", false, out subEle))
            {
                if (LoadScreenType == null)
                {
                    LoadScreenType = new RecordReference();
                }

                LoadScreenType.ReadXML(subEle, master);
            }
        }