From 3348a8b24d55f143d5e54d559af70dffc69bb0f2 Mon Sep 17 00:00:00 2001 From: PhoenixARC Date: Sun, 31 Jan 2021 14:18:34 -0500 Subject: [PATCH] 4.6 update --- .../Forms/AddPCKPassword.Designer.cs | 81 +++ MinecraftUSkinEditor/Forms/AddPCKPassword.cs | 46 ++ .../Forms/AddPCKPassword.resx | 120 ++++ MinecraftUSkinEditor/Forms/Form1.Designer.cs | 531 +++++++++--------- MinecraftUSkinEditor/Forms/Form1.cs | 48 +- MinecraftUSkinEditor/Forms/Form1.resx | 36 +- .../Forms/addMeta.Designer.cs | 5 +- MinecraftUSkinEditor/Forms/addMeta.resx | 261 +++++---- .../Forms/pckLocked.Designer.cs | 14 +- MinecraftUSkinEditor/Forms/pckLocked.cs | 17 +- MinecraftUSkinEditor/Forms/pckLocked.resx | 144 ++--- .../MinecraftUSkinEditor.csproj | 9 + 12 files changed, 803 insertions(+), 509 deletions(-) create mode 100644 MinecraftUSkinEditor/Forms/AddPCKPassword.Designer.cs create mode 100644 MinecraftUSkinEditor/Forms/AddPCKPassword.cs create mode 100644 MinecraftUSkinEditor/Forms/AddPCKPassword.resx diff --git a/MinecraftUSkinEditor/Forms/AddPCKPassword.Designer.cs b/MinecraftUSkinEditor/Forms/AddPCKPassword.Designer.cs new file mode 100644 index 00000000..40a86e1f --- /dev/null +++ b/MinecraftUSkinEditor/Forms/AddPCKPassword.Designer.cs @@ -0,0 +1,81 @@ + +namespace minekampf.Forms +{ + partial class AddPCKPassword + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonUnlocked = new System.Windows.Forms.Button(); + this.textBoxPass = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // buttonUnlocked + // + this.buttonUnlocked.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonUnlocked.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonUnlocked.ForeColor = System.Drawing.Color.White; + this.buttonUnlocked.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonUnlocked.Location = new System.Drawing.Point(266, 53); + this.buttonUnlocked.Name = "buttonUnlocked"; + this.buttonUnlocked.Size = new System.Drawing.Size(75, 23); + this.buttonUnlocked.TabIndex = 3; + this.buttonUnlocked.Text = "Lock!"; + this.buttonUnlocked.UseVisualStyleBackColor = true; + this.buttonUnlocked.Click += new System.EventHandler(this.buttonUnlocked_Click); + // + // textBoxPass + // + this.textBoxPass.Location = new System.Drawing.Point(16, 55); + this.textBoxPass.Name = "textBoxPass"; + this.textBoxPass.Size = new System.Drawing.Size(244, 20); + this.textBoxPass.TabIndex = 2; + this.textBoxPass.Text = "Password"; + // + // AddPCKPassword + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(357, 129); + this.Controls.Add(this.buttonUnlocked); + this.Controls.Add(this.textBoxPass); + this.Name = "AddPCKPassword"; + this.Resizable = false; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Text = "Add Password"; + this.TextAlign = MetroFramework.Forms.MetroFormTextAlign.Center; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonUnlocked; + private System.Windows.Forms.TextBox textBoxPass; + } +} \ No newline at end of file diff --git a/MinecraftUSkinEditor/Forms/AddPCKPassword.cs b/MinecraftUSkinEditor/Forms/AddPCKPassword.cs new file mode 100644 index 00000000..cb499af1 --- /dev/null +++ b/MinecraftUSkinEditor/Forms/AddPCKPassword.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using MetroFramework.Forms; + +namespace minekampf.Forms +{ + public partial class AddPCKPassword : MetroForm + { + MinecraftUSkinEditor.PCK currentPCK; + MinecraftUSkinEditor.PCK.MineFile file; + public AddPCKPassword(MinecraftUSkinEditor.PCK.MineFile fileIn, MinecraftUSkinEditor.PCK currentPCKIn) + { + + InitializeComponent(); + file = fileIn; + currentPCK = currentPCKIn; + } + + private void buttonUnlocked_Click(object sender, EventArgs e) + { + object[] obj = { "LOCK", MD5(textBoxPass.Text) }; + file.entries.Add(obj); + this.Close(); + } + + public string MD5(string s) + { + using (var provider = System.Security.Cryptography.MD5.Create()) + { + StringBuilder builder = new StringBuilder(); + + foreach (byte b in provider.ComputeHash(Encoding.UTF8.GetBytes(s))) + builder.Append(b.ToString("x2").ToLower()); + + return builder.ToString(); + } + } + } +} diff --git a/MinecraftUSkinEditor/Forms/AddPCKPassword.resx b/MinecraftUSkinEditor/Forms/AddPCKPassword.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/MinecraftUSkinEditor/Forms/AddPCKPassword.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MinecraftUSkinEditor/Forms/Form1.Designer.cs b/MinecraftUSkinEditor/Forms/Form1.Designer.cs index 44e52777..4a13ecee 100644 --- a/MinecraftUSkinEditor/Forms/Form1.Designer.cs +++ b/MinecraftUSkinEditor/Forms/Form1.Designer.cs @@ -52,6 +52,7 @@ this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.metaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addPasswordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advancedMetaAddingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.convertToBedrockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -90,32 +91,6 @@ this.directorySearcher1 = new System.DirectoryServices.DirectorySearcher(); this.openedPCKS = new MetroFramework.Controls.MetroTabControl(); this.tabPage1 = new MetroFramework.Controls.MetroTabPage(); - 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(); - this.label4 = new System.Windows.Forms.Label(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.myTablePanel3 = new minekampf.Forms.MyTablePanel(); - this.treeView2 = new System.Windows.Forms.TreeView(); - this.comboBox2 = new System.Windows.Forms.ComboBox(); - this.label6 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); this.myTablePanelPckEdit = new minekampf.Forms.MyTablePanel(); this.treeViewMain = new System.Windows.Forms.TreeView(); this.pictureBoxImagePreview = new MinecraftUSkinEditor.PictureBoxWithInterpolationMode(); @@ -131,26 +106,52 @@ 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.myTablePanel2 = new minekampf.Forms.MyTablePanel(); + this.treeView1 = new System.Windows.Forms.TreeView(); + this.pictureBoxWithInterpolationMode1 = new MinecraftUSkinEditor.PictureBoxWithInterpolationMode(); + this.label4 = new System.Windows.Forms.Label(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.myTablePanel3 = new minekampf.Forms.MyTablePanel(); + this.treeView2 = new System.Windows.Forms.TreeView(); + this.comboBox2 = new System.Windows.Forms.ComboBox(); + this.label6 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + 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.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.contextMenuPCKEntries.SuspendLayout(); this.menuStrip.SuspendLayout(); this.contextMenuMetaTree.SuspendLayout(); this.openedPCKS.SuspendLayout(); this.tabPage1.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.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.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.SuspendLayout(); // // contextMenuPCKEntries @@ -272,7 +273,8 @@ this.extractToolStripMenuItem1, this.saveToolStripMenuItem1, this.saveToolStripMenuItem, - this.metaToolStripMenuItem}); + this.metaToolStripMenuItem, + this.addPasswordToolStripMenuItem}); this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); @@ -313,6 +315,12 @@ this.metaToolStripMenuItem.Name = "metaToolStripMenuItem"; this.metaToolStripMenuItem.Click += new System.EventHandler(this.metaToolStripMenuItem_Click); // + // addPasswordToolStripMenuItem + // + resources.ApplyResources(this.addPasswordToolStripMenuItem, "addPasswordToolStripMenuItem"); + this.addPasswordToolStripMenuItem.Name = "addPasswordToolStripMenuItem"; + this.addPasswordToolStripMenuItem.Click += new System.EventHandler(this.addPasswordToolStripMenuItem_Click); + // // editToolStripMenuItem // this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -596,216 +604,6 @@ 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"); @@ -932,6 +730,216 @@ 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"; + // + // 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; @@ -958,20 +966,6 @@ this.openedPCKS.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage1.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(); - this.tabControl1.ResumeLayout(false); - this.tabPage2.ResumeLayout(false); - this.myTablePanel3.ResumeLayout(false); - this.myTablePanel3.PerformLayout(); this.myTablePanelPckEdit.ResumeLayout(false); this.myTablePanelPckEdit.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).EndInit(); @@ -979,6 +973,20 @@ 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.myTablePanel2.ResumeLayout(false); + this.myTablePanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWithInterpolationMode1)).EndInit(); + this.tabControl1.ResumeLayout(false); + 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.ResumeLayout(false); this.PerformLayout(); @@ -1087,6 +1095,7 @@ private System.Windows.Forms.ToolStripMenuItem VitaPCKInstallerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toNobledezJackToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toPhoenixARCDeveloperToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addPasswordToolStripMenuItem; } } diff --git a/MinecraftUSkinEditor/Forms/Form1.cs b/MinecraftUSkinEditor/Forms/Form1.cs index 348df8d6..93ad01b5 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.5";//template for program version + string Version = "4.6";//template for program version string hosturl = File.ReadAllText(Environment.CurrentDirectory + "\\settings.ini").Split(new[] { "\r\n", "\n" }, StringSplitOptions.None)[0]; @@ -108,12 +108,16 @@ namespace MinecraftUSkinEditor } 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") + { + if((new pckLocked(entry[1].ToString(), correct).ShowDialog() != DialogResult.OK || !correct)) + { + return; + } + } } } + addPasswordToolStripMenuItem.Enabled = true; openedPCKS.SelectedTab.Text = Path.GetFileName(filePath); saveLocation = filePath; _ = treeViewMain; @@ -3241,6 +3245,40 @@ namespace MinecraftUSkinEditor { } + + private void addPasswordToolStripMenuItem_Click(object sender, EventArgs e) + { + treeViewMain.SelectedNode = treeViewMain.Nodes[0]; + mf = (PCK.MineFile)treeViewMain.Nodes[0].Tag;//Sets minefile to selected node + foreach (object[] entry in mf.entries) + { + if (entry[0].ToString() == "LOCK") + { + MessageBox.Show("Remove current LOCK before adding a new one!"); + return; + } + } + AddPCKPassword add = new AddPCKPassword(mf, currentPCK);//sets metadata adding dialog + add.ShowDialog();//displays metadata adding dialog + add.Dispose();//diposes generated metadata adding dialog data + + //Sets up combobox for metadata entries from main metadatabase + treeMeta.Nodes.Clear(); + foreach (int type in types.Keys) + comboBox1.Items.Add(types[type]); + + //loads all of selected minefiles metadata into metadata treeview + foreach (object[] entry in file.entries) + { + object[] strings = (object[])entry; TreeNode meta = new TreeNode(); + + foreach (object[] entryy in file.entries) + meta.Text = (string)strings[0]; + meta.Tag = entry; + treeMeta.Nodes.Add(meta); + } + saved = false; + } } } diff --git a/MinecraftUSkinEditor/Forms/Form1.resx b/MinecraftUSkinEditor/Forms/Form1.resx index 0eaa1b96..80678a84 100644 --- a/MinecraftUSkinEditor/Forms/Form1.resx +++ b/MinecraftUSkinEditor/Forms/Form1.resx @@ -367,7 +367,7 @@ - 114, 22 + 180, 22 New @@ -381,7 +381,7 @@ - 114, 22 + 180, 22 Open @@ -395,7 +395,7 @@ - 114, 22 + 180, 22 Extract @@ -414,7 +414,7 @@ - 114, 22 + 180, 22 Save @@ -433,7 +433,7 @@ - 114, 22 + 180, 22 Save As @@ -452,11 +452,29 @@ - 114, 22 + 180, 22 Meta + + False + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAACRSURBVFhH7Y45 + DoAwDATz/09DZWRF62utUIBHmgayk6xhaHBtvs5/HmBdor97/1roUEcaFGOkQTHGFpVg5WyaarB6PoSJ + MZsHPd7NgrZiCBqJWdBWDEEjMQvaiiFoJGZBW7EMM2Y2JjqWCVbPh+xBL1o5mwIFGWlQjJEGxRhbWCH9 + 3ft3DH3J0Yss5gHDF1jrBvn6/wGuM1ZgAAAAAElFTkSuQmCC + + + + 180, 22 + + + Add Password + 37, 20 @@ -7932,6 +7950,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + addPasswordToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + editToolStripMenuItem diff --git a/MinecraftUSkinEditor/Forms/addMeta.Designer.cs b/MinecraftUSkinEditor/Forms/addMeta.Designer.cs index 6d62d3e7..7d5b1f6f 100644 --- a/MinecraftUSkinEditor/Forms/addMeta.Designer.cs +++ b/MinecraftUSkinEditor/Forms/addMeta.Designer.cs @@ -38,14 +38,14 @@ // // textBox1 // - resources.ApplyResources(this.textBox1, "textBox1"); this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + resources.ApplyResources(this.textBox1, "textBox1"); this.textBox1.Name = "textBox1"; // // textBox2 // - resources.ApplyResources(this.textBox2, "textBox2"); this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + resources.ApplyResources(this.textBox2, "textBox2"); this.textBox2.Name = "textBox2"; // // label1 @@ -72,6 +72,7 @@ // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ControlBox = false; this.Controls.Add(this.button1); this.Controls.Add(this.label2); this.Controls.Add(this.label1); diff --git a/MinecraftUSkinEditor/Forms/addMeta.resx b/MinecraftUSkinEditor/Forms/addMeta.resx index f7875f68..994ed756 100644 --- a/MinecraftUSkinEditor/Forms/addMeta.resx +++ b/MinecraftUSkinEditor/Forms/addMeta.resx @@ -117,20 +117,141 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 + + + 60, 25 - - Value + + 193, 20 + + + + 0 + + + textBox1 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 60, 52 + + + 193, 20 + + + 1 + + + textBox2 System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + $this + + + 3 + + + True + + + 12, 28 + + + 31, 13 + + + 2 + + + Entry + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + True + + + 12, 55 + + + 34, 13 + + + 3 + + + Value + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + + Flat + + + 96, 78 + + + 75, 23 + + + 4 + + + Create + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + 6, 13 + + 264, 105 + AAABAAYAEBAAAAEAIABoBAAAZgAAACAgAAABACAAqBAAAM4EAAAwMAAAAQAgAKglAAB2FQAAQEAAAAEA @@ -2351,137 +2472,13 @@ vbLH9tge22N7bI/tsT22x/bYHttjC+3/B71iqRn22EDpAAAAAElFTkSuQmCC - - 12, 55 - - - 193, 20 - - - $this - - - Entry + + CenterParent addMeta - - $this - - - $this - - - 12, 28 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 193, 20 - - - - Flat - - - 264, 105 - - - 2 - - - CenterParent - - - 75, 23 - - - label1 - - - label2 - - - 0 - MetroFramework.Forms.MetroForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - - 60, 25 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - textBox2 - - - True - - - 34, 13 - - - 0 - - - Create - - - 31, 13 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3 - - - $this - - - 3 - - - 60, 52 - - - 4 - - - 4 - - - button1 - - - textBox1 - - - True - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 96, 78 - - - 1 - - - 1 - - - True - - - ja - \ No newline at end of file diff --git a/MinecraftUSkinEditor/Forms/pckLocked.Designer.cs b/MinecraftUSkinEditor/Forms/pckLocked.Designer.cs index 763d7048..2c9c7a81 100644 --- a/MinecraftUSkinEditor/Forms/pckLocked.Designer.cs +++ b/MinecraftUSkinEditor/Forms/pckLocked.Designer.cs @@ -31,7 +31,6 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(pckLocked)); this.textBoxPass = new System.Windows.Forms.TextBox(); this.buttonUnlocked = new System.Windows.Forms.Button(); - this.BypassButton = new System.Windows.Forms.Button(); this.SuspendLayout(); // // textBoxPass @@ -44,28 +43,18 @@ // // buttonUnlocked // - resources.ApplyResources(this.buttonUnlocked, "buttonUnlocked"); this.buttonUnlocked.DialogResult = System.Windows.Forms.DialogResult.OK; + resources.ApplyResources(this.buttonUnlocked, "buttonUnlocked"); this.buttonUnlocked.ForeColor = System.Drawing.Color.White; this.buttonUnlocked.Name = "buttonUnlocked"; this.buttonUnlocked.UseVisualStyleBackColor = true; this.buttonUnlocked.Click += new System.EventHandler(this.buttonUnlocked_Click); // - // BypassButton - // - resources.ApplyResources(this.BypassButton, "BypassButton"); - this.BypassButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.BypassButton.ForeColor = System.Drawing.Color.White; - this.BypassButton.Name = "BypassButton"; - this.BypassButton.UseVisualStyleBackColor = true; - this.BypassButton.Click += new System.EventHandler(this.BypassButton_Click); - // // pckLocked // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BorderStyle = MetroFramework.Forms.MetroFormBorderStyle.FixedSingle; - this.Controls.Add(this.BypassButton); this.Controls.Add(this.buttonUnlocked); this.Controls.Add(this.textBoxPass); this.MaximizeBox = false; @@ -85,6 +74,5 @@ private System.Windows.Forms.TextBox textBoxPass; private System.Windows.Forms.Button buttonUnlocked; - private System.Windows.Forms.Button BypassButton; } } \ No newline at end of file diff --git a/MinecraftUSkinEditor/Forms/pckLocked.cs b/MinecraftUSkinEditor/Forms/pckLocked.cs index 7a522745..14bd8a98 100644 --- a/MinecraftUSkinEditor/Forms/pckLocked.cs +++ b/MinecraftUSkinEditor/Forms/pckLocked.cs @@ -19,6 +19,7 @@ namespace minekampf.Forms { this.pass = pass; + InitializeComponent(); } @@ -28,7 +29,7 @@ namespace minekampf.Forms private void buttonUnlocked_Click(object sender, EventArgs e) { - if (textBoxPass.Text == pass) + if (MD5(textBoxPass.Text) == pass || MD5(textBoxPass.Text) == MD5(pass)) { FormMain.correct = true; this.Close(); @@ -48,9 +49,19 @@ namespace minekampf.Forms { } - private void BypassButton_Click(object sender, EventArgs e) + public string MD5(string s) { - FormMain.correct = true; + using (var provider = System.Security.Cryptography.MD5.Create()) + { + StringBuilder builder = new StringBuilder(); + + foreach (byte b in provider.ComputeHash(Encoding.UTF8.GetBytes(s))) + builder.Append(b.ToString("x2").ToLower()); + + return builder.ToString(); + } } + + } } diff --git a/MinecraftUSkinEditor/Forms/pckLocked.resx b/MinecraftUSkinEditor/Forms/pckLocked.resx index bca622a5..d2490c72 100644 --- a/MinecraftUSkinEditor/Forms/pckLocked.resx +++ b/MinecraftUSkinEditor/Forms/pckLocked.resx @@ -117,26 +117,68 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Flat + + + 23, 67 + + 244, 20 + + + + 0 + + + Password + + + textBoxPass + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + Flat - + + 273, 65 + + + 75, 23 + + 1 - + + Let me in! + + + buttonUnlocked + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + 6, 13 - - - 2 - - - 23, 67 + + 357, 129 @@ -1863,88 +1905,16 @@ AABJRU5ErkJggg== - - 0 - - - 75, 23 - - - MetroFramework.Forms.MetroForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - - - 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - 75, 23 - - - BypassButton - - - 1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 428, 129 - CenterParent - - Password - - - buttonUnlocked - - - 345, 65 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Let me in! - - - pckLocked - - - textBoxPass - - - $this - - - Bypass! - - - 264, 65 - This PCK is locked! - - 244, 20 + + pckLocked - - $this + + MetroFramework.Forms.MetroForm, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - - $this - - - True - - - ja - \ No newline at end of file diff --git a/MinecraftUSkinEditor/MinecraftUSkinEditor.csproj b/MinecraftUSkinEditor/MinecraftUSkinEditor.csproj index 41371c42..b8e5bcff 100644 --- a/MinecraftUSkinEditor/MinecraftUSkinEditor.csproj +++ b/MinecraftUSkinEditor/MinecraftUSkinEditor.csproj @@ -297,6 +297,12 @@ addnewskin.cs + + Form + + + AddPCKPassword.cs + Form @@ -472,6 +478,9 @@ addnewskin.cs + + AddPCKPassword.cs + AdvancedOptions.cs