Exemplo n.º 1
0
        private void OpenFile(string fileName)
        {
            archive.OpenFile(fileName);

            toolStripStatusLabelCurrentFilename.Text = "File: " + fileName;
            Text = Path.GetFileName(fileName);
            Program.MainForm.SetToolStripItemName(this, Text);
            archive.UnsavedChanges = false;

            PopulateLayerTypeComboBox();

            saveToolStripMenuItem.Enabled             = true;
            saveAsToolStripMenuItem.Enabled           = true;
            hipHopToolExportToolStripMenuItem.Enabled = true;
            importHIPArchiveToolStripMenuItem.Enabled = true;
            tXDArchiveToolStripMenuItem.Enabled       = true;
            buttonAddLayer.Enabled = true;
            collapseLayersToolStripMenuItem.Enabled     = true;
            mergeSimilarAssetsToolStripMenuItem.Enabled = true;
            verifyArchiveToolStripMenuItem.Enabled      = true;
            applyScaleToolStripMenuItem.Enabled         = true;

            PopulateLayerComboBox();
            PopulateAssetList();
        }
Exemplo n.º 2
0
 private void AddFolder(string folderPath)
 {
     foreach (string s in Directory.GetFiles(folderPath))
     {
         if (Path.GetExtension(s).ToLower() == ".hip" || Path.GetExtension(s).ToLower() == ".hop")
         {
             ArchiveEditorFunctions archive = new ArchiveEditorFunctions();
             archive.OpenFile(s);
             WriteWhatIFound(archive);
             archive.Dispose();
         }
     }
     foreach (string s in Directory.GetDirectories(folderPath))
     {
         AddFolder(s);
     }
 }
Exemplo n.º 3
0
 private void AddFolder(string folderPath, ref Platform scoobyPlatform)
 {
     foreach (string s in Directory.GetFiles(folderPath))
     {
         if (Path.GetExtension(s).ToLower() == ".hip" || Path.GetExtension(s).ToLower() == ".hop")
         {
             ArchiveEditorFunctions archive = new ArchiveEditorFunctions();
             archive.OpenFile(s, false, scoobyPlatform, out _, true);
             if (scoobyPlatform == Platform.Unknown)
             {
                 scoobyPlatform = archive.platform;
             }
             WriteWhatIFound(archive);
             archive.Dispose(false);
         }
     }
     foreach (string s in Directory.GetDirectories(folderPath))
     {
         AddFolder(s, ref scoobyPlatform);
     }
 }
Exemplo n.º 4
0
        private void buttonPerform_Click(object sender, EventArgs e)
        {
            List <string> fileList = new List <string>();

            AddFolder(rootDir, ref fileList);

            progressBar1.Minimum = 0;
            progressBar1.Maximum = fileList.Count;
            progressBar1.Value   = 0;
            progressBar1.Step    = 1;

            Dictionary <(DynaType, int, int), int> dynas = new Dictionary <(DynaType, int, int), int>();

            foreach (string s in fileList)
            {
                progressBar1.PerformStep();

                ArchiveEditorFunctions archive = new ArchiveEditorFunctions();
                archive.OpenFile(s, false, Platform.Unknown, true);
                Check(archive, ref dynas);
                archive.Dispose(false);
            }

            List <string> output = new List <string>();

            foreach (var v in dynas.Keys)
            {
                output.Add($"{v.Item1.ToString()} - v{v.Item2} - {v.Item3} bytes - {dynas[v]} inst\n");
            }

            richTextBox1.Clear();
            foreach (var s in output.OrderBy(f => f))
            {
                richTextBox1.AppendText(s);
            }
        }