diff --git a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs index a6055d5d..61e2e1f7 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs @@ -28,59 +28,36 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvancedOptions)); this.treeMeta = new System.Windows.Forms.TreeView(); - this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.comboBox1 = new MetroFramework.Controls.MetroComboBox(); this.label1 = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); + this.applyButton = new MetroFramework.Controls.MetroButton(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.comboBox2 = new System.Windows.Forms.ComboBox(); - this.contextMenuStrip2.SuspendLayout(); + this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox(); + this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox(); this.SuspendLayout(); // // treeMeta // - this.treeMeta.ContextMenuStrip = this.contextMenuStrip2; resources.ApplyResources(this.treeMeta, "treeMeta"); this.treeMeta.Name = "treeMeta"; this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect); // - // contextMenuStrip2 - // - this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addEntryToolStripMenuItem, - this.deleteEntryToolStripMenuItem}); - this.contextMenuStrip2.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuStrip2, "contextMenuStrip2"); - // - // addEntryToolStripMenuItem - // - resources.ApplyResources(this.addEntryToolStripMenuItem, "addEntryToolStripMenuItem"); - this.addEntryToolStripMenuItem.Name = "addEntryToolStripMenuItem"; - this.addEntryToolStripMenuItem.Click += new System.EventHandler(this.addEntryToolStripMenuItem_Click); - // - // deleteEntryToolStripMenuItem - // - resources.ApplyResources(this.deleteEntryToolStripMenuItem, "deleteEntryToolStripMenuItem"); - this.deleteEntryToolStripMenuItem.Name = "deleteEntryToolStripMenuItem"; - this.deleteEntryToolStripMenuItem.Click += new System.EventHandler(this.deleteEntryToolStripMenuItem_Click); - // // comboBox1 // this.comboBox1.FormattingEnabled = true; + resources.ApplyResources(this.comboBox1, "comboBox1"); this.comboBox1.Items.AddRange(new object[] { resources.GetString("comboBox1.Items"), resources.GetString("comboBox1.Items1"), resources.GetString("comboBox1.Items2"), resources.GetString("comboBox1.Items3")}); - resources.ApplyResources(this.comboBox1, "comboBox1"); this.comboBox1.Name = "comboBox1"; + this.comboBox1.Style = MetroFramework.MetroColorStyle.Silver; + this.comboBox1.Theme = MetroFramework.MetroThemeStyle.Dark; + this.comboBox1.UseSelectable = true; // // label1 // @@ -88,13 +65,15 @@ this.label1.ForeColor = System.Drawing.Color.White; this.label1.Name = "label1"; // - // button1 + // applyButton // - resources.ApplyResources(this.button1, "button1"); - this.button1.ForeColor = System.Drawing.Color.White; - this.button1.Name = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); + this.applyButton.ForeColor = System.Drawing.Color.White; + resources.ApplyResources(this.applyButton, "applyButton"); + this.applyButton.Name = "applyButton"; + this.applyButton.Style = MetroFramework.MetroColorStyle.Silver; + this.applyButton.Theme = MetroFramework.MetroThemeStyle.Dark; + this.applyButton.UseSelectable = true; + this.applyButton.Click += new System.EventHandler(this.applyButton_Click); // // label2 // @@ -108,38 +87,87 @@ this.label3.ForeColor = System.Drawing.Color.White; this.label3.Name = "label3"; // - // textBox1 + // entryDataTextBox // - this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - resources.ApplyResources(this.textBox1, "textBox1"); - this.textBox1.Name = "textBox1"; // - // comboBox2 // - this.comboBox2.FormattingEnabled = true; - resources.ApplyResources(this.comboBox2, "comboBox2"); - this.comboBox2.Name = "comboBox2"; + // + this.entryDataTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image"))); + this.entryDataTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location"))); + this.entryDataTextBox.CustomButton.Name = ""; + this.entryDataTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size"))); + this.entryDataTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.entryDataTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex"))); + this.entryDataTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.entryDataTextBox.CustomButton.UseSelectable = true; + this.entryDataTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible"))); + this.entryDataTextBox.Lines = new string[0]; + resources.ApplyResources(this.entryDataTextBox, "entryDataTextBox"); + this.entryDataTextBox.MaxLength = 32767; + this.entryDataTextBox.Name = "entryDataTextBox"; + this.entryDataTextBox.PasswordChar = '\0'; + this.entryDataTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.entryDataTextBox.SelectedText = ""; + this.entryDataTextBox.SelectionLength = 0; + this.entryDataTextBox.SelectionStart = 0; + this.entryDataTextBox.ShortcutsEnabled = true; + this.entryDataTextBox.Style = MetroFramework.MetroColorStyle.Silver; + this.entryDataTextBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.entryDataTextBox.UseSelectable = true; + this.entryDataTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.entryDataTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // entryTypeTextBox + // + // + // + // + this.entryTypeTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1"))); + this.entryTypeTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode"))); + this.entryTypeTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1"))); + this.entryTypeTextBox.CustomButton.Name = ""; + this.entryTypeTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1"))); + this.entryTypeTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.entryTypeTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1"))); + this.entryTypeTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.entryTypeTextBox.CustomButton.UseSelectable = true; + this.entryTypeTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1"))); + resources.ApplyResources(this.entryTypeTextBox, "entryTypeTextBox"); + this.entryTypeTextBox.Lines = new string[0]; + this.entryTypeTextBox.MaxLength = 32767; + this.entryTypeTextBox.Name = "entryTypeTextBox"; + this.entryTypeTextBox.PasswordChar = '\0'; + this.entryTypeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.entryTypeTextBox.SelectedText = ""; + this.entryTypeTextBox.SelectionLength = 0; + this.entryTypeTextBox.SelectionStart = 0; + this.entryTypeTextBox.ShortcutsEnabled = true; + this.entryTypeTextBox.Style = MetroFramework.MetroColorStyle.Silver; + this.entryTypeTextBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.entryTypeTextBox.UseSelectable = true; + this.entryTypeTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.entryTypeTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); // // AdvancedOptions // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.entryTypeTextBox); this.Controls.Add(this.label2); this.Controls.Add(this.label3); - this.Controls.Add(this.comboBox2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.button1); + this.Controls.Add(this.entryDataTextBox); + this.Controls.Add(this.applyButton); this.Controls.Add(this.label1); this.Controls.Add(this.comboBox1); this.Controls.Add(this.treeMeta); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "AdvancedOptions"; this.Resizable = false; this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; this.Style = MetroFramework.MetroColorStyle.Silver; this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.contextMenuStrip2.ResumeLayout(false); + this.TopMost = true; this.ResumeLayout(false); this.PerformLayout(); @@ -148,15 +176,12 @@ #endregion private System.Windows.Forms.TreeView treeMeta; - private System.Windows.Forms.ComboBox comboBox1; + private MetroFramework.Controls.MetroComboBox comboBox1; + private MetroFramework.Controls.MetroButton applyButton; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; - private System.Windows.Forms.ToolStripMenuItem addEntryToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem deleteEntryToolStripMenuItem; - private System.Windows.Forms.ComboBox comboBox2; + private MetroFramework.Controls.MetroTextBox entryDataTextBox; + private MetroFramework.Controls.MetroTextBox entryTypeTextBox; } } \ No newline at end of file diff --git a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs index 12d50a6a..f95ca91a 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs @@ -20,117 +20,73 @@ namespace PckStudio { InitializeComponent(); currentPCK = currentPCKIn; + treeMeta.Nodes.Clear(); + treeMeta.Nodes.AddRange(currentPCK.GatherPropertiesList().Select((s) => new TreeNode(s)).ToArray()); } - private void addEntryToolStripMenuItem_Click(object sender, EventArgs e) + private void applyButton_Click(object sender, EventArgs e) { - addMeta add = new addMeta(); - if (add.ShowDialog() == DialogResult.OK) + switch (comboBox1.Text) { - - } - add.Dispose(); - } - - private void deleteEntryToolStripMenuItem_Click(object sender, EventArgs e) - { - treeMeta.SelectedNode.Remove(); - } - - private void button1_Click(object sender, EventArgs e) - { - try - { - if (comboBox1.Text == "All") - { - foreach (TreeNode node in treeMeta.Nodes) + case "All": { foreach (PCKFile.FileData file in currentPCK.Files) { - file.properties.Add((node.Text, node.Tag.ToString())); + file.properties.Add((entryTypeTextBox.Text, entryDataTextBox.Text)); } + MessageBox.Show("Data Added to All Entries"); } - MessageBox.Show("Data Added to All Entries"); - } - else if (comboBox1.Text == "64x64") - { - int count = treeMeta.Nodes.Count; - int i = 0; - do + break; + case "64x64": { - foreach (PCKFile.FileData mf in currentPCK.Files) + foreach (PCKFile.FileData file in currentPCK.Files) { - MemoryStream png = new MemoryStream(mf.data); - if (Path.GetExtension(mf.filepath) == ".png") + MemoryStream png = new MemoryStream(file.data); + if (Path.GetExtension(file.filepath) == ".png" && + Image.FromStream(png).Size.Height == Image.FromStream(png).Size.Width) { - if (Image.FromStream(png).Size.Height == Image.FromStream(png).Size.Width) - { - mf.properties.Add(new ValueTuple(treeMeta.Nodes[i].Text, treeMeta.Nodes[i].Tag.ToString())); - } + file.properties.Add((entryTypeTextBox.Text, entryDataTextBox.Text)); } } - i += 1; - count -= 1; - } while (count != 0); - MessageBox.Show("Data Added to 64x64 Image Entries"); - } - else if (comboBox1.Text == "64x32") - { - int count = treeMeta.Nodes.Count; - int i = 0; - - do + MessageBox.Show("Data Added to 64x64 Image Entries"); + } + break; + case "64x32": { - foreach (PCKFile.FileData mf in currentPCK.Files) + foreach (PCKFile.FileData file in currentPCK.Files) { - MemoryStream png = new MemoryStream(mf.data); - if (Path.GetExtension(mf.filepath) == ".png") + MemoryStream png = new MemoryStream(file.data); + if (Path.GetExtension(file.filepath) == ".png" && + Image.FromStream(png).Size.Height == Image.FromStream(png).Size.Width / 2) { - if (Image.FromStream(png).Size.Height == Image.FromStream(png).Size.Width / 2) - { - mf.properties.Add(new ValueTuple(treeMeta.Nodes[i].Text, treeMeta.Nodes[i].Tag.ToString() )); - } + file.properties.Add((entryTypeTextBox.Text, entryDataTextBox.Text)); } } - i += 1; - count -= 1; - } while (count != 0); - MessageBox.Show("Data Added to 64x32 Image Entries"); - } - else if (comboBox1.Text == "PNG Files") - { - int count = treeMeta.Nodes.Count; - int i = 0; - - do + MessageBox.Show("Data Added to 64x32 Image Entries"); + } + break; + case "PNG Files": { - foreach (PCKFile.FileData mf in currentPCK.Files) + foreach (PCKFile.FileData file in currentPCK.Files) { - if (Path.GetExtension(mf.filepath) == ".png") + MemoryStream png = new MemoryStream(file.data); + if (Path.GetExtension(file.filepath) == ".png") { - mf.properties.Add(new ValueTuple(treeMeta.Nodes[i].Text, treeMeta.Nodes[i].Tag.ToString() )); + file.properties.Add((entryTypeTextBox.Text, entryDataTextBox.Text)); } } - i += 1; - count -= 1; - } while (count != 0); - MessageBox.Show("Data Added to All PNG Image Entries"); - } - else - { + MessageBox.Show("Data Added to All PNG Image Entries"); + } + break; + default: MessageBox.Show("Please Select an Application Argument"); - } - }catch (Exception) - { - MessageBox.Show("A Probelm Occured.."); + break; } } private void treeMeta_AfterSelect(object sender, TreeViewEventArgs e) { - comboBox2.Items.Clear(); - comboBox2.Text = treeMeta.SelectedNode.Text; - textBox1.Text = treeMeta.SelectedNode.Tag.ToString(); + entryTypeTextBox.Text = treeMeta.SelectedNode.Text; } } } diff --git a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.resx b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.resx index 6749c0f6..d7c42b3c 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.resx +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.resx @@ -117,28 +117,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - 138, 48 - - - contextMenuStrip2 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 12, 63 + 23, 63 - 291, 142 + 272, 142 - 0 + 13 treeMeta @@ -150,36 +138,10 @@ $this - 8 + 7 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x - DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 - jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC - - - - 137, 22 - - - Add Entry - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAACESURBVDhPlY0B - DoAgDAP3Dj7r09WTkqGUgJfUxtrOmHFEnL0U76FBqW8PZXmk/9uONEsIb3gsNRzoL/+R5hWC759mGsbQ - DnzdZbhmiSvhLsM1S1wJdxmuWeJKuMtwzRJXwl2Ga5a4Eu4yXLPElXCX4Zol/WCl6YGdI62n2Zv2cSXV - byIunLh7mD2ySLcAAAAASUVORK5CYII= - - - - 137, 22 - - - Delete Entry + + 23 All @@ -194,10 +156,10 @@ PNG Files - 71, 256 + 71, 254 - 82, 21 + 82, 29 1 @@ -206,19 +168,19 @@ comboBox1 - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + MetroFramework.Controls.MetroComboBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a $this - 7 + 6 True - 20, 259 + 20, 260 45, 13 @@ -239,41 +201,37 @@ $this - 6 + 5 - - - Popup + + 228, 260 - - 228, 254 - - + 75, 23 - + 3 - + Apply - - button1 + + applyButton - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + MetroFramework.Controls.MetroButton, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - + $this - - 5 + + 4 True - 208, 212 + 208, 208 57, 13 @@ -300,7 +258,7 @@ True - 52, 212 + 53, 208 58, 13 @@ -323,48 +281,85 @@ 2 - - 164, 228 + + + - + + 121, 2 + + + 15, 15 + + + 1 + + + False + + + 164, 224 + + 139, 20 - + 9 - - textBox1 + + entryDataTextBox - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - + $this - - 4 - - - 12, 227 - - - 141, 21 - - - 10 - - - comboBox2 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - + 3 + + + + + NoControl + + + 121, 2 + + + 15, 15 + + + 1 + + + False + + + False + + + 19, 224 + + + 139, 20 + + + 14 + + + entryTypeTextBox + + + MetroFramework.Controls.MetroTextBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a + + + $this + + + 0 + True @@ -372,7 +367,7 @@ 6, 13 - 315, 283 + 318, 296 @@ -2099,24 +2094,18 @@ AABJRU5ErkJggg== + + 318, 296 + + + 318, 296 + CenterParent Advanced - - addEntryToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - deleteEntryToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - AdvancedOptions