MainForm - Remove Extract main menu item

This commit is contained in:
miku-666
2024-03-30 01:09:12 +01:00
parent 526d7cfd86
commit 84afe15f8d
3 changed files with 520 additions and 846 deletions

View File

@@ -81,7 +81,6 @@
this.texturePackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mashUpPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.packSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fullBoxSupportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
@@ -472,7 +471,6 @@
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.extractToolStripMenuItem1,
this.packSettingsToolStripMenuItem,
this.saveToolStripMenuItem1,
this.saveToolStripMenuItem,
@@ -514,12 +512,6 @@
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// extractToolStripMenuItem1
//
resources.ApplyResources(this.extractToolStripMenuItem1, "extractToolStripMenuItem1");
this.extractToolStripMenuItem1.Name = "extractToolStripMenuItem1";
this.extractToolStripMenuItem1.Click += new System.EventHandler(this.extractToolStripMenuItem1_Click);
//
// packSettingsToolStripMenuItem
//
this.packSettingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -1127,7 +1119,6 @@
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem quickChangeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem extractToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem importSkinsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem importSkinToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;

View File

@@ -1436,60 +1436,6 @@ namespace PckStudio
e.CancelEdit = true;
}
private void extractToolStripMenuItem1_Click(object sender, EventArgs e)
{
try
{
//Extracts a chosen pck file to a chosen destincation
using OpenFileDialog ofd = new OpenFileDialog();
using FolderBrowserDialog sfd = new FolderBrowserDialog();
ofd.CheckFileExists = true;
ofd.Filter = "PCK (Minecraft Console Package)|*.pck";
if (ofd.ShowDialog() == DialogResult.OK && sfd.ShowDialog() == DialogResult.OK)
{
PckFile pckfile = null;
using (FileStream fs = File.OpenRead(ofd.FileName))
{
try
{
var reader = new PckFileReader(LittleEndianCheckBox.Checked
? OMI.Endianness.LittleEndian
: OMI.Endianness.BigEndian);
pckfile = reader.FromStream(fs);
}
catch (OverflowException ex)
{
Debug.WriteLine(ex.Message);
Trace.WriteLine("Failed to open " + ofd.FileName);
MessageBox.Show("Error", "Failed to open pck\nTry checking the 'Open/Save as Switch/Vita/PS4 pck' check box in the upper right corner.",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
foreach (PckFileData file in pckfile.GetFiles())
{
string filepath = $"{sfd.SelectedPath}/{file.Filename}";
FileInfo fileinfo = new FileInfo(filepath);
fileinfo.Directory.Create();
File.WriteAllBytes(filepath, file.Data); // writes data to file
//attempts to generate reimportable metadata file out of minefiles metadata
string metaData = "";
foreach (KeyValuePair<string, string> entry in file.GetProperties())
{
metaData += $"{entry.Key}: {entry.Value}{Environment.NewLine}";
}
File.WriteAllText(sfd.SelectedPath + @"\" + file.Filename + ".txt", metaData);
}
}
}
catch (Exception)
{
MessageBox.Show("An Error occured while extracting data");
}
}
public string GetDataPath()
{
return Path.Combine(Path.GetDirectoryName(saveLocation), "Data");

File diff suppressed because it is too large Load Diff