public static bool CheckDataRange( ChaFile chafile, bool chk_custom, bool chk_clothes, bool chk_parameter, List <string> checkInfo = null) { bool flag = false; if (chk_custom) { flag = flag | ChaFileControl.CheckDataRangeFace(chafile, checkInfo) | ChaFileControl.CheckDataRangeBody(chafile, checkInfo) | ChaFileControl.CheckDataRangeHair(chafile, checkInfo); } if (chk_clothes) { flag |= ChaFileControl.CheckDataRangeCoordinate(chafile, checkInfo); } if (chk_parameter) { flag |= ChaFileControl.CheckDataRangeParameter(chafile, checkInfo); } if (flag) { Debug.LogWarningFormat("【{0}】 範囲外!", new object[1] { (object)chafile.parameter.fullname }); } return(flag); }
public static bool CheckDataRangeHair(ChaFile chafile, List <string> checkInfo = null) { ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl; ChaFileHair hair = chafile.custom.hair; byte sex = chafile.parameter.sex; bool flag = false; if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.so_hair_b).ContainsKey(hair.parts[0].id)) { checkInfo?.Add(string.Format("【後ろ髪】値:{0}", (object)hair.parts[0].id)); flag = true; hair.parts[0].id = sex != (byte)0 ? 0 : 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.so_hair_f).ContainsKey(hair.parts[1].id)) { checkInfo?.Add(string.Format("【前髪】値:{0}", (object)hair.parts[1].id)); flag = true; hair.parts[1].id = sex != (byte)0 ? 1 : 2; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.so_hair_s).ContainsKey(hair.parts[2].id)) { checkInfo?.Add(string.Format("【横髪】値:{0}", (object)hair.parts[2].id)); flag = true; hair.parts[2].id = sex != (byte)0 ? 0 : 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.so_hair_o).ContainsKey(hair.parts[3].id)) { checkInfo?.Add(string.Format("【エクステ】値:{0}", (object)hair.parts[3].id)); flag = true; hair.parts[3].id = sex != (byte)0 ? 0 : 0; } return(flag); }
public void CopyAll( ChaFile _chafile, bool _custom = true, bool _coordinate = true, bool _parameter = true, bool _gameinfo = true, bool _status = true) { if (_custom) { this.CopyCustom(_chafile.custom); } if (_coordinate) { this.CopyCoordinate(_chafile.coordinate); } if (_parameter) { this.CopyParameter(_chafile.parameter); } if (_gameinfo) { this.CopyGameInfo(_chafile.gameinfo); } if (!_status) { return; } this.CopyStatus(_chafile.status); }
public static void CopyChaFile( ChaFile dst, ChaFile src, bool _custom = true, bool _coordinate = true, bool _parameter = true, bool _gameinfo = true, bool _status = true) { dst.CopyAll(src, _custom, _coordinate, _parameter, _gameinfo, _status); }
public static bool CheckDataRangeParameter(ChaFile chafile, List <string> checkInfo = null) { ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl; ChaFileParameter parameter = chafile.parameter; bool flag = false; if (parameter.sex == (byte)0) { return(false); } if (!Singleton <Manager.Voice> .Instance.voiceInfoDic.ContainsKey(parameter.personality)) { checkInfo?.Add(string.Format("【性格】値:{0}", (object)parameter.personality)); flag = true; parameter.personality = 0; } return(flag); }
public static bool CheckDataRangeCoordinate(ChaFile chafile, List <string> checkInfo = null) { return(ChaFileControl.CheckDataRangeCoordinate(chafile.coordinate, (int)chafile.parameter.sex, checkInfo)); }
public static bool CheckDataRangeFace(ChaFile chafile, List <string> checkInfo = null) { ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl; ChaFileFace face = chafile.custom.face; byte sex = chafile.parameter.sex; bool flag = false; for (int index = 0; index < face.shapeValueFace.Length; ++index) { if (!MathfEx.RangeEqualOn <float>(0.0f, face.shapeValueFace[index], 1f)) { checkInfo?.Add(string.Format("【{0}】値:{1}", (object)ChaFileDefine.cf_headshapename[index], (object)face.shapeValueFace[index])); flag = true; face.shapeValueFace[index] = Mathf.Clamp(face.shapeValueFace[index], 0.0f, 1f); } } if (face.shapeValueFace.Length > ChaFileDefine.cf_headshapename.Length) { float[] numArray = new float[ChaFileDefine.cf_headshapename.Length]; Array.Copy((Array)face.shapeValueFace, (Array)numArray, numArray.Length); face.shapeValueFace = new float[ChaFileDefine.cf_headshapename.Length]; Array.Copy((Array)numArray, (Array)face.shapeValueFace, numArray.Length); } if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.fo_head : ChaListDefine.CategoryNo.mo_head).ContainsKey(face.headId)) { checkInfo?.Add(string.Format("【頭の種類】値:{0}", (object)face.headId)); flag = true; face.headId = sex != (byte)0 ? 0 : 0; } if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_skin_f : ChaListDefine.CategoryNo.mt_skin_f).ContainsKey(face.skinId)) { checkInfo?.Add(string.Format("【肌の種類】値:{0}", (object)face.skinId)); flag = true; face.skinId = 0; } if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_detail_f : ChaListDefine.CategoryNo.mt_detail_f).ContainsKey(face.detailId)) { checkInfo?.Add(string.Format("【彫りの種類】値:{0}", (object)face.detailId)); flag = true; face.detailId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyebrow).ContainsKey(face.eyebrowId)) { checkInfo?.Add(string.Format("【眉毛の種類】値:{0}", (object)face.eyebrowId)); flag = true; face.eyebrowId = 0; } for (int index = 0; index < 2; ++index) { if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eye).ContainsKey(face.pupil[index].pupilId)) { checkInfo?.Add(string.Format("【瞳の種類】値:{0}", (object)face.pupil[index].pupilId)); flag = true; face.pupil[index].pupilId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyeblack).ContainsKey(face.pupil[index].blackId)) { checkInfo?.Add(string.Format("【黒目の種類】値:{0}", (object)face.pupil[index].blackId)); flag = true; face.pupil[index].blackId = 0; } } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eye_hl).ContainsKey(face.hlId)) { checkInfo?.Add(string.Format("【ハイライト種類】値:{0}", (object)face.hlId)); flag = true; face.hlId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyelash).ContainsKey(face.eyelashesId)) { checkInfo?.Add(string.Format("【睫毛の種類】値:{0}", (object)face.eyelashesId)); flag = true; face.eyelashesId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_mole).ContainsKey(face.moleId)) { checkInfo?.Add(string.Format("【ホクロの種類】値:{0}", (object)face.moleId)); flag = true; face.moleId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_eyeshadow).ContainsKey(face.makeup.eyeshadowId)) { checkInfo?.Add(string.Format("【アイシャドウ種類】値:{0}", (object)face.makeup.eyeshadowId)); flag = true; face.makeup.eyeshadowId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_cheek).ContainsKey(face.makeup.cheekId)) { checkInfo?.Add(string.Format("【チークの種類】値:{0}", (object)face.makeup.cheekId)); flag = true; face.makeup.cheekId = 0; } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_lip).ContainsKey(face.makeup.lipId)) { checkInfo?.Add(string.Format("【リップの種類】値:{0}", (object)face.makeup.lipId)); flag = true; face.makeup.lipId = 0; } for (int index = 0; index < 2; ++index) { if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_paint).ContainsKey(face.makeup.paintInfo[index].id)) { checkInfo?.Add(string.Format("【ペイント種類】値:{0}", (object)face.makeup.paintInfo[index].id)); flag = true; face.makeup.paintInfo[index].id = 0; } } if (sex == (byte)0 && !chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.mt_beard).ContainsKey(face.beardId)) { checkInfo?.Add(string.Format("【ヒゲの種類】値:{0}", (object)face.beardId)); flag = true; face.beardId = 0; } return(flag); }
public static bool CheckDataRangeBody(ChaFile chafile, List <string> checkInfo = null) { ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl; ChaFileBody body = chafile.custom.body; byte sex = chafile.parameter.sex; bool flag = false; for (int index = 0; index < body.shapeValueBody.Length; ++index) { if (!MathfEx.RangeEqualOn <float>(0.0f, body.shapeValueBody[index], 1f)) { checkInfo?.Add(string.Format("【{0}】値:{1}", (object)ChaFileDefine.cf_bodyshapename[index], (object)body.shapeValueBody[index])); flag = true; body.shapeValueBody[index] = Mathf.Clamp(body.shapeValueBody[index], 0.0f, 1f); } } if (!MathfEx.RangeEqualOn <float>(0.0f, body.bustSoftness, 1f)) { checkInfo?.Add(string.Format("【胸の柔らかさ】値:{0}", (object)body.bustSoftness)); flag = true; body.bustSoftness = Mathf.Clamp(body.bustSoftness, 0.0f, 1f); } if (!MathfEx.RangeEqualOn <float>(0.0f, body.bustWeight, 1f)) { checkInfo?.Add(string.Format("【胸の重さ】値:{0}", (object)body.bustWeight)); flag = true; body.bustWeight = Mathf.Clamp(body.bustWeight, 0.0f, 1f); } if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_skin_b : ChaListDefine.CategoryNo.mt_skin_b).ContainsKey(body.skinId)) { checkInfo?.Add(string.Format("【肌の種類】値:{0}", (object)body.skinId)); flag = true; body.skinId = 0; } if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_detail_b : ChaListDefine.CategoryNo.mt_detail_b).ContainsKey(body.detailId)) { checkInfo?.Add(string.Format("【筋肉の種類】値:{0}", (object)body.detailId)); flag = true; body.detailId = 0; } if (!chaListCtrl.GetCategoryInfo(sex != (byte)0 ? ChaListDefine.CategoryNo.ft_sunburn : ChaListDefine.CategoryNo.mt_sunburn).ContainsKey(body.sunburnId)) { checkInfo?.Add(string.Format("【日焼けの種類】値:{0}", (object)body.sunburnId)); flag = true; body.sunburnId = 0; } for (int index = 0; index < 2; ++index) { if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_paint).ContainsKey(body.paintInfo[index].id)) { checkInfo?.Add(string.Format("【ペイントの種類】値:{0}", (object)body.paintInfo[index].id)); flag = true; body.paintInfo[index].id = 0; } } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_nip).ContainsKey(body.nipId)) { checkInfo?.Add(string.Format("【乳首の種類】値:{0}", (object)body.nipId)); flag = true; body.nipId = 0; } if (!MathfEx.RangeEqualOn <float>(0.0f, body.areolaSize, 1f)) { checkInfo?.Add(string.Format("【乳輪のサイズ】値:{0}", (object)body.areolaSize)); flag = true; body.areolaSize = Mathf.Clamp(body.areolaSize, 0.0f, 1f); } if (!chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_underhair).ContainsKey(body.underhairId)) { checkInfo?.Add(string.Format("【アンダーヘア種類】値:{0}", (object)body.underhairId)); flag = true; body.underhairId = 0; } return(flag); }
public void CopyStatus(ChaFileStatus _status) { this.SetStatusBytes(ChaFile.GetStatusBytes(_status)); }
public void CopyGameInfo(ChaFileGameInfo _gameinfo) { this.SetGameInfoBytes(ChaFile.GetGameInfoBytes(_gameinfo)); }
public byte[] GetCoordinateBytes() { return(ChaFile.GetCoordinateBytes(this.coordinate)); }
public void CopyCoordinate(ChaFileCoordinate _coordinate) { this.SetCoordinateBytes(ChaFile.GetCoordinateBytes(_coordinate), ChaFileDefine.ChaFileCoordinateVersion); }
public void CopyCustom(ChaFileCustom _custom) { this.SetCustomBytes(ChaFile.GetCustomBytes(_custom), ChaFileDefine.ChaFileCustomVersion); }
public byte[] GetStatusBytes() { return(ChaFile.GetStatusBytes(this.status)); }
public byte[] GetGameInfoBytes() { return(ChaFile.GetGameInfoBytes(this.gameinfo)); }
public byte[] GetParameterBytes() { return(ChaFile.GetParameterBytes(this.parameter)); }
public void CopyParameter(ChaFileParameter _parameter) { this.SetParameterBytes(ChaFile.GetParameterBytes(_parameter)); }
public byte[] GetCustomBytes() { return(ChaFile.GetCustomBytes(this.custom)); }