From d9ff1525a3e3da811e23eb5840d858399e53b5ac Mon Sep 17 00:00:00 2001 From: PhoenixARC Date: Sun, 31 Jan 2021 00:52:56 -0500 Subject: [PATCH] 4.5 - fixed issue involving opening Type 2 PCKs --- MinecraftUSkinEditor/Classes/FileData.cs | 6 +- MinecraftUSkinEditor/Classes/PCK.cs | 74 +-- MinecraftUSkinEditor/Forms/Form1.Designer.cs | 538 +++++++++---------- MinecraftUSkinEditor/Forms/Form1.cs | 18 +- MinecraftUSkinEditor/Forms/Form1.resx | 159 +----- 5 files changed, 302 insertions(+), 493 deletions(-) diff --git a/MinecraftUSkinEditor/Classes/FileData.cs b/MinecraftUSkinEditor/Classes/FileData.cs index 5dc130e7..fdc01763 100644 --- a/MinecraftUSkinEditor/Classes/FileData.cs +++ b/MinecraftUSkinEditor/Classes/FileData.cs @@ -73,15 +73,15 @@ namespace MinecraftUSkinEditor public int readByte() { - return b[p++] & 0xFF; + return b[p++] & 0xFF; } public byte[] readBytes(int length) { List list = new List(); for (int i = 0; i < length; i++) - { - list.Add((byte)readByte()); + { + list.Add((byte)readByte()); } return list.ToArray(); } diff --git a/MinecraftUSkinEditor/Classes/PCK.cs b/MinecraftUSkinEditor/Classes/PCK.cs index 26e5df01..0d1b1242 100644 --- a/MinecraftUSkinEditor/Classes/PCK.cs +++ b/MinecraftUSkinEditor/Classes/PCK.cs @@ -83,21 +83,7 @@ namespace MinecraftUSkinEditor string text = ""; try { - try - { text = readMineString(fileData); - } - catch - { - try - { - text = readMineStringVita(fileData); - } - catch - { - text = readMineStringVita2(fileData); - } - } } catch { @@ -119,9 +105,11 @@ namespace MinecraftUSkinEditor else if (itemCount < 3) { pckType = itemCount; - itemCount = fileData.readInt(); if (pckType == 1) + { Console.WriteLine("PckType1"); + itemCount = fileData.readInt(); + } if (pckType == 2) Console.WriteLine("PckType2"); } @@ -161,57 +149,51 @@ namespace MinecraftUSkinEditor private static void writeMinecraftString(FileOutput f, string str) { - byte[] d = Encoding.Unicode.GetBytes(str); - f.writeInt(d.Length / 2); - f.writeBytes(endianReverseUnicode(d)); + byte[] bytes = Encoding.Unicode.GetBytes(str); + f.writeInt(bytes.Length / 2); + f.writeBytes(PCK.endianReverseUnicode(bytes)); f.writeInt(0); } public byte[] Rebuild() { - FileOutput f = new FileOutput(); - f.Endian = Endianness.Big; - - f.writeInt(3); - f.writeInt(types.Count); - foreach (int type in types.Keys) + FileOutput fileOutput = new FileOutput(); + fileOutput.Endian = Endianness.Big; + fileOutput.writeInt(3); + fileOutput.writeInt(this.types.Count); + foreach (int num in this.types.Keys) { - f.writeInt(type); - writeMinecraftString(f, types[type]); + fileOutput.writeInt(num); + PCK.writeMinecraftString(fileOutput, this.types[num]); } - - f.writeInt(mineFiles.Count); - foreach (MineFile mf in mineFiles) + fileOutput.writeInt(this.mineFiles.Count); + foreach (PCK.MineFile mineFile in this.mineFiles) { - f.writeInt(mf.data.Length); - f.writeInt(mf.type); - writeMinecraftString(f, mf.name); + fileOutput.writeInt(mineFile.data.Length); + fileOutput.writeInt(mineFile.type); + PCK.writeMinecraftString(fileOutput, mineFile.name); } - - foreach (MineFile mf in mineFiles) + foreach (PCK.MineFile mineFile2 in this.mineFiles) { - string missing = ""; + string str = ""; try { - f.writeInt(mf.entries.Count); - foreach (object[] entry in mf.entries) + fileOutput.writeInt(mineFile2.entries.Count); + foreach (object[] array in mineFile2.entries) { - missing = entry[0].ToString(); - f.writeInt(typeCodes[(string)entry[0]]); - writeMinecraftString(f, (string)entry[1]); + str = array[0].ToString(); + fileOutput.writeInt(this.typeCodes[(string)array[0]]); + PCK.writeMinecraftString(fileOutput, (string)array[1]); } - - f.writeBytes(mf.data); + fileOutput.writeBytes(mineFile2.data); } catch (Exception) { - MessageBox.Show(missing + " is not in the main metadatabase"); + MessageBox.Show(str + " is not in the main metadatabase"); break; } } - - - return f.getBytes(); + return fileOutput.getBytes(); } } } diff --git a/MinecraftUSkinEditor/Forms/Form1.Designer.cs b/MinecraftUSkinEditor/Forms/Form1.Designer.cs index 0b5a3ec6..44e52777 100644 --- a/MinecraftUSkinEditor/Forms/Form1.Designer.cs +++ b/MinecraftUSkinEditor/Forms/Form1.Designer.cs @@ -90,26 +90,17 @@ this.directorySearcher1 = new System.DirectoryServices.DirectorySearcher(); this.openedPCKS = new MetroFramework.Controls.MetroTabControl(); this.tabPage1 = new MetroFramework.Controls.MetroTabPage(); - this.myTablePanelPckEdit = new minekampf.Forms.MyTablePanel(); - this.treeViewMain = new System.Windows.Forms.TreeView(); - this.pictureBoxImagePreview = new MinecraftUSkinEditor.PictureBoxWithInterpolationMode(); - this.labelAmount = new System.Windows.Forms.Label(); - this.tabDataDisplay = new System.Windows.Forms.TabControl(); - this.tabMetaDisplay = new System.Windows.Forms.TabPage(); - this.myTablePanel1 = new minekampf.Forms.MyTablePanel(); - this.treeMeta = new System.Windows.Forms.TreeView(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.label2 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.labelEntryType = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.labelEntryData = new System.Windows.Forms.Label(); - this.buttonEdit = new System.Windows.Forms.Button(); this.labelImageSize = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.DBGLabel = new System.Windows.Forms.Label(); this.metroTabControl1 = new MetroFramework.Controls.MetroTabControl(); this.metroTabPage1 = new MetroFramework.Controls.MetroTabPage(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.myTablePanelStartScreen = new minekampf.Forms.MyTablePanel(); + this.richTextBoxChangelog = new System.Windows.Forms.RichTextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.pckOpen = new System.Windows.Forms.PictureBox(); this.myTablePanel2 = new minekampf.Forms.MyTablePanel(); this.treeView1 = new System.Windows.Forms.TreeView(); this.pictureBoxWithInterpolationMode1 = new MinecraftUSkinEditor.PictureBoxWithInterpolationMode(); @@ -125,36 +116,41 @@ this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.radioButton1 = new System.Windows.Forms.RadioButton(); - this.radioButton2 = new System.Windows.Forms.RadioButton(); - this.radioButton3 = new System.Windows.Forms.RadioButton(); - this.radioButton4 = new System.Windows.Forms.RadioButton(); - this.myTablePanelStartScreen = new minekampf.Forms.MyTablePanel(); - this.richTextBoxChangelog = new System.Windows.Forms.RichTextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.pckOpen = new System.Windows.Forms.PictureBox(); + this.myTablePanelPckEdit = new minekampf.Forms.MyTablePanel(); + this.treeViewMain = new System.Windows.Forms.TreeView(); + this.pictureBoxImagePreview = new MinecraftUSkinEditor.PictureBoxWithInterpolationMode(); + this.labelAmount = new System.Windows.Forms.Label(); + this.tabDataDisplay = new System.Windows.Forms.TabControl(); + this.tabMetaDisplay = new System.Windows.Forms.TabPage(); + this.myTablePanel1 = new minekampf.Forms.MyTablePanel(); + this.treeMeta = new System.Windows.Forms.TreeView(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.labelEntryType = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.labelEntryData = new System.Windows.Forms.Label(); + this.buttonEdit = new System.Windows.Forms.Button(); this.contextMenuPCKEntries.SuspendLayout(); this.menuStrip.SuspendLayout(); this.contextMenuMetaTree.SuspendLayout(); this.openedPCKS.SuspendLayout(); this.tabPage1.SuspendLayout(); - this.myTablePanelPckEdit.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).BeginInit(); - this.tabDataDisplay.SuspendLayout(); - this.tabMetaDisplay.SuspendLayout(); - this.myTablePanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.metroTabControl1.SuspendLayout(); this.metroTabPage1.SuspendLayout(); + this.myTablePanelStartScreen.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).BeginInit(); this.myTablePanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWithInterpolationMode1)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.myTablePanel3.SuspendLayout(); - this.myTablePanelStartScreen.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).BeginInit(); + this.myTablePanelPckEdit.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).BeginInit(); + this.tabDataDisplay.SuspendLayout(); + this.tabMetaDisplay.SuspendLayout(); + this.myTablePanel1.SuspendLayout(); this.SuspendLayout(); // // contextMenuPCKEntries @@ -600,6 +596,216 @@ this.tabPage1.VerticalScrollbarHighlightOnWheel = false; this.tabPage1.VerticalScrollbarSize = 0; // + // labelImageSize + // + resources.ApplyResources(this.labelImageSize, "labelImageSize"); + this.labelImageSize.Name = "labelImageSize"; + // + // pictureBox2 + // + resources.ApplyResources(this.pictureBox2, "pictureBox2"); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.TabStop = false; + // + // DBGLabel + // + resources.ApplyResources(this.DBGLabel, "DBGLabel"); + this.DBGLabel.ForeColor = System.Drawing.Color.Red; + this.DBGLabel.Name = "DBGLabel"; + // + // metroTabControl1 + // + this.metroTabControl1.Controls.Add(this.metroTabPage1); + resources.ApplyResources(this.metroTabControl1, "metroTabControl1"); + this.metroTabControl1.Name = "metroTabControl1"; + this.metroTabControl1.SelectedIndex = 0; + this.metroTabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.metroTabControl1.Style = MetroFramework.MetroColorStyle.White; + this.metroTabControl1.Theme = MetroFramework.MetroThemeStyle.Dark; + this.metroTabControl1.UseSelectable = true; + // + // metroTabPage1 + // + this.metroTabPage1.BackColor = System.Drawing.Color.Transparent; + this.metroTabPage1.Controls.Add(this.myTablePanel2); + this.metroTabPage1.Controls.Add(this.label10); + this.metroTabPage1.Controls.Add(this.label11); + this.metroTabPage1.HorizontalScrollbarBarColor = true; + this.metroTabPage1.HorizontalScrollbarHighlightOnWheel = false; + this.metroTabPage1.HorizontalScrollbarSize = 0; + resources.ApplyResources(this.metroTabPage1, "metroTabPage1"); + this.metroTabPage1.Name = "metroTabPage1"; + this.metroTabPage1.Style = MetroFramework.MetroColorStyle.White; + this.metroTabPage1.Theme = MetroFramework.MetroThemeStyle.Dark; + this.metroTabPage1.VerticalScrollbarBarColor = true; + this.metroTabPage1.VerticalScrollbarHighlightOnWheel = false; + this.metroTabPage1.VerticalScrollbarSize = 0; + // + // label10 + // + resources.ApplyResources(this.label10, "label10"); + this.label10.Name = "label10"; + // + // label11 + // + resources.ApplyResources(this.label11, "label11"); + this.label11.Name = "label11"; + // + // myTablePanelStartScreen + // + resources.ApplyResources(this.myTablePanelStartScreen, "myTablePanelStartScreen"); + this.myTablePanelStartScreen.Controls.Add(this.richTextBoxChangelog, 1, 1); + this.myTablePanelStartScreen.Controls.Add(this.label5, 1, 0); + this.myTablePanelStartScreen.Controls.Add(this.pckOpen, 0, 0); + this.myTablePanelStartScreen.Name = "myTablePanelStartScreen"; + // + // richTextBoxChangelog + // + this.richTextBoxChangelog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(28)))), ((int)(((byte)(28))))); + this.richTextBoxChangelog.BorderStyle = System.Windows.Forms.BorderStyle.None; + resources.ApplyResources(this.richTextBoxChangelog, "richTextBoxChangelog"); + this.richTextBoxChangelog.ForeColor = System.Drawing.Color.White; + this.richTextBoxChangelog.Name = "richTextBoxChangelog"; + this.richTextBoxChangelog.ReadOnly = true; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.ForeColor = System.Drawing.Color.White; + this.label5.Name = "label5"; + // + // pckOpen + // + resources.ApplyResources(this.pckOpen, "pckOpen"); + this.pckOpen.Image = global::minekampf.Properties.Resources.pckClosed; + this.pckOpen.Name = "pckOpen"; + this.myTablePanelStartScreen.SetRowSpan(this.pckOpen, 2); + this.pckOpen.TabStop = false; + this.pckOpen.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + this.pckOpen.DragDrop += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragDrop); + this.pckOpen.DragEnter += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragEnter); + this.pckOpen.DragLeave += new System.EventHandler(this.OpenPck_DragLeave); + this.pckOpen.MouseEnter += new System.EventHandler(this.OpenPck_MouseEnter); + this.pckOpen.MouseLeave += new System.EventHandler(this.OpenPck_MouseLeave); + // + // myTablePanel2 + // + resources.ApplyResources(this.myTablePanel2, "myTablePanel2"); + this.myTablePanel2.Controls.Add(this.treeView1, 0, 0); + this.myTablePanel2.Controls.Add(this.pictureBoxWithInterpolationMode1, 1, 0); + this.myTablePanel2.Controls.Add(this.label4, 2, 0); + this.myTablePanel2.Controls.Add(this.tabControl1, 1, 4); + this.myTablePanel2.Name = "myTablePanel2"; + // + // treeView1 + // + this.treeView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.treeView1.ContextMenuStrip = this.contextMenuPCKEntries; + resources.ApplyResources(this.treeView1, "treeView1"); + this.treeView1.ForeColor = System.Drawing.Color.White; + this.treeView1.LabelEdit = true; + this.treeView1.Name = "treeView1"; + this.myTablePanel2.SetRowSpan(this.treeView1, 6); + // + // pictureBoxWithInterpolationMode1 + // + resources.ApplyResources(this.pictureBoxWithInterpolationMode1, "pictureBoxWithInterpolationMode1"); + this.pictureBoxWithInterpolationMode1.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default; + this.pictureBoxWithInterpolationMode1.Name = "pictureBoxWithInterpolationMode1"; + this.myTablePanel2.SetRowSpan(this.pictureBoxWithInterpolationMode1, 4); + this.pictureBoxWithInterpolationMode1.TabStop = false; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.ForeColor = System.Drawing.Color.White; + this.label4.Name = "label4"; + this.label4.UseCompatibleTextRendering = true; + // + // tabControl1 + // + this.myTablePanel2.SetColumnSpan(this.tabControl1, 2); + this.tabControl1.Controls.Add(this.tabPage2); + resources.ApplyResources(this.tabControl1, "tabControl1"); + this.tabControl1.Name = "tabControl1"; + this.myTablePanel2.SetRowSpan(this.tabControl1, 2); + this.tabControl1.SelectedIndex = 0; + // + // tabPage2 + // + this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); + this.tabPage2.Controls.Add(this.myTablePanel3); + resources.ApplyResources(this.tabPage2, "tabPage2"); + this.tabPage2.Name = "tabPage2"; + // + // myTablePanel3 + // + resources.ApplyResources(this.myTablePanel3, "myTablePanel3"); + this.myTablePanel3.Controls.Add(this.treeView2, 0, 0); + this.myTablePanel3.Controls.Add(this.comboBox2, 1, 1); + this.myTablePanel3.Controls.Add(this.label6, 1, 4); + this.myTablePanel3.Controls.Add(this.textBox2, 1, 3); + this.myTablePanel3.Controls.Add(this.label7, 1, 0); + this.myTablePanel3.Controls.Add(this.label8, 1, 5); + this.myTablePanel3.Controls.Add(this.label9, 1, 2); + this.myTablePanel3.Controls.Add(this.button1, 0, 6); + this.myTablePanel3.Name = "myTablePanel3"; + // + // treeView2 + // + this.treeView2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.treeView2.ContextMenuStrip = this.contextMenuMetaTree; + resources.ApplyResources(this.treeView2, "treeView2"); + this.treeView2.ForeColor = System.Drawing.Color.White; + this.treeView2.Name = "treeView2"; + this.myTablePanel3.SetRowSpan(this.treeView2, 6); + // + // comboBox2 + // + resources.ApplyResources(this.comboBox2, "comboBox2"); + this.comboBox2.BackColor = System.Drawing.Color.White; + this.comboBox2.FormattingEnabled = true; + this.comboBox2.Name = "comboBox2"; + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.ForeColor = System.Drawing.Color.White; + this.label6.Name = "label6"; + // + // textBox2 + // + resources.ApplyResources(this.textBox2, "textBox2"); + this.textBox2.BackColor = System.Drawing.Color.White; + this.textBox2.Name = "textBox2"; + // + // label7 + // + resources.ApplyResources(this.label7, "label7"); + this.label7.ForeColor = System.Drawing.Color.White; + this.label7.Name = "label7"; + // + // label8 + // + resources.ApplyResources(this.label8, "label8"); + this.label8.ForeColor = System.Drawing.Color.White; + this.label8.Name = "label8"; + // + // label9 + // + resources.ApplyResources(this.label9, "label9"); + this.label9.ForeColor = System.Drawing.Color.White; + this.label9.Name = "label9"; + // + // button1 + // + this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.myTablePanel3.SetColumnSpan(this.button1, 2); + resources.ApplyResources(this.button1, "button1"); + this.button1.ForeColor = System.Drawing.Color.White; + this.button1.Name = "button1"; + this.button1.UseVisualStyleBackColor = false; + // // myTablePanelPckEdit // resources.ApplyResources(this.myTablePanelPckEdit, "myTablePanelPckEdit"); @@ -726,255 +932,11 @@ this.buttonEdit.UseVisualStyleBackColor = false; this.buttonEdit.Click += new System.EventHandler(this.buttonEditModel_Click); // - // labelImageSize - // - resources.ApplyResources(this.labelImageSize, "labelImageSize"); - this.labelImageSize.Name = "labelImageSize"; - // - // pictureBox2 - // - resources.ApplyResources(this.pictureBox2, "pictureBox2"); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.TabStop = false; - // - // DBGLabel - // - resources.ApplyResources(this.DBGLabel, "DBGLabel"); - this.DBGLabel.ForeColor = System.Drawing.Color.Red; - this.DBGLabel.Name = "DBGLabel"; - // - // metroTabControl1 - // - this.metroTabControl1.Controls.Add(this.metroTabPage1); - resources.ApplyResources(this.metroTabControl1, "metroTabControl1"); - this.metroTabControl1.Name = "metroTabControl1"; - this.metroTabControl1.SelectedIndex = 0; - this.metroTabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; - this.metroTabControl1.Style = MetroFramework.MetroColorStyle.White; - this.metroTabControl1.Theme = MetroFramework.MetroThemeStyle.Dark; - this.metroTabControl1.UseSelectable = true; - // - // metroTabPage1 - // - this.metroTabPage1.BackColor = System.Drawing.Color.Transparent; - this.metroTabPage1.Controls.Add(this.myTablePanel2); - this.metroTabPage1.Controls.Add(this.label10); - this.metroTabPage1.Controls.Add(this.label11); - this.metroTabPage1.HorizontalScrollbarBarColor = true; - this.metroTabPage1.HorizontalScrollbarHighlightOnWheel = false; - this.metroTabPage1.HorizontalScrollbarSize = 0; - resources.ApplyResources(this.metroTabPage1, "metroTabPage1"); - this.metroTabPage1.Name = "metroTabPage1"; - this.metroTabPage1.Style = MetroFramework.MetroColorStyle.White; - this.metroTabPage1.Theme = MetroFramework.MetroThemeStyle.Dark; - this.metroTabPage1.VerticalScrollbarBarColor = true; - this.metroTabPage1.VerticalScrollbarHighlightOnWheel = false; - this.metroTabPage1.VerticalScrollbarSize = 0; - // - // myTablePanel2 - // - resources.ApplyResources(this.myTablePanel2, "myTablePanel2"); - this.myTablePanel2.Controls.Add(this.treeView1, 0, 0); - this.myTablePanel2.Controls.Add(this.pictureBoxWithInterpolationMode1, 1, 0); - this.myTablePanel2.Controls.Add(this.label4, 2, 0); - this.myTablePanel2.Controls.Add(this.tabControl1, 1, 4); - this.myTablePanel2.Name = "myTablePanel2"; - // - // treeView1 - // - this.treeView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.treeView1.ContextMenuStrip = this.contextMenuPCKEntries; - resources.ApplyResources(this.treeView1, "treeView1"); - this.treeView1.ForeColor = System.Drawing.Color.White; - this.treeView1.LabelEdit = true; - this.treeView1.Name = "treeView1"; - this.myTablePanel2.SetRowSpan(this.treeView1, 6); - // - // pictureBoxWithInterpolationMode1 - // - resources.ApplyResources(this.pictureBoxWithInterpolationMode1, "pictureBoxWithInterpolationMode1"); - this.pictureBoxWithInterpolationMode1.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default; - this.pictureBoxWithInterpolationMode1.Name = "pictureBoxWithInterpolationMode1"; - this.myTablePanel2.SetRowSpan(this.pictureBoxWithInterpolationMode1, 4); - this.pictureBoxWithInterpolationMode1.TabStop = false; - // - // label4 - // - resources.ApplyResources(this.label4, "label4"); - this.label4.ForeColor = System.Drawing.Color.White; - this.label4.Name = "label4"; - this.label4.UseCompatibleTextRendering = true; - // - // tabControl1 - // - this.myTablePanel2.SetColumnSpan(this.tabControl1, 2); - this.tabControl1.Controls.Add(this.tabPage2); - resources.ApplyResources(this.tabControl1, "tabControl1"); - this.tabControl1.Name = "tabControl1"; - this.myTablePanel2.SetRowSpan(this.tabControl1, 2); - this.tabControl1.SelectedIndex = 0; - // - // tabPage2 - // - this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.tabPage2.Controls.Add(this.myTablePanel3); - resources.ApplyResources(this.tabPage2, "tabPage2"); - this.tabPage2.Name = "tabPage2"; - // - // myTablePanel3 - // - resources.ApplyResources(this.myTablePanel3, "myTablePanel3"); - this.myTablePanel3.Controls.Add(this.treeView2, 0, 0); - this.myTablePanel3.Controls.Add(this.comboBox2, 1, 1); - this.myTablePanel3.Controls.Add(this.label6, 1, 4); - this.myTablePanel3.Controls.Add(this.textBox2, 1, 3); - this.myTablePanel3.Controls.Add(this.label7, 1, 0); - this.myTablePanel3.Controls.Add(this.label8, 1, 5); - this.myTablePanel3.Controls.Add(this.label9, 1, 2); - this.myTablePanel3.Controls.Add(this.button1, 0, 6); - this.myTablePanel3.Name = "myTablePanel3"; - // - // treeView2 - // - this.treeView2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.treeView2.ContextMenuStrip = this.contextMenuMetaTree; - resources.ApplyResources(this.treeView2, "treeView2"); - this.treeView2.ForeColor = System.Drawing.Color.White; - this.treeView2.Name = "treeView2"; - this.myTablePanel3.SetRowSpan(this.treeView2, 6); - // - // comboBox2 - // - resources.ApplyResources(this.comboBox2, "comboBox2"); - this.comboBox2.BackColor = System.Drawing.Color.White; - this.comboBox2.FormattingEnabled = true; - this.comboBox2.Name = "comboBox2"; - // - // label6 - // - resources.ApplyResources(this.label6, "label6"); - this.label6.ForeColor = System.Drawing.Color.White; - this.label6.Name = "label6"; - // - // textBox2 - // - resources.ApplyResources(this.textBox2, "textBox2"); - this.textBox2.BackColor = System.Drawing.Color.White; - this.textBox2.Name = "textBox2"; - // - // label7 - // - resources.ApplyResources(this.label7, "label7"); - this.label7.ForeColor = System.Drawing.Color.White; - this.label7.Name = "label7"; - // - // label8 - // - resources.ApplyResources(this.label8, "label8"); - this.label8.ForeColor = System.Drawing.Color.White; - this.label8.Name = "label8"; - // - // label9 - // - resources.ApplyResources(this.label9, "label9"); - this.label9.ForeColor = System.Drawing.Color.White; - this.label9.Name = "label9"; - // - // button1 - // - this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.myTablePanel3.SetColumnSpan(this.button1, 2); - resources.ApplyResources(this.button1, "button1"); - this.button1.ForeColor = System.Drawing.Color.White; - this.button1.Name = "button1"; - this.button1.UseVisualStyleBackColor = false; - // - // label10 - // - resources.ApplyResources(this.label10, "label10"); - this.label10.Name = "label10"; - // - // label11 - // - resources.ApplyResources(this.label11, "label11"); - this.label11.Name = "label11"; - // - // radioButton1 - // - resources.ApplyResources(this.radioButton1, "radioButton1"); - this.radioButton1.Checked = true; - this.radioButton1.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.radioButton1.Name = "radioButton1"; - this.radioButton1.TabStop = true; - this.radioButton1.UseVisualStyleBackColor = true; - // - // radioButton2 - // - resources.ApplyResources(this.radioButton2, "radioButton2"); - this.radioButton2.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.radioButton2.Name = "radioButton2"; - this.radioButton2.UseVisualStyleBackColor = true; - // - // radioButton3 - // - resources.ApplyResources(this.radioButton3, "radioButton3"); - this.radioButton3.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.radioButton3.Name = "radioButton3"; - this.radioButton3.UseVisualStyleBackColor = true; - // - // radioButton4 - // - resources.ApplyResources(this.radioButton4, "radioButton4"); - this.radioButton4.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.radioButton4.Name = "radioButton4"; - this.radioButton4.UseVisualStyleBackColor = true; - // - // myTablePanelStartScreen - // - resources.ApplyResources(this.myTablePanelStartScreen, "myTablePanelStartScreen"); - this.myTablePanelStartScreen.Controls.Add(this.richTextBoxChangelog, 1, 1); - this.myTablePanelStartScreen.Controls.Add(this.label5, 1, 0); - this.myTablePanelStartScreen.Controls.Add(this.pckOpen, 0, 0); - this.myTablePanelStartScreen.Name = "myTablePanelStartScreen"; - // - // richTextBoxChangelog - // - this.richTextBoxChangelog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(28)))), ((int)(((byte)(28))))); - this.richTextBoxChangelog.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.richTextBoxChangelog, "richTextBoxChangelog"); - this.richTextBoxChangelog.ForeColor = System.Drawing.Color.White; - this.richTextBoxChangelog.Name = "richTextBoxChangelog"; - this.richTextBoxChangelog.ReadOnly = true; - // - // label5 - // - resources.ApplyResources(this.label5, "label5"); - this.label5.ForeColor = System.Drawing.Color.White; - this.label5.Name = "label5"; - // - // pckOpen - // - resources.ApplyResources(this.pckOpen, "pckOpen"); - this.pckOpen.Image = global::minekampf.Properties.Resources.pckClosed; - this.pckOpen.Name = "pckOpen"; - this.myTablePanelStartScreen.SetRowSpan(this.pckOpen, 2); - this.pckOpen.TabStop = false; - this.pckOpen.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - this.pckOpen.DragDrop += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragDrop); - this.pckOpen.DragEnter += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragEnter); - this.pckOpen.DragLeave += new System.EventHandler(this.OpenPck_DragLeave); - this.pckOpen.MouseEnter += new System.EventHandler(this.OpenPck_MouseEnter); - this.pckOpen.MouseLeave += new System.EventHandler(this.OpenPck_MouseLeave); - // // FormMain // this.ApplyImageInvert = true; resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.radioButton4); - this.Controls.Add(this.radioButton3); - this.Controls.Add(this.radioButton2); - this.Controls.Add(this.radioButton1); this.Controls.Add(this.myTablePanelStartScreen); this.Controls.Add(this.metroTabControl1); this.Controls.Add(this.DBGLabel); @@ -996,17 +958,13 @@ this.openedPCKS.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); - this.myTablePanelPckEdit.ResumeLayout(false); - this.myTablePanelPckEdit.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).EndInit(); - this.tabDataDisplay.ResumeLayout(false); - this.tabMetaDisplay.ResumeLayout(false); - this.myTablePanel1.ResumeLayout(false); - this.myTablePanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.metroTabControl1.ResumeLayout(false); this.metroTabPage1.ResumeLayout(false); this.metroTabPage1.PerformLayout(); + this.myTablePanelStartScreen.ResumeLayout(false); + this.myTablePanelStartScreen.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).EndInit(); this.myTablePanel2.ResumeLayout(false); this.myTablePanel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWithInterpolationMode1)).EndInit(); @@ -1014,9 +972,13 @@ this.tabPage2.ResumeLayout(false); this.myTablePanel3.ResumeLayout(false); this.myTablePanel3.PerformLayout(); - this.myTablePanelStartScreen.ResumeLayout(false); - this.myTablePanelStartScreen.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).EndInit(); + this.myTablePanelPckEdit.ResumeLayout(false); + this.myTablePanelPckEdit.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).EndInit(); + this.tabDataDisplay.ResumeLayout(false); + this.tabMetaDisplay.ResumeLayout(false); + this.myTablePanel1.ResumeLayout(false); + this.myTablePanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -1121,10 +1083,6 @@ private System.Windows.Forms.ToolStripMenuItem PS3PCKInstallerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem administrativeToolsToolStripMenuItem; - public System.Windows.Forms.RadioButton radioButton1; - public System.Windows.Forms.RadioButton radioButton2; - public System.Windows.Forms.RadioButton radioButton3; - public System.Windows.Forms.RadioButton radioButton4; private System.Windows.Forms.ToolStripMenuItem uPDATEToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem VitaPCKInstallerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toNobledezJackToolStripMenuItem; diff --git a/MinecraftUSkinEditor/Forms/Form1.cs b/MinecraftUSkinEditor/Forms/Form1.cs index 0c1997cb..348df8d6 100644 --- a/MinecraftUSkinEditor/Forms/Form1.cs +++ b/MinecraftUSkinEditor/Forms/Form1.cs @@ -29,7 +29,7 @@ namespace MinecraftUSkinEditor #region Variables string saveLocation;//Save location for pck file int fileCount = 0;//variable for number of minefiles - string Version = "4.4";//template for program version + string Version = "4.5";//template for program version string hosturl = File.ReadAllText(Environment.CurrentDirectory + "\\settings.ini").Split(new[] { "\r\n", "\n" }, StringSplitOptions.None)[0]; @@ -101,16 +101,17 @@ namespace MinecraftUSkinEditor PCK pCK = (currentPCK = new PCK(filePath)); foreach (PCK.MineFile mineFile in pCK.mineFiles) { + Console.WriteLine(mineFile.name); if (!(mineFile.name == "0")) { continue; } foreach (object[] entry in mineFile.entries) { - if (entry[0].ToString() == "LOCK" && (new pckLocked(entry[1].ToString(), correct).ShowDialog() != DialogResult.OK || !correct)) - { - return; - } + //if (entry[0].ToString() == "LOCK" && (new pckLocked(entry[1].ToString(), correct).ShowDialog() != DialogResult.OK || !correct)) + //{ + // return; + //} } } openedPCKS.SelectedTab.Text = Path.GetFileName(filePath); @@ -1175,11 +1176,8 @@ namespace MinecraftUSkinEditor #region checks for updates private void Form1_Load(object sender, EventArgs e) { - try - { - minekampf.Classes.DiscordBot.sendDiscordWebhook("https://discordapp.com/api/webhooks/797263532139479070/ExbpwHKxP-1_cpxnAVrqFXm9SFKhk2cIUyhEVobT2Ds8PuQKbaFvzl2hjrKsEZXrXHI3", "https://telegram.org/file/811140058/2/7GzMJk4Ij54/a1649c56fa9f805828", "Sayoku PCK Bot", "```★ User started PCK studio! ★```"); - } - catch { } + if (isdebug == 1) + DBGLabel.Visible = true; //runs creator spotlight once per day //if (!File.Exists(appData + "date.txt")) //{ diff --git a/MinecraftUSkinEditor/Forms/Form1.resx b/MinecraftUSkinEditor/Forms/Form1.resx index fcc090a3..0eaa1b96 100644 --- a/MinecraftUSkinEditor/Forms/Form1.resx +++ b/MinecraftUSkinEditor/Forms/Form1.resx @@ -367,7 +367,7 @@ - 180, 22 + 114, 22 New @@ -381,7 +381,7 @@ - 180, 22 + 114, 22 Open @@ -395,7 +395,7 @@ - 180, 22 + 114, 22 Extract @@ -414,7 +414,7 @@ - 180, 22 + 114, 22 Save @@ -433,7 +433,7 @@ - 180, 22 + 114, 22 Save As @@ -452,7 +452,7 @@ - 180, 22 + 114, 22 Meta @@ -3751,7 +3751,7 @@ $this - 12 + 8 True @@ -3867,7 +3867,7 @@ $this - 11 + 7 463, 23 @@ -4525,7 +4525,7 @@ $this - 9 + 5 @@ -5211,7 +5211,7 @@ $this - 10 + 6 Bottom, Right @@ -5237,6 +5237,9 @@ DEVELOPER BUILD + + False + DBGLabel @@ -5247,7 +5250,7 @@ $this - 8 + 4 3 @@ -5926,140 +5929,8 @@ $this - 7 - - - True - - - NoControl - - - 7, 581 - - - 85, 17 - - - 20 - - - radioButton1 - - - False - - - radioButton1 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - True - - - NoControl - - - 98, 581 - - - 85, 17 - - - 21 - - - radioButton2 - - - False - - - radioButton2 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - True - - - NoControl - - - 189, 581 - - - 85, 17 - - - 22 - - - radioButton3 - - - False - - - radioButton3 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 3 - - True - - - NoControl - - - 280, 581 - - - 85, 17 - - - 23 - - - radioButton4 - - - False - - - radioButton4 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 2 @@ -6190,7 +6061,7 @@ $this - 6 + 2 <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="richTextBoxChangelog" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label5" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pckOpen" Row="0" RowSpan="2" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,57.96915,Percent,42.03085" /><Rows Styles="Absolute,70,Percent,100" /></TableLayoutSettings>