From e6245d244004328e052c082a4623d52c8818e4e3 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 4 Jun 2022 22:18:37 +0200 Subject: [PATCH] Fix AudioEditor to work with new structure --- .../Utilities/Audio/AudioEditor.Designer.cs | 316 +++++++++--------- .../Forms/Utilities/Audio/AudioEditor.cs | 10 +- .../Forms/Utilities/Audio/AudioEditor.resx | 48 ++- 3 files changed, 194 insertions(+), 180 deletions(-) diff --git a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.Designer.cs b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.Designer.cs index c4c084b5..239a9982 100644 --- a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.Designer.cs +++ b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.Designer.cs @@ -29,171 +29,171 @@ namespace PckStudio.Forms.Utilities /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AudioEditor)); - this.treeView1 = new System.Windows.Forms.TreeView(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.treeView2 = new System.Windows.Forms.TreeView(); - this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); - this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuStrip1.SuspendLayout(); - this.menuStrip.SuspendLayout(); - this.contextMenuStrip2.SuspendLayout(); - this.SuspendLayout(); - // - // treeView1 - // - this.treeView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.treeView1.ContextMenuStrip = this.contextMenuStrip1; - this.treeView1.ForeColor = System.Drawing.Color.White; - this.treeView1.LabelEdit = true; - resources.ApplyResources(this.treeView1, "treeView1"); - this.treeView1.Name = "treeView1"; - this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AudioEditor)); + this.treeView1 = new System.Windows.Forms.TreeView(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.addCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.removeCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.treeView2 = new System.Windows.Forms.TreeView(); + this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.addEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.removeEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); + this.contextMenuStrip1.SuspendLayout(); + this.menuStrip.SuspendLayout(); + this.contextMenuStrip2.SuspendLayout(); + this.SuspendLayout(); + // + // treeView1 + // + resources.ApplyResources(this.treeView1, "treeView1"); + this.treeView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.treeView1.ContextMenuStrip = this.contextMenuStrip1; + this.treeView1.ForeColor = System.Drawing.Color.White; + this.treeView1.LabelEdit = true; + this.treeView1.Name = "treeView1"; + this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addCategoryStripMenuItem, this.removeCategoryStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); - // - // addCategoryStripMenuItem - // - resources.ApplyResources(this.addCategoryStripMenuItem, "addCategoryStripMenuItem"); - this.addCategoryStripMenuItem.Name = "addCategoryStripMenuItem"; - this.addCategoryStripMenuItem.Click += new System.EventHandler(this.addCategoryStripMenuItem_Click); - // - // removeCategoryStripMenuItem - // - this.removeCategoryStripMenuItem.Image = global::PckStudio.Properties.Resources.Del; - this.removeCategoryStripMenuItem.Name = "removeCategoryStripMenuItem"; - resources.ApplyResources(this.removeCategoryStripMenuItem, "removeCategoryStripMenuItem"); - this.removeCategoryStripMenuItem.Click += new System.EventHandler(this.removeCategoryStripMenuItem_Click); - // - // menuStrip - // - resources.ApplyResources(this.menuStrip, "menuStrip"); - this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contextMenuStrip1.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); + // + // addCategoryStripMenuItem + // + resources.ApplyResources(this.addCategoryStripMenuItem, "addCategoryStripMenuItem"); + this.addCategoryStripMenuItem.Name = "addCategoryStripMenuItem"; + this.addCategoryStripMenuItem.Click += new System.EventHandler(this.addCategoryStripMenuItem_Click); + // + // removeCategoryStripMenuItem + // + this.removeCategoryStripMenuItem.Image = global::PckStudio.Properties.Resources.Del; + this.removeCategoryStripMenuItem.Name = "removeCategoryStripMenuItem"; + resources.ApplyResources(this.removeCategoryStripMenuItem, "removeCategoryStripMenuItem"); + this.removeCategoryStripMenuItem.Click += new System.EventHandler(this.removeCategoryStripMenuItem_Click); + // + // menuStrip + // + resources.ApplyResources(this.menuStrip, "menuStrip"); + this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.helpToolStripMenuItem}); - this.menuStrip.Name = "menuStrip"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStrip.Name = "menuStrip"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.saveToolStripMenuItem1}); - this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); - // - // saveToolStripMenuItem1 - // - resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1"); - this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; - this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click); - // - // treeView2 - // - this.treeView2.AllowDrop = true; - this.treeView2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.treeView2.ContextMenuStrip = this.contextMenuStrip2; - this.treeView2.ForeColor = System.Drawing.Color.White; - resources.ApplyResources(this.treeView2, "treeView2"); - this.treeView2.Name = "treeView2"; - this.treeView2.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView2_AfterSelect); - this.treeView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.Binka_DragDrop); - this.treeView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeView2_DragEnter); - this.treeView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown); - // - // contextMenuStrip2 - // - this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); + // + // saveToolStripMenuItem1 + // + resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1"); + this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; + this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem"); + this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click); + // + // treeView2 + // + this.treeView2.AllowDrop = true; + resources.ApplyResources(this.treeView2, "treeView2"); + this.treeView2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.treeView2.ContextMenuStrip = this.contextMenuStrip2; + this.treeView2.ForeColor = System.Drawing.Color.White; + this.treeView2.Name = "treeView2"; + this.treeView2.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView2_AfterSelect); + this.treeView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.Binka_DragDrop); + this.treeView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeView2_DragEnter); + this.treeView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown); + // + // contextMenuStrip2 + // + this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addEntryMenuItem, this.removeEntryMenuItem}); - this.contextMenuStrip2.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuStrip2, "contextMenuStrip2"); - // - // addEntryMenuItem - // - resources.ApplyResources(this.addEntryMenuItem, "addEntryMenuItem"); - this.addEntryMenuItem.Name = "addEntryMenuItem"; - this.addEntryMenuItem.Click += new System.EventHandler(this.addEntryMenuItem_Click); - // - // removeEntryMenuItem - // - this.removeEntryMenuItem.Image = global::PckStudio.Properties.Resources.Del; - this.removeEntryMenuItem.Name = "removeEntryMenuItem"; - resources.ApplyResources(this.removeEntryMenuItem, "removeEntryMenuItem"); - this.removeEntryMenuItem.Click += new System.EventHandler(this.removeEntryMenuItem_Click); - // - // comboBox1 - // - this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox1.FormattingEnabled = true; - resources.ApplyResources(this.comboBox1, "comboBox1"); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); - // - // textBox1 - // - resources.ApplyResources(this.textBox1, "textBox1"); - this.textBox1.Name = "textBox1"; - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - // - // metroLabel2 - // - resources.ApplyResources(this.metroLabel2, "metroLabel2"); - this.metroLabel2.Name = "metroLabel2"; - this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark; - this.metroLabel2.Click += new System.EventHandler(this.metroLabel2_Click); - // - // metroLabel1 - // - resources.ApplyResources(this.metroLabel1, "metroLabel1"); - this.metroLabel1.Name = "metroLabel1"; - this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem"); - this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click); - // - // AudioEditor - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.metroLabel1); - this.Controls.Add(this.metroLabel2); - this.Controls.Add(this.treeView1); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.treeView2); - this.Controls.Add(this.menuStrip); - this.Name = "AudioEditor"; - this.Style = MetroFramework.MetroColorStyle.Silver; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.contextMenuStrip1.ResumeLayout(false); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.contextMenuStrip2.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.contextMenuStrip2.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuStrip2, "contextMenuStrip2"); + // + // addEntryMenuItem + // + resources.ApplyResources(this.addEntryMenuItem, "addEntryMenuItem"); + this.addEntryMenuItem.Name = "addEntryMenuItem"; + this.addEntryMenuItem.Click += new System.EventHandler(this.addEntryMenuItem_Click); + // + // removeEntryMenuItem + // + this.removeEntryMenuItem.Image = global::PckStudio.Properties.Resources.Del; + this.removeEntryMenuItem.Name = "removeEntryMenuItem"; + resources.ApplyResources(this.removeEntryMenuItem, "removeEntryMenuItem"); + this.removeEntryMenuItem.Click += new System.EventHandler(this.removeEntryMenuItem_Click); + // + // comboBox1 + // + resources.ApplyResources(this.comboBox1, "comboBox1"); + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Name = "comboBox1"; + this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); + // + // textBox1 + // + resources.ApplyResources(this.textBox1, "textBox1"); + this.textBox1.Name = "textBox1"; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + // + // metroLabel2 + // + resources.ApplyResources(this.metroLabel2, "metroLabel2"); + this.metroLabel2.Name = "metroLabel2"; + this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark; + this.metroLabel2.Click += new System.EventHandler(this.metroLabel2_Click); + // + // metroLabel1 + // + resources.ApplyResources(this.metroLabel1, "metroLabel1"); + this.metroLabel1.Name = "metroLabel1"; + this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // AudioEditor + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.metroLabel1); + this.Controls.Add(this.metroLabel2); + this.Controls.Add(this.treeView1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.treeView2); + this.Controls.Add(this.menuStrip); + this.Name = "AudioEditor"; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.contextMenuStrip1.ResumeLayout(false); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.contextMenuStrip2.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs index d3b79caa..d815b276 100644 --- a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs +++ b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.cs @@ -133,17 +133,13 @@ namespace PckStudio.Forms.Utilities { comboBox1.Items.Clear(); //Resets metadata combobox of selectable entry names if (e.Node.Tag == null) return; - var strings = (KeyValuePair)e.Node.Tag; - //string type = audioPCK.meta_data[0]; - //defaultType = type; - //type = strings.Key; - string value = strings.Value; + var strings = (Tuple)e.Node.Tag; foreach (var metaType in audioPCK.meta_data) comboBox1.Items.Add(metaType.Key); - comboBox1.Text = "TODO";//Sets currently selected metadata type to type selected in selected metadata node - textBox1.Text = value;//Sets currently selected metadata value to value selected in selected metadata node + comboBox1.Text = strings.Item1;//Sets currently selected metadata type to type selected in selected metadata node + textBox1.Text = strings.Item2;//Sets currently selected metadata value to value selected in selected metadata node } private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) diff --git a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.resx b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.resx index dcf72ac8..16146c71 100644 --- a/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.resx +++ b/MinecraftUSkinEditor/Forms/Utilities/Audio/AudioEditor.resx @@ -117,6 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Top, Bottom, Left + 127, 8 @@ -133,7 +137,6 @@ 20, 84 - 0, 0, 0, 0 @@ -218,7 +221,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8 + vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8 QLt++3yTGbf/Fm599P/Nh49wfPXxq/+rTt37f+Dak/8gOSBgAGEMANIMxGBFyAasPf/0v8GE8//z1t8C y4HU4DIALIluwLpLL+HiMANAGKoNAWASCavv/n/57gPcgOvP3oENOXj7NViOoAFGU6791+k4ghWD5Aga QCyGakMAkODcU89R/I8Ng9TgNADk14dPn/8/c+kqVgySgwUqVBsCwAx49urN/zsPHmPFIDmaGvAXJInN @@ -226,11 +229,20 @@ - 180, 22 + 98, 22 Save + + 44, 20 + + + Help + + + Top, Bottom + 282, 8 @@ -284,6 +296,9 @@ Remove Entry + + Top, Right + 290, 155 @@ -305,6 +320,9 @@ 6 + + Top, Right + 290, 209 @@ -326,6 +344,9 @@ 5 + + Top, Right + True @@ -353,6 +374,9 @@ 3 + + Top, Right + True @@ -380,12 +404,6 @@ 2 - - 44, 20 - - - Help - True @@ -425,6 +443,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + helpToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + addEntryMenuItem @@ -437,12 +461,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - helpToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - AudioEditor