// Token: 0x06000023 RID: 35 RVA: 0x00003E14 File Offset: 0x00002014 public static string GetRace(int raceid) { string key; switch (raceid) { case 0: key = "race_human"; break; case 1: key = "race_newman"; break; case 2: key = "race_cast"; break; case 3: key = "race_dewman"; break; default: key = "err_unk"; break; } return(AppText.GetText(key)); }
// Token: 0x0600000D RID: 13 RVA: 0x00002748 File Offset: 0x00000948 public static void ParseCML(string cmlFile) { CMLparser.inFile = cmlFile; CMLparser.outFile = Path.GetFileNameWithoutExtension(CMLparser.inFile); CMLparser.LoadDictionariesFromInternal(); if (CMLparser.br != null) { CMLparser.br.Close(); } try { FileInfo fileInfo = new FileInfo(CMLparser.inFile); Console.WriteLine("File size: " + fileInfo.Length + Environment.NewLine); if (fileInfo.Length > 1048576L) { throw new Exception(); } CMLparser.br = new BinaryReader(new MemoryStream(File.ReadAllBytes(CMLparser.inFile))); } catch (IOException ex) { CMLparser.tb.Text = ex.Message + AppText.GetText("err_file_notfound"); return; } catch (ArgumentException ex2) { CMLparser.tb.Text = ex2.Message + AppText.GetText("err_file_notfound"); return; } catch (UnauthorizedAccessException ex3) { CMLparser.tb.Text = ex3.Message; return; } catch (Exception ex4) { CMLparser.tb.Text = ex4.Message; return; } CMLparser.tb.Text = CMLparser.inFile; CMLparser.FindFileData(); CMLparser.GetBioData(); CMLparser.tb.AppendText(Environment.NewLine + string.Format(AppText.GetText("log_bioinfo"), AppText.GetRace(CMLparser.race), AppText.GetSex(CMLparser.sex))); CMLparser.GetFIGRData(); CMLparser.GetCOLRData(); CMLparser.GetSLCTData(); CMLparser.GetAccessoriesData(); if (CMLparser.outputParts) { CMLparser.outputPartsInfo(); } }
// Token: 0x0600001D RID: 29 RVA: 0x00003664 File Offset: 0x00001864 private static void outputPartsInfo() { string partkey = CMLparser.SLCTdata[0].ToString("D5"); string partkey2 = CMLparser.SLCTdata[0].ToString("D5"); string partkey3 = CMLparser.SLCTdata[0].ToString("D5"); string partkey4 = CMLparser.SLCTdata[14].ToString("D5"); string partkey5 = CMLparser.SLCTdata[15].ToString("D5"); string partkey6 = CMLparser.SLCTdata[17].ToString("D5"); string partkey7 = CMLparser.SLCTdata[18].ToString("D5"); string partkey8 = CMLparser.SLCTdata[1].ToString("D5"); string partkey9 = CMLparser.SLCTdata[19].ToString("D5"); string partkey10 = CMLparser.SLCTdata[2].ToString("D5"); string partkey11 = CMLparser.SLCTdata[3].ToString("D5"); string partkey12 = CMLparser.SLCTdata[3].ToString("D5"); string partkey13 = CMLparser.SLCTdata[4].ToString("D5"); string partkey14 = CMLparser.SLCTdata[5].ToString("D5"); string partkey15 = CMLparser.SLCTdata[6].ToString("D5"); string partkey16 = CMLparser.SLCTdata[8].ToString("D5"); string partkey17 = CMLparser.SLCTdata[13].ToString("D5"); string partkey18 = CMLparser.SLCTdata[9].ToString("D5"); string partkey19 = CMLparser.SLCTdata[10].ToString("D5"); string partkey20 = CMLparser.SLCTdata[11].ToString("D5"); string partkey21 = CMLparser.SLCTdata[12].ToString("D5"); string partkey22 = CMLparser.SLCTdata[16].ToString("D5"); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_costume"), partkey, CMLparser.costumes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_outerwear"), partkey3, CMLparser.costumes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_part"), partkey2, CMLparser.bodyparts); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_legpart"), partkey4, CMLparser.legs); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_armpart"), partkey5, CMLparser.arms); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_basewear"), partkey6, CMLparser.basewears); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_innerwear"), partkey7, CMLparser.innerwears); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_bodypaint1"), partkey8, CMLparser.bodypaints); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_bodypaint2"), partkey9, CMLparser.bodypaints); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_sticker"), partkey10, CMLparser.stickers); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_right_eye"), partkey11, CMLparser.eyes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_eyes"), partkey12, CMLparser.eyes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_eyebrows"), partkey13, CMLparser.eyebrows); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_eyelash"), partkey14, CMLparser.eyelashes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_facetype"), partkey15, CMLparser.faces); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_makeup1"), partkey16, CMLparser.makeups); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_makeup2"), partkey17, CMLparser.makeups); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_hairstyle"), partkey18, CMLparser.hairstyles); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory1"), partkey19, CMLparser.accessories); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory2"), partkey20, CMLparser.accessories); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory3"), partkey21, CMLparser.accessories); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory4"), partkey22, CMLparser.accessories); }
// Token: 0x0600001E RID: 30 RVA: 0x00003A54 File Offset: 0x00001C54 private static void WriteOutPartInfo(string partname, string partkey, Dictionary <string, string> dictionary) { string text; if (dictionary.TryGetValue(partkey, out text)) { CMLparser.tb.AppendText(string.Concat(new string[] { Environment.NewLine, partname, " ", dictionary[partkey], "\t ID: ", partkey })); return; } CMLparser.tb.AppendText(Environment.NewLine + AppText.GetText("log_partinfo_unknown_name") + partname + partkey); }
// Token: 0x06000024 RID: 36 RVA: 0x00003E68 File Offset: 0x00002068 public static string GetSex(int sexid) { string key; if (sexid != 0) { if (sexid == 1) { key = "sex_female"; } else { key = "err_unk"; } } else { key = "sex_male"; } return(AppText.GetText(key)); }
// Token: 0x06000004 RID: 4 RVA: 0x0000211C File Offset: 0x0000031C private void button_MakeFile_Click(object sender, EventArgs e) { this.saveCCFileDialog.FileName = CMLparser.outFile + CMLparser.GetFileType(); if (this.saveCCFileDialog.ShowDialog() == DialogResult.OK) { Console.WriteLine(this.saveCCFileDialog.FileName); CMLparser.WriteFileData(this.saveCCFileDialog.FileName); if (this.CB_compressCCFile.Checked && CMLparser.latestWrittenFile != "") { try { Process.Start("CharacterCrypt.exe", string.Concat(new string[] { "encrypt \"", CMLparser.latestWrittenFile, "\" \"", CMLparser.latestWrittenFile, "\"" })); } catch (Win32Exception ex) { this.textbox_OutText.AppendText(Environment.NewLine + ex.Message + Environment.NewLine + AppText.GetText("err_characrypt_notfound")); } } } }
// Token: 0x0600000F RID: 15 RVA: 0x00002994 File Offset: 0x00000B94 public static void WriteFileData(string filename) { string fileType = CMLparser.GetFileType(); string str = Path.ChangeExtension(filename, null); if (CMLparser.FIGRdata == null || CMLparser.COLRdata == null || CMLparser.SLCTdata == null) { CMLparser.tb.AppendText(Environment.NewLine + AppText.GetText("err_file_couldnotsave_invalidcml")); CMLparser.latestWrittenFile = ""; return; } try { CMLparser.bw = new BinaryWriter(new FileStream(str + fileType, FileMode.Create)); } catch (IOException ex) { Console.WriteLine(ex.Message + AppText.GetText("err_file_couldnotsave_unknown")); return; } CMLparser.FIGRWriteOff = CMLparser.COLRPos - (CMLparser.FIGRPos + CMLparser.FIGRdata.Length * 4); CMLparser.COLRWriteOff = CMLparser.SLCTPos - (CMLparser.COLRPos + CMLparser.COLRdata.Length * 4); CMLparser.SLCTWriteOff = CMLparser.ACCPos - (CMLparser.SLCTPos + CMLparser.SLCTdata.Length * 4); byte[] buffer = new byte[CMLparser.FIGRWriteOff]; byte[] buffer2 = new byte[CMLparser.COLRWriteOff]; byte[] buffer3 = new byte[CMLparser.SLCTWriteOff]; int value = 6; int value2 = 732; int value3 = 0; CMLparser.bw.Write(value); CMLparser.bw.Write(value2); CMLparser.bw.Write(value3); CMLparser.bw.Write(value3); CMLparser.bw.Write(CMLparser.race); CMLparser.bw.Write(CMLparser.sex); CMLparser.bw.Write(value3); foreach (int value4 in CMLparser.FIGRdata) { CMLparser.bw.Write(value4); } CMLparser.bw.Write(buffer); foreach (int value5 in CMLparser.COLRdata) { CMLparser.bw.Write(value5); } CMLparser.bw.Write(buffer2); foreach (int value6 in CMLparser.SLCTdata) { CMLparser.bw.Write(value6); } CMLparser.bw.Write(buffer3); foreach (byte value7 in CMLparser.AccData) { CMLparser.bw.Write(value7); } foreach (byte value8 in CMLparser.endFileData) { CMLparser.bw.Write(value8); } CMLparser.bw.Close(); CMLparser.tb.AppendText(Environment.NewLine + string.Format(AppText.GetText("log_system_filesaved"), str + fileType)); CMLparser.latestWrittenFile = str + fileType; }