private void TV_BatchFiles_DragDrop(object sender, DragEventArgs e) { TV_BatchFiles.BeginUpdate(); string[] FileNames = e.Data.GetData(DataFormats.FileDrop, false) as string[]; if (CKB_FolderPak.Checked) { List <string> SingleFiles = new List <string>(); foreach (string FileName in FileNames) { if (IsDirectory(FileName)) { PakBatch Batch = new PakBatch(new string[] { FileName }); TreeNode Node = new TreeNode(Batch.BatchNodeText); Node.Tag = Batch; foreach (string SubDirFileName in Batch.Files) { Node.Nodes.Add(new TreeNode(SubDirFileName.Substring(Batch.CommonPath.Length))); } TV_BatchFiles.Nodes.Add(Node); } else { SingleFiles.Add(FileName); } } if (SingleFiles.Count > 0) { PakBatch Batch = new PakBatch(SingleFiles.ToArray()); TreeNode Node = new TreeNode(Batch.BatchNodeText); Node.Tag = Batch; TV_BatchFiles.Nodes.Add(Node); } } else { PakBatch Batch = new PakBatch(FileNames); TreeNode Node = new TreeNode(Batch.BatchNodeText); Node.Tag = Batch; foreach (string FileName in Batch.Files) { Node.Nodes.Add(new TreeNode(FileName.Substring(Batch.CommonPath.Length))); } TV_BatchFiles.Nodes.Add(Node); TV_BatchFiles.CollapseAll(); Node.Expand(); } TV_BatchFiles.EndUpdate(); }
private void BTN_BatchCreatePaks_Click(object sender, EventArgs e) { bBatchMode = true; ApplyConfigs(); if (!ValidateConfigs()) { return; } if (bContentOnly && !File.Exists(ProjectFilePath)) { MessageBox.Show("Project File does not exist (<Content Files Only> requires a valid uproject file)!", "Missing Project File"); return; } if (TV_BatchFiles.Nodes.Count == 0) { MessageBox.Show("Nothing to Pak!", "Nothing to Pak"); return; } if (!Directory.Exists(BatchOutputPath)) { MessageBox.Show("Output directory does not exist!"); return; } ShowLog("////////////////////// START BATCH PACKING //////////////////////"); BatchCount = BatchTotal = TV_BatchFiles.GetNodeCount(false); foreach (TreeNode Node in TV_BatchFiles.Nodes) { PakBatch Batch = Node.Tag as PakBatch; Batch.OutputPath = BatchOutputPath; if (Batch == null) { continue; } CreateSinglePak(Batch); } }