// //pack all files in current directory with psarctool private void packModToolStripMenuItem_Click(object sender, EventArgs e) { string path = getCurrentProjectRoot(); if (path == null) { return; } List <string> entriesAll = new List <string>(Directory.GetFileSystemEntries(path, "*", SearchOption.AllDirectories)); foreach (string entry in entriesAll.ToList()) { if (Properties.Settings.Default.pakEXML) { if (!entry.ToUpper().Contains(".EXML") && !entry.ToUpper().Contains(".MBIN") && !entry.ToUpper().Contains(".PC") && !entry.ToUpper().Contains(".BIN") && !entry.ToUpper().Contains(".TTC") && !entry.ToUpper().Contains(".TTF") && !entry.ToUpper().Contains(".DDS") && !entry.ToUpper().Contains(".FNT") && !entry.ToUpper().Contains(".H") && !entry.ToUpper().Contains(".GLSL") && !entry.ToUpper().Contains(".SQS") && !entry.ToUpper().Contains(".TXT") && !entry.ToUpper().Contains(".CSV") && !entry.ToUpper().Contains(".WEM") && !entry.ToUpper().Contains(".BNK") && !entry.ToUpper().Contains(".XML") && !entry.ToUpper().Contains(".JSON")) { entriesAll.Remove(entry); } } else { if (!entry.ToUpper().Contains(".MBIN") && !entry.ToUpper().Contains(".PC") && !entry.ToUpper().Contains(".BIN") && !entry.ToUpper().Contains(".TTC") && !entry.ToUpper().Contains(".TTF") && !entry.ToUpper().Contains(".DDS") && !entry.ToUpper().Contains(".FNT") && !entry.ToUpper().Contains(".H") && !entry.ToUpper().Contains(".GLSL") && !entry.ToUpper().Contains(".SQS") && !entry.ToUpper().Contains(".TXT") && !entry.ToUpper().Contains(".CSV") && !entry.ToUpper().Contains(".WEM") && !entry.ToUpper().Contains(".BNK") && !entry.ToUpper().Contains(".XML") && !entry.ToUpper().Contains(".JSON")) { entriesAll.Remove(entry); } } FileAttributes attr = File.GetAttributes(entry); if (attr.HasFlag(FileAttributes.Directory)) { entriesAll.Remove(entry); } } IList <string> entries = entriesAll as IList <string>; string pakName = showPakNamePrompt("Name your PAK File"); if (pakName != null && entries.Any()) { Functions.Create(entries, pakName, path); string project = getCurrentProjectRoot(); if (project != null) { project = project.Remove(project.LastIndexOf("\\")); List <KeyValuePair <string, string> > settings = ProjectSettings.getProjectSettings(project); if (settings[2].Value == "true") { string author = settings[0].Value; string modName = settings[1].Value; string versionControl = settings[2].Value; string version = settings[3].Value; if (File.Exists(project + "\\_" + author + "." + modName + "." + version + ".pak")) { if (version.Contains(".")) { string[] versionSplit = version.Split(new char[] { '.' }); string version1 = versionSplit[0]; string version2 = versionSplit[1]; int vers2 = Convert.ToInt16(version2) + 1; version = version1 + "." + vers2.ToString(); } else { version = "0.1"; } } ProjectSettings.saveProjectSettings(ProjectSettings.getProjectSettingsFile(project), author, modName, versionControl, version); } } //File.WriteAllLines(path + pakName + ".PAKFILES.txt", entries); listViewFill(path.Remove(path.LastIndexOf("\\")), listView2, textBox2); setStatus("Packed " + pakName); } else { setStatus("Nothing to pack!"); } }