From 083ebaeb8c3a338c732e6416cb098c028a73db16 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 1 Apr 2023 11:14:23 +0200 Subject: [PATCH] FrameEditor - removed unused variable and set label text directly --- .../Animation/FrameEditor.Designer.cs | 240 +++++++++--------- .../Animation/FrameEditor.cs | 13 +- 2 files changed, 125 insertions(+), 128 deletions(-) diff --git a/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.Designer.cs b/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.Designer.cs index 3c8a510f..290635f4 100644 --- a/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.Designer.cs +++ b/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.Designer.cs @@ -29,138 +29,138 @@ namespace PckStudio.Forms.Additional_Popups.Animation /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.SaveBtn = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.CancelBtn = new System.Windows.Forms.Button(); - this.FrameTimeUpDown = new System.Windows.Forms.NumericUpDown(); - this.FrameList = new System.Windows.Forms.TreeView(); - this.TextureIcons = new System.Windows.Forms.ImageList(this.components); - ((System.ComponentModel.ISupportInitialize)(this.FrameTimeUpDown)).BeginInit(); - this.SuspendLayout(); - // - // SaveBtn - // - this.SaveBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.SaveBtn.ForeColor = System.Drawing.Color.White; - this.SaveBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.SaveBtn.Location = new System.Drawing.Point(12, 228); - this.SaveBtn.Name = "SaveBtn"; - this.SaveBtn.Size = new System.Drawing.Size(75, 23); - this.SaveBtn.TabIndex = 7; - this.SaveBtn.Text = "Save"; - this.SaveBtn.UseVisualStyleBackColor = true; - this.SaveBtn.Click += new System.EventHandler(this.SaveBtn_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label1.Location = new System.Drawing.Point(19, 204); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(62, 13); - this.label1.TabIndex = 10; - this.label1.Text = "Frame Time"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.ForeColor = System.Drawing.Color.White; - this.label3.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label3.Location = new System.Drawing.Point(14, 13); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(109, 13); - this.label3.TabIndex = 12; - this.label3.Text = "may/matt was here :3"; - // - // CancelBtn - // - this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.CancelBtn.ForeColor = System.Drawing.Color.White; - this.CancelBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.CancelBtn.Location = new System.Drawing.Point(92, 228); - this.CancelBtn.Name = "CancelBtn"; - this.CancelBtn.Size = new System.Drawing.Size(75, 23); - this.CancelBtn.TabIndex = 13; - this.CancelBtn.Text = "Cancel"; - this.CancelBtn.UseVisualStyleBackColor = true; - this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click); - // - // FrameTimeUpDown - // - this.FrameTimeUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); - this.FrameTimeUpDown.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.FrameTimeUpDown.ForeColor = System.Drawing.SystemColors.Window; - this.FrameTimeUpDown.Location = new System.Drawing.Point(87, 202); - this.FrameTimeUpDown.Maximum = new decimal(new int[] { + this.components = new System.ComponentModel.Container(); + this.SaveBtn = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.CancelBtn = new System.Windows.Forms.Button(); + this.FrameTimeUpDown = new System.Windows.Forms.NumericUpDown(); + this.FrameList = new System.Windows.Forms.TreeView(); + this.TextureIcons = new System.Windows.Forms.ImageList(this.components); + ((System.ComponentModel.ISupportInitialize)(this.FrameTimeUpDown)).BeginInit(); + this.SuspendLayout(); + // + // SaveBtn + // + this.SaveBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.SaveBtn.ForeColor = System.Drawing.Color.White; + this.SaveBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.SaveBtn.Location = new System.Drawing.Point(12, 228); + this.SaveBtn.Name = "SaveBtn"; + this.SaveBtn.Size = new System.Drawing.Size(75, 23); + this.SaveBtn.TabIndex = 7; + this.SaveBtn.Text = "Save"; + this.SaveBtn.UseVisualStyleBackColor = true; + this.SaveBtn.Click += new System.EventHandler(this.SaveBtn_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label1.Location = new System.Drawing.Point(19, 204); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(62, 13); + this.label1.TabIndex = 10; + this.label1.Text = "Frame Time"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.ForeColor = System.Drawing.Color.White; + this.label3.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label3.Location = new System.Drawing.Point(14, 13); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(150, 13); + this.label3.TabIndex = 12; + this.label3.Text = "Select a frame and frame time:"; + // + // CancelBtn + // + this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.CancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.CancelBtn.ForeColor = System.Drawing.Color.White; + this.CancelBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.CancelBtn.Location = new System.Drawing.Point(92, 228); + this.CancelBtn.Name = "CancelBtn"; + this.CancelBtn.Size = new System.Drawing.Size(75, 23); + this.CancelBtn.TabIndex = 13; + this.CancelBtn.Text = "Cancel"; + this.CancelBtn.UseVisualStyleBackColor = true; + this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click); + // + // FrameTimeUpDown + // + this.FrameTimeUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.FrameTimeUpDown.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.FrameTimeUpDown.ForeColor = System.Drawing.SystemColors.Window; + this.FrameTimeUpDown.Location = new System.Drawing.Point(87, 202); + this.FrameTimeUpDown.Maximum = new decimal(new int[] { 10000, 0, 0, 0}); - this.FrameTimeUpDown.Minimum = new decimal(new int[] { + this.FrameTimeUpDown.Minimum = new decimal(new int[] { 1, 0, 0, 0}); - this.FrameTimeUpDown.Name = "FrameTimeUpDown"; - this.FrameTimeUpDown.Size = new System.Drawing.Size(73, 20); - this.FrameTimeUpDown.TabIndex = 15; - this.FrameTimeUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.FrameTimeUpDown.Value = new decimal(new int[] { + this.FrameTimeUpDown.Name = "FrameTimeUpDown"; + this.FrameTimeUpDown.Size = new System.Drawing.Size(73, 20); + this.FrameTimeUpDown.TabIndex = 15; + this.FrameTimeUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.FrameTimeUpDown.Value = new decimal(new int[] { 1, 0, 0, 0}); - // - // FrameList - // - this.FrameList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.FrameList.ForeColor = System.Drawing.SystemColors.Window; - this.FrameList.HideSelection = false; - this.FrameList.ImageIndex = 0; - this.FrameList.ImageList = this.TextureIcons; - this.FrameList.Location = new System.Drawing.Point(12, 37); - this.FrameList.Name = "FrameList"; - this.FrameList.SelectedImageIndex = 0; - this.FrameList.ShowLines = false; - this.FrameList.ShowRootLines = false; - this.FrameList.Size = new System.Drawing.Size(155, 159); - this.FrameList.TabIndex = 1; - // - // TextureIcons - // - this.TextureIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.TextureIcons.ImageSize = new System.Drawing.Size(32, 32); - this.TextureIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // FrameEditor - // - this.AcceptButton = this.SaveBtn; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.CancelBtn; - this.ClientSize = new System.Drawing.Size(178, 264); - this.ControlBox = false; - this.Controls.Add(this.FrameList); - this.Controls.Add(this.FrameTimeUpDown); - this.Controls.Add(this.CancelBtn); - this.Controls.Add(this.label3); - this.Controls.Add(this.label1); - this.Controls.Add(this.SaveBtn); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrameEditor"; - this.Resizable = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Style = MetroFramework.MetroColorStyle.Silver; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - ((System.ComponentModel.ISupportInitialize)(this.FrameTimeUpDown)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + // + // FrameList + // + this.FrameList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.FrameList.ForeColor = System.Drawing.SystemColors.Window; + this.FrameList.HideSelection = false; + this.FrameList.ImageIndex = 0; + this.FrameList.ImageList = this.TextureIcons; + this.FrameList.Location = new System.Drawing.Point(12, 37); + this.FrameList.Name = "FrameList"; + this.FrameList.SelectedImageIndex = 0; + this.FrameList.ShowLines = false; + this.FrameList.ShowRootLines = false; + this.FrameList.Size = new System.Drawing.Size(155, 159); + this.FrameList.TabIndex = 1; + // + // TextureIcons + // + this.TextureIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; + this.TextureIcons.ImageSize = new System.Drawing.Size(32, 32); + this.TextureIcons.TransparentColor = System.Drawing.Color.Transparent; + // + // FrameEditor + // + this.AcceptButton = this.SaveBtn; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.CancelBtn; + this.ClientSize = new System.Drawing.Size(178, 264); + this.ControlBox = false; + this.Controls.Add(this.FrameList); + this.Controls.Add(this.FrameTimeUpDown); + this.Controls.Add(this.CancelBtn); + this.Controls.Add(this.label3); + this.Controls.Add(this.label1); + this.Controls.Add(this.SaveBtn); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FrameEditor"; + this.Resizable = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + ((System.ComponentModel.ISupportInitialize)(this.FrameTimeUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.cs b/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.cs index b3836f82..1369cae6 100644 --- a/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.cs +++ b/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.cs @@ -1,7 +1,7 @@ using System; -using System.Drawing; using MetroFramework.Forms; using System.Windows.Forms; +using System.Diagnostics; namespace PckStudio.Forms.Additional_Popups.Animation { @@ -13,16 +13,12 @@ namespace PckStudio.Forms.Additional_Popups.Animation public FrameEditor(ImageList texList) { InitializeComponent(); - label3.Text = "Select a frame and frame time:"; FrameList.ImageList = texList; - - int index = 0; - foreach (Image frameTex in texList.Images) + for (int index = 0; index < texList.Images.Count; index++) { TreeNode frame = new TreeNode($"Frame {index}", index, index); FrameList.Nodes.Add(frame); - Console.WriteLine(index); - index++; + Debug.WriteLine(index); } } @@ -41,7 +37,8 @@ namespace PckStudio.Forms.Additional_Popups.Animation private void CancelBtn_Click(object sender, EventArgs e) { - Close(); + DialogResult = DialogResult.Cancel; + Close(); } } }