public static Project GetProject(string projectPath) { if (projectPath.EndsWith("tf_yak0")) { return(Yakuza0Project.GetProject(projectPath)); } if (projectPath.EndsWith("tf_shm")) { return(ShenmueProject.GetProject(projectPath)); } if (projectPath.EndsWith("tf_sao_hf")) { return(SAOProject.GetProject(projectPath)); } if (projectPath.EndsWith("tf_srr")) { return(SRRProject.GetProject(projectPath)); } if (projectPath.EndsWith("tf_dsg")) { return(DisgaeaProject.GetProject(projectPath)); } if (projectPath.EndsWith("tf_btr")) { return(BattleRealmsProject.GetProject(projectPath)); } if (projectPath.EndsWith("tf_spf2")) { return(Spellforce2Project.GetProject(projectPath)); } if (projectPath.EndsWith("tf_jjm")) { return(JJMacfieldProject.GetProject(projectPath)); } if (projectPath.EndsWith("tf_nightcry")) { return(NightCryProject.GetProject(projectPath)); } throw new Exception(); }
private TFString ReadString(string str) { var value = new TFString { FileId = Id, Offset = 0, Visible = false }; if (!string.IsNullOrEmpty(str.TrimEnd('\0'))) { str = NightCryProject.ReadingReplacements(str); } value.Original = str; value.Translation = str; value.Visible = !string.IsNullOrWhiteSpace(str); return(value); }
private void WriteString(Stream s, TFString str, ExportOptions options) { var writeStr = str.Translation; if (str.Original.Equals(str.Translation)) { writeStr = NightCryProject.WritingReplacements(writeStr); s.WriteString(writeStr, Encoding); } else { if (options.CharReplacement != 0) { writeStr = Utils.ReplaceChars(writeStr, options.CharReplacementList); } writeStr = NightCryProject.WritingReplacements(writeStr); s.WriteString(writeStr, options.SelectedEncoding); } }