コード例 #1
0
        public void SetAllAppearanceValues(CharacterCustomizationAppearances newValues)
        {
            this.GetAppearanceContainer().FirstSection.AppearanceSections.Clear();
            foreach (CharacterCustomizationAppearances.AppearanceSection section in newValues.FirstSection.AppearanceSections)
            {
                this.GetAppearanceContainer().FirstSection.AppearanceSections.Add(section);
            }

            this.GetAppearanceContainer().SecondSection.AppearanceSections.Clear();
            foreach (CharacterCustomizationAppearances.AppearanceSection section in newValues.SecondSection.AppearanceSections)
            {
                this.GetAppearanceContainer().SecondSection.AppearanceSections.Add(section);
            }

            this.GetAppearanceContainer().ThirdSection.AppearanceSections.Clear();
            foreach (CharacterCustomizationAppearances.AppearanceSection section in newValues.ThirdSection.AppearanceSections)
            {
                this.GetAppearanceContainer().ThirdSection.AppearanceSections.Add(section);
            }

            if (newValues.Strings != null)
            {
                this.GetAppearanceContainer().Strings.Clear();
                foreach (string singleString in newValues.Strings)
                {
                    this.GetAppearanceContainer().Strings.Add(singleString);
                }
            }
        }
コード例 #2
0
        public void SetAllValues(CharacterCustomizationAppearances newValues)
        {
            var sections    = new[] { activeSave.GetAppearanceContainer().FirstSection, activeSave.GetAppearanceContainer().SecondSection, activeSave.GetAppearanceContainer().ThirdSection };
            var newSections = new[] { newValues.FirstSection, newValues.SecondSection, newValues.ThirdSection };

            var i = 0;

            foreach (CharacterCustomizationAppearances.Section section in sections)
            {
                section.AppearanceSections.Clear();
                foreach (CharacterCustomizationAppearances.AppearanceSection subSection in newSections[i].AppearanceSections)
                {
                    section.AppearanceSections.Add(subSection);
                }
                i++;
            }

            if (newValues.Strings != null)
            {
                activeSave.GetAppearanceContainer().Strings.Clear();
                foreach (string singleString in newValues.Strings)
                {
                    activeSave.GetAppearanceContainer().Strings.Add(singleString);
                }
            }
        }
        public object Read(NodeEntry node, BinaryReader reader, List <INodeParser> parsers)
        {
            if (node.Name != ParsableNodeName)
            {
                throw new Exception("Unexpected SectionName");
            }
            var result = new CharacterCustomizationAppearances();

            reader.Skip(4); //skip Id
            result.UnknownFirstBytes = reader.ReadBytes(11);

            result.FirstSection = ReadSection(reader, ExpectedFirstSectionNames);

            result.SecondSection = ReadSection(reader, ExpectedSecondSectionNames);

            result.ThirdSection = ReadSection(reader, ExpectedThirdSectionNames);

            int readSize = node.TrueSize - ((int)reader.BaseStream.Position - node.Offset);

            result.TrailingBytes = reader.ReadBytes(readSize);
            return(result);
        }
コード例 #4
0
        public object Read(NodeEntry node, BinaryReader reader, List <INodeParser> parsers)
        {
            node.Parser = this;
            var result = new CharacterCustomizationAppearances();

            reader.Skip(4); //skip Id
            result.DataExists = reader.ReadBoolean();
            result.Unknown1   = reader.ReadUInt32();

            if (!result.DataExists)
            {
                return(result);
            }

            result.UnknownFirstBytes = reader.ReadBytes(6);

            ReadSection(reader, result.FirstSection, ExpectedFirstSectionNames);
            ReadSection(reader, result.SecondSection, ExpectedSecondSectionNames);
            ReadSection(reader, result.ThirdSection, ExpectedThirdSectionNames);

            var count = reader.ReadUInt32();

            for (var i = 0; i < count; ++i)
            {
                result.StringTriples.Add(ReadStringTriple(reader));
            }

            // Only when SaveVersion > 171
            var scount = reader.ReadPackedInt();

            for (var i = 0; i < scount; ++i)
            {
                result.Strings.Add(reader.ReadPackedString());
            }

            result.Node = node;
            return(result);
        }