コード例 #1
0
        public bool LoadCharaFile(BinaryReader br, bool noLoadPng = false, bool noLoadStatus = true)
        {
            bool flag = this.LoadFile(br, (int)Singleton <GameSystem> .Instance.language, noLoadPng, noLoadStatus);

            if (!this.skipRangeCheck)
            {
                Singleton <Character> .Instance.isMod = ChaFileControl.CheckDataRange((ChaFile)this, true, true, true, (List <string>)null);
            }
            return(flag);
        }
コード例 #2
0
 public bool LoadFromBytes(byte[] bytes, bool noSetPNG = false, bool noLoadStatus = true)
 {
     using (MemoryStream memoryStream = new MemoryStream())
     {
         memoryStream.Write(bytes, 0, bytes.Length);
         memoryStream.Seek(0L, SeekOrigin.Begin);
         bool flag = this.LoadCharaFile((Stream)memoryStream, noSetPNG, noLoadStatus);
         if (!this.skipRangeCheck)
         {
             Singleton <Character> .Instance.isMod = ChaFileControl.CheckDataRange((ChaFile)this, true, true, true, (List <string>)null);
         }
         return(flag);
     }
 }
コード例 #3
0
        public bool LoadFileLimited(
            string filename,
            byte sex        = 255,
            bool face       = true,
            bool body       = true,
            bool hair       = true,
            bool parameter  = true,
            bool coordinate = true)
        {
            string         path           = this.ConvertCharaFilePath(filename, sex, false);
            ChaFileControl chaFileControl = new ChaFileControl();

            if (chaFileControl.LoadFile(path, (int)Singleton <GameSystem> .Instance.language, false, true))
            {
                if (!this.skipRangeCheck)
                {
                    Singleton <Character> .Instance.isMod = ChaFileControl.CheckDataRange((ChaFile)chaFileControl, true, true, true, (List <string>)null);
                }
                if (face)
                {
                    this.custom.face = (ChaFileFace)MessagePackSerializer.Deserialize <ChaFileFace>(MessagePackSerializer.Serialize <ChaFileFace>((M0)chaFileControl.custom.face));
                }
                if (body)
                {
                    this.custom.body = (ChaFileBody)MessagePackSerializer.Deserialize <ChaFileBody>(MessagePackSerializer.Serialize <ChaFileBody>((M0)chaFileControl.custom.body));
                }
                if (hair)
                {
                    this.custom.hair = (ChaFileHair)MessagePackSerializer.Deserialize <ChaFileHair>(MessagePackSerializer.Serialize <ChaFileHair>((M0)chaFileControl.custom.hair));
                }
                if (parameter)
                {
                    this.parameter.Copy(chaFileControl.parameter);
                }
                if (coordinate)
                {
                    this.CopyCoordinate(chaFileControl.coordinate);
                }
                if (face && body && (hair && parameter) && coordinate)
                {
                    this.userID = chaFileControl.userID;
                    this.dataID = chaFileControl.dataID;
                }
            }
            return(false);
        }