예제 #1
0
        public void GameSettingStringHandler(
            IMutagenReadStream stream,
            MajorRecordHeader major,
            BinaryFileProcessor.ConfigConstructor instr,
            List <KeyValuePair <uint, uint> > processedStrings,
            IStringsLookup overlay,
            ref uint newIndex)
        {
            stream.Position -= major.HeaderLength;
            var majorRec = stream.GetMajorRecordFrame();

            if (!majorRec.TryLocateSubrecordFrame("EDID", out var edidRec))
            {
                throw new ArgumentException();
            }
            if (edidRec.Content[0] != (byte)'s')
            {
                return;
            }
            if (!majorRec.TryLocateSubrecordPinFrame("DATA", out var dataRec))
            {
                throw new ArgumentException();
            }
            stream.Position += dataRec.Location;
            AStringsAlignment.ProcessStringLink(stream, instr, processedStrings, overlay, ref newIndex);
        }
예제 #2
0
        public void PerkStringHandler(
            IMutagenReadStream stream,
            MajorRecordHeader major,
            BinaryFileProcessor.ConfigConstructor instr,
            List <KeyValuePair <uint, uint> > processedStrings,
            IStringsLookup overlay,
            ref uint newIndex)
        {
            var  majorCompletePos = stream.Position + major.ContentLength;
            long?lastepft         = null;

            while (stream.Position < majorCompletePos)
            {
                var sub = stream.GetSubrecord();
                switch (sub.RecordTypeInt)
                {
                case RecordTypeInts.FULL:
                case RecordTypeInts.EPF2:
                    AStringsAlignment.ProcessStringLink(stream, instr, processedStrings, overlay, ref newIndex);
                    break;

                case RecordTypeInts.EPFT:
                    lastepft = stream.Position;
                    break;

                case RecordTypeInts.EPFD:
                    var pos = stream.Position;
                    stream.Position = lastepft.Value;
                    var epftFrame = stream.ReadSubrecordFrame();
                    if (epftFrame.Content[0] == (byte)APerkEntryPointEffect.ParameterType.LString)
                    {
                        stream.Position = pos;
                        AStringsAlignment.ProcessStringLink(stream, instr, processedStrings, overlay, ref newIndex);
                    }
                    stream.Position = pos;
                    break;

                default:
                    break;
                }
                stream.Position += sub.TotalLength;
            }
        }