diff --git a/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.Designer.cs b/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.Designer.cs index 290635f4..5f3f360c 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(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[] { + 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(9, 204); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 10; + this.label1.Text = "Frame Time in ticks"; + // + // 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(113, 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(47, 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 1369cae6..2ec384b7 100644 --- a/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.cs +++ b/PCK-Studio/Forms/Additional-Popups/Animation/FrameEditor.cs @@ -18,7 +18,6 @@ namespace PckStudio.Forms.Additional_Popups.Animation { TreeNode frame = new TreeNode($"Frame {index}", index, index); FrameList.Nodes.Add(frame); - Debug.WriteLine(index); } } diff --git a/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.Designer.cs b/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.Designer.cs index e7a23f35..fb4c7d53 100644 --- a/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.Designer.cs +++ b/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.Designer.cs @@ -29,107 +29,103 @@ namespace PckStudio.Forms.Additional_Popups.Animation /// private void InitializeComponent() { - this.saveButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.cancelButton = new System.Windows.Forms.Button(); - this.TimeUpDown = new System.Windows.Forms.NumericUpDown(); - ((System.ComponentModel.ISupportInitialize)(this.TimeUpDown)).BeginInit(); - this.SuspendLayout(); - // - // saveButton - // - this.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.saveButton.ForeColor = System.Drawing.Color.White; - this.saveButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.saveButton.Location = new System.Drawing.Point(55, 63); - this.saveButton.Name = "saveButton"; - this.saveButton.Size = new System.Drawing.Size(75, 23); - this.saveButton.TabIndex = 7; - this.saveButton.Text = "Save"; - this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_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(9, 35); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(79, 13); - this.label1.TabIndex = 10; - this.label1.Text = "Animation 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(47, 13); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(174, 13); - this.label3.TabIndex = 12; - this.label3.Text = "Frame Time must be greater than 0."; - // - // cancelButton - // - this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cancelButton.ForeColor = System.Drawing.Color.White; - this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.cancelButton.Location = new System.Drawing.Point(135, 63); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 13; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // TimeUpDown - // - this.TimeUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); - this.TimeUpDown.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.TimeUpDown.ForeColor = System.Drawing.SystemColors.Window; - this.TimeUpDown.Location = new System.Drawing.Point(94, 33); - this.TimeUpDown.Maximum = new decimal(new int[] { + this.saveButton = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.TimeUpDown = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.TimeUpDown)).BeginInit(); + this.SuspendLayout(); + // + // saveButton + // + this.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.saveButton.ForeColor = System.Drawing.Color.White; + this.saveButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.saveButton.Location = new System.Drawing.Point(55, 63); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(75, 23); + this.saveButton.TabIndex = 7; + this.saveButton.Text = "Save"; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_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(9, 29); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(104, 13); + this.label1.TabIndex = 10; + this.label1.Text = "Ticks for each frame"; + // + // cancelButton + // + this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cancelButton.ForeColor = System.Drawing.Color.White; + this.cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.cancelButton.Location = new System.Drawing.Point(135, 63); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 13; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // TimeUpDown + // + this.TimeUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); + this.TimeUpDown.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.TimeUpDown.ForeColor = System.Drawing.SystemColors.Window; + this.TimeUpDown.Location = new System.Drawing.Point(119, 27); + this.TimeUpDown.Maximum = new decimal(new int[] { 10000, 0, 0, 0}); - this.TimeUpDown.Name = "TimeUpDown"; - this.TimeUpDown.Size = new System.Drawing.Size(162, 20); - this.TimeUpDown.TabIndex = 15; - this.TimeUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // SetBulkSpeed - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(264, 94); - this.ControlBox = false; - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.label3); - this.Controls.Add(this.label1); - this.Controls.Add(this.saveButton); - this.Controls.Add(this.TimeUpDown); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(266, 96); - this.Name = "SetBulkSpeed"; - this.Resizable = false; - this.Style = MetroFramework.MetroColorStyle.Silver; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - ((System.ComponentModel.ISupportInitialize)(this.TimeUpDown)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.TimeUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.TimeUpDown.Name = "TimeUpDown"; + this.TimeUpDown.Size = new System.Drawing.Size(137, 20); + this.TimeUpDown.TabIndex = 15; + this.TimeUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.TimeUpDown.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // SetBulkSpeed + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(264, 94); + this.ControlBox = false; + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.TimeUpDown); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(266, 96); + this.Name = "SetBulkSpeed"; + this.Resizable = false; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + ((System.ComponentModel.ISupportInitialize)(this.TimeUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.Button saveButton; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label3; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.NumericUpDown TimeUpDown; } diff --git a/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.cs b/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.cs index af34f4b6..c79f9cc9 100644 --- a/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.cs +++ b/PCK-Studio/Forms/Additional-Popups/Animation/SetBulkSpeed.cs @@ -15,7 +15,6 @@ namespace PckStudio.Forms.Additional_Popups.Animation private void saveButton_Click(object sender, EventArgs e) { - if (Ticks < 0) return; DialogResult = DialogResult.OK; } diff --git a/PCK-Studio/Forms/Additional-Popups/RenamePrompt.cs b/PCK-Studio/Forms/Additional-Popups/RenamePrompt.cs index ede41374..8b5f9df6 100644 --- a/PCK-Studio/Forms/Additional-Popups/RenamePrompt.cs +++ b/PCK-Studio/Forms/Additional-Popups/RenamePrompt.cs @@ -23,7 +23,11 @@ namespace PckStudio private void OKBtn_Click(object sender, EventArgs e) { - DialogResult = DialogResult.OK; + if (String.IsNullOrEmpty(InputTextBox.Text)) + { + MessageBox.Show(this, "Please insert a value in the text box.", "Empty string"); + } + else DialogResult = DialogResult.OK; } private void RenamePrompt_Load(object sender, EventArgs e) diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.Designer.cs b/PCK-Studio/Forms/Editor/AnimationEditor.Designer.cs index c43c92e5..77e57ba6 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.Designer.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.Designer.cs @@ -28,340 +28,349 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AnimationEditor)); - this.frameTreeView = new System.Windows.Forms.TreeView(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.TextureIcons = new System.Windows.Forms.ImageList(this.components); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importAnimationTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importJavaAnimationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importGifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exportAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exportJavaAnimationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.gifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bulkAnimationSpeedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.changeTileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToInterpolation = new System.Windows.Forms.ToolStripMenuItem(); - this.editorControlsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.setBulkSpedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.javaAnimationSupportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.InterpolationCheckbox = new MetroFramework.Controls.MetroCheckBox(); - this.AnimationStartStopBtn = new MetroFramework.Controls.MetroButton(); - this.tileLabel = new MetroFramework.Controls.MetroLabel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.animationPictureBox = new PckStudio.Forms.Editor.AnimationPictureBox(); - this.contextMenuStrip1.SuspendLayout(); - this.menuStrip.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.animationPictureBox)).BeginInit(); - this.SuspendLayout(); - // - // frameTreeView - // - this.frameTreeView.AllowDrop = true; - this.frameTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AnimationEditor)); + this.frameTreeView = new System.Windows.Forms.TreeView(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.addFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.removeFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.TextureIcons = new System.Windows.Forms.ImageList(this.components); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importAnimationTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importJavaAnimationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importGifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportJavaAnimationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.gifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.bulkAnimationSpeedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.changeTileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToInterpolation = new System.Windows.Forms.ToolStripMenuItem(); + this.editorControlsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.setBulkSpedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.javaAnimationSupportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.InterpolationCheckbox = new MetroFramework.Controls.MetroCheckBox(); + this.AnimationStartStopBtn = new MetroFramework.Controls.MetroButton(); + this.tileLabel = new MetroFramework.Controls.MetroLabel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.animationPictureBox = new PckStudio.Forms.Editor.AnimationPictureBox(); + this.frameTimeandTicksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip1.SuspendLayout(); + this.menuStrip.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.animationPictureBox)).BeginInit(); + this.SuspendLayout(); + // + // frameTreeView + // + this.frameTreeView.AllowDrop = true; + this.frameTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.frameTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.frameTreeView.ContextMenuStrip = this.contextMenuStrip1; - this.frameTreeView.ForeColor = System.Drawing.Color.White; - this.frameTreeView.ImageIndex = 0; - this.frameTreeView.ImageList = this.TextureIcons; - this.frameTreeView.Location = new System.Drawing.Point(20, 88); - this.frameTreeView.Margin = new System.Windows.Forms.Padding(0); - this.frameTreeView.Name = "frameTreeView"; - this.frameTreeView.SelectedImageIndex = 0; - this.frameTreeView.ShowLines = false; - this.frameTreeView.ShowRootLines = false; - this.frameTreeView.Size = new System.Drawing.Size(134, 253); - this.frameTreeView.TabIndex = 15; - this.frameTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.frameTreeView_ItemDrag); - this.frameTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.frameTreeView_AfterSelect); - this.frameTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_doubleClick); - this.frameTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.frameTreeView_DragDrop); - this.frameTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.frameTreeView_DragEnter); - this.frameTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.frameTreeView_DragOver); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.frameTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.frameTreeView.ContextMenuStrip = this.contextMenuStrip1; + this.frameTreeView.ForeColor = System.Drawing.Color.White; + this.frameTreeView.ImageIndex = 0; + this.frameTreeView.ImageList = this.TextureIcons; + this.frameTreeView.Location = new System.Drawing.Point(20, 88); + this.frameTreeView.Margin = new System.Windows.Forms.Padding(0); + this.frameTreeView.Name = "frameTreeView"; + this.frameTreeView.SelectedImageIndex = 0; + this.frameTreeView.ShowLines = false; + this.frameTreeView.ShowRootLines = false; + this.frameTreeView.Size = new System.Drawing.Size(134, 253); + this.frameTreeView.TabIndex = 15; + this.frameTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.frameTreeView_ItemDrag); + this.frameTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.frameTreeView_AfterSelect); + this.frameTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_doubleClick); + this.frameTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.frameTreeView_DragDrop); + this.frameTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.frameTreeView_DragEnter); + this.frameTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.frameTreeView_DragOver); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addFrameToolStripMenuItem, this.removeFrameToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(154, 48); - // - // addFrameToolStripMenuItem - // - this.addFrameToolStripMenuItem.Name = "addFrameToolStripMenuItem"; - this.addFrameToolStripMenuItem.Size = new System.Drawing.Size(153, 22); - this.addFrameToolStripMenuItem.Text = "Add Frame"; - this.addFrameToolStripMenuItem.Click += new System.EventHandler(this.addFrameToolStripMenuItem_Click); - // - // removeFrameToolStripMenuItem - // - this.removeFrameToolStripMenuItem.Name = "removeFrameToolStripMenuItem"; - this.removeFrameToolStripMenuItem.Size = new System.Drawing.Size(153, 22); - this.removeFrameToolStripMenuItem.Text = "Remove Frame"; - this.removeFrameToolStripMenuItem.Click += new System.EventHandler(this.removeFrameToolStripMenuItem_Click); - // - // 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; - // - // menuStrip - // - this.menuStrip.AutoSize = false; - 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"; + this.contextMenuStrip1.Size = new System.Drawing.Size(154, 48); + // + // addFrameToolStripMenuItem + // + this.addFrameToolStripMenuItem.Name = "addFrameToolStripMenuItem"; + this.addFrameToolStripMenuItem.Size = new System.Drawing.Size(153, 22); + this.addFrameToolStripMenuItem.Text = "Add Frame"; + this.addFrameToolStripMenuItem.Click += new System.EventHandler(this.addFrameToolStripMenuItem_Click); + // + // removeFrameToolStripMenuItem + // + this.removeFrameToolStripMenuItem.Name = "removeFrameToolStripMenuItem"; + this.removeFrameToolStripMenuItem.Size = new System.Drawing.Size(153, 22); + this.removeFrameToolStripMenuItem.Text = "Remove Frame"; + this.removeFrameToolStripMenuItem.Click += new System.EventHandler(this.removeFrameToolStripMenuItem_Click); + // + // 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; + // + // menuStrip + // + this.menuStrip.AutoSize = false; + 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.editToolStripMenuItem, this.helpToolStripMenuItem}); - this.menuStrip.Location = new System.Drawing.Point(20, 60); - this.menuStrip.Name = "menuStrip"; - this.menuStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.menuStrip.Size = new System.Drawing.Size(372, 24); - this.menuStrip.TabIndex = 14; - this.menuStrip.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStrip.Location = new System.Drawing.Point(20, 60); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; + this.menuStrip.Size = new System.Drawing.Size(372, 24); + this.menuStrip.TabIndex = 14; + this.menuStrip.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.saveToolStripMenuItem1, this.toolStripSeparator1, this.importToolStripMenuItem, this.exportAsToolStripMenuItem}); - this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; - // - // saveToolStripMenuItem1 - // - this.saveToolStripMenuItem1.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem1.Image"))); - this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; - this.saveToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); - this.saveToolStripMenuItem1.Text = "Save"; - this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); - // - // importToolStripMenuItem - // - this.importToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // saveToolStripMenuItem1 + // + this.saveToolStripMenuItem1.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem1.Image"))); + this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; + this.saveToolStripMenuItem1.Size = new System.Drawing.Size(122, 22); + this.saveToolStripMenuItem1.Text = "Save"; + this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(119, 6); + // + // importToolStripMenuItem + // + this.importToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.importAnimationTextureToolStripMenuItem, this.importJavaAnimationToolStripMenuItem, this.importGifToolStripMenuItem}); - this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.importToolStripMenuItem.Text = "Import"; - // - // importAnimationTextureToolStripMenuItem - // - this.importAnimationTextureToolStripMenuItem.Name = "importAnimationTextureToolStripMenuItem"; - this.importAnimationTextureToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.importAnimationTextureToolStripMenuItem.Text = "Animation Texture"; - this.importAnimationTextureToolStripMenuItem.Click += new System.EventHandler(this.importAnimationTextureToolStripMenuItem_Click); - // - // importJavaAnimationToolStripMenuItem - // - this.importJavaAnimationToolStripMenuItem.Name = "importJavaAnimationToolStripMenuItem"; - this.importJavaAnimationToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.importJavaAnimationToolStripMenuItem.Text = "Java Animation"; - this.importJavaAnimationToolStripMenuItem.Click += new System.EventHandler(this.importJavaAnimationToolStripMenuItem_Click); - // - // importGifToolStripMenuItem - // - this.importGifToolStripMenuItem.Name = "importGifToolStripMenuItem"; - this.importGifToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.importGifToolStripMenuItem.Text = "Gif"; - this.importGifToolStripMenuItem.Click += new System.EventHandler(this.importGifToolStripMenuItem_Click); - // - // exportAsToolStripMenuItem - // - this.exportAsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.importToolStripMenuItem.Name = "importToolStripMenuItem"; + this.importToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.importToolStripMenuItem.Text = "Import"; + // + // importAnimationTextureToolStripMenuItem + // + this.importAnimationTextureToolStripMenuItem.Name = "importAnimationTextureToolStripMenuItem"; + this.importAnimationTextureToolStripMenuItem.Size = new System.Drawing.Size(171, 22); + this.importAnimationTextureToolStripMenuItem.Text = "Animation Texture"; + this.importAnimationTextureToolStripMenuItem.Click += new System.EventHandler(this.importAnimationTextureToolStripMenuItem_Click); + // + // importJavaAnimationToolStripMenuItem + // + this.importJavaAnimationToolStripMenuItem.Name = "importJavaAnimationToolStripMenuItem"; + this.importJavaAnimationToolStripMenuItem.Size = new System.Drawing.Size(171, 22); + this.importJavaAnimationToolStripMenuItem.Text = "Java Animation"; + this.importJavaAnimationToolStripMenuItem.Click += new System.EventHandler(this.importJavaAnimationToolStripMenuItem_Click); + // + // importGifToolStripMenuItem + // + this.importGifToolStripMenuItem.Name = "importGifToolStripMenuItem"; + this.importGifToolStripMenuItem.Size = new System.Drawing.Size(171, 22); + this.importGifToolStripMenuItem.Text = "Gif"; + this.importGifToolStripMenuItem.Click += new System.EventHandler(this.importGifToolStripMenuItem_Click); + // + // exportAsToolStripMenuItem + // + this.exportAsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exportJavaAnimationToolStripMenuItem, this.gifToolStripMenuItem}); - this.exportAsToolStripMenuItem.Name = "exportAsToolStripMenuItem"; - this.exportAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.exportAsToolStripMenuItem.Text = "Export as"; - // - // exportJavaAnimationToolStripMenuItem - // - this.exportJavaAnimationToolStripMenuItem.Name = "exportJavaAnimationToolStripMenuItem"; - this.exportJavaAnimationToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.exportJavaAnimationToolStripMenuItem.Text = "Java Animation"; - this.exportJavaAnimationToolStripMenuItem.Click += new System.EventHandler(this.exportJavaAnimationToolStripMenuItem_Click); - // - // gifToolStripMenuItem - // - this.gifToolStripMenuItem.Name = "gifToolStripMenuItem"; - this.gifToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.gifToolStripMenuItem.Text = "Gif"; - this.gifToolStripMenuItem.Click += new System.EventHandler(this.gifToolStripMenuItem_Click); - // - // editToolStripMenuItem - // - this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exportAsToolStripMenuItem.Name = "exportAsToolStripMenuItem"; + this.exportAsToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.exportAsToolStripMenuItem.Text = "Export as"; + // + // exportJavaAnimationToolStripMenuItem + // + this.exportJavaAnimationToolStripMenuItem.Name = "exportJavaAnimationToolStripMenuItem"; + this.exportJavaAnimationToolStripMenuItem.Size = new System.Drawing.Size(155, 22); + this.exportJavaAnimationToolStripMenuItem.Text = "Java Animation"; + this.exportJavaAnimationToolStripMenuItem.Click += new System.EventHandler(this.exportJavaAnimationToolStripMenuItem_Click); + // + // gifToolStripMenuItem + // + this.gifToolStripMenuItem.Name = "gifToolStripMenuItem"; + this.gifToolStripMenuItem.Size = new System.Drawing.Size(155, 22); + this.gifToolStripMenuItem.Text = "Gif"; + this.gifToolStripMenuItem.Click += new System.EventHandler(this.gifToolStripMenuItem_Click); + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.bulkAnimationSpeedToolStripMenuItem, this.changeTileToolStripMenuItem}); - this.editToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(46, 20); - this.editToolStripMenuItem.Text = "Tools"; - // - // bulkAnimationSpeedToolStripMenuItem - // - this.bulkAnimationSpeedToolStripMenuItem.Name = "bulkAnimationSpeedToolStripMenuItem"; - this.bulkAnimationSpeedToolStripMenuItem.Size = new System.Drawing.Size(210, 22); - this.bulkAnimationSpeedToolStripMenuItem.Text = "Set Bulk Animation Speed"; - this.bulkAnimationSpeedToolStripMenuItem.Click += new System.EventHandler(this.bulkAnimationSpeedToolStripMenuItem_Click); - // - // changeTileToolStripMenuItem - // - this.changeTileToolStripMenuItem.Name = "changeTileToolStripMenuItem"; - this.changeTileToolStripMenuItem.Size = new System.Drawing.Size(210, 22); - this.changeTileToolStripMenuItem.Text = "Change Tile"; - this.changeTileToolStripMenuItem.Click += new System.EventHandler(this.changeTileToolStripMenuItem_Click); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.editToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(46, 20); + this.editToolStripMenuItem.Text = "Tools"; + // + // bulkAnimationSpeedToolStripMenuItem + // + this.bulkAnimationSpeedToolStripMenuItem.Name = "bulkAnimationSpeedToolStripMenuItem"; + this.bulkAnimationSpeedToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.bulkAnimationSpeedToolStripMenuItem.Text = "Set Bulk Animation Speed"; + this.bulkAnimationSpeedToolStripMenuItem.Click += new System.EventHandler(this.bulkAnimationSpeedToolStripMenuItem_Click); + // + // changeTileToolStripMenuItem + // + this.changeTileToolStripMenuItem.Name = "changeTileToolStripMenuItem"; + this.changeTileToolStripMenuItem.Size = new System.Drawing.Size(210, 22); + this.changeTileToolStripMenuItem.Text = "Change Tile"; + this.changeTileToolStripMenuItem.Click += new System.EventHandler(this.changeTileToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.frameTimeandTicksToolStripMenuItem, this.howToInterpolation, this.editorControlsToolStripMenuItem, this.setBulkSpedToolStripMenuItem, this.javaAnimationSupportToolStripMenuItem}); - this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "Help"; - // - // howToInterpolation - // - this.howToInterpolation.Name = "howToInterpolation"; - this.howToInterpolation.Size = new System.Drawing.Size(200, 22); - this.howToInterpolation.Text = "Interpolation"; - this.howToInterpolation.Click += new System.EventHandler(this.howToInterpolation_Click); - // - // editorControlsToolStripMenuItem - // - this.editorControlsToolStripMenuItem.Name = "editorControlsToolStripMenuItem"; - this.editorControlsToolStripMenuItem.Size = new System.Drawing.Size(200, 22); - this.editorControlsToolStripMenuItem.Text = "Editor Controls"; - this.editorControlsToolStripMenuItem.Click += new System.EventHandler(this.editorControlsToolStripMenuItem_Click); - // - // setBulkSpedToolStripMenuItem - // - this.setBulkSpedToolStripMenuItem.Name = "setBulkSpedToolStripMenuItem"; - this.setBulkSpedToolStripMenuItem.Size = new System.Drawing.Size(200, 22); - this.setBulkSpedToolStripMenuItem.Text = "Set Bulk Speed"; - this.setBulkSpedToolStripMenuItem.Click += new System.EventHandler(this.setBulkSpeedToolStripMenuItem_Click); - // - // javaAnimationSupportToolStripMenuItem - // - this.javaAnimationSupportToolStripMenuItem.Name = "javaAnimationSupportToolStripMenuItem"; - this.javaAnimationSupportToolStripMenuItem.Size = new System.Drawing.Size(200, 22); - this.javaAnimationSupportToolStripMenuItem.Text = "Java Animation Support"; - this.javaAnimationSupportToolStripMenuItem.Click += new System.EventHandler(this.javaAnimationSupportToolStripMenuItem_Click); - // - // InterpolationCheckbox - // - this.InterpolationCheckbox.AutoSize = true; - this.InterpolationCheckbox.Location = new System.Drawing.Point(161, 63); - this.InterpolationCheckbox.Name = "InterpolationCheckbox"; - this.InterpolationCheckbox.Size = new System.Drawing.Size(129, 15); - this.InterpolationCheckbox.TabIndex = 17; - this.InterpolationCheckbox.Text = "Enable Interpolation"; - this.InterpolationCheckbox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.InterpolationCheckbox.UseSelectable = true; - this.InterpolationCheckbox.CheckedChanged += new System.EventHandler(this.InterpolationCheckbox_CheckedChanged); - // - // AnimationStartStopBtn - // - this.AnimationStartStopBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "Help"; + // + // howToInterpolation + // + this.howToInterpolation.Name = "howToInterpolation"; + this.howToInterpolation.Size = new System.Drawing.Size(200, 22); + this.howToInterpolation.Text = "Interpolation"; + this.howToInterpolation.Click += new System.EventHandler(this.howToInterpolation_Click); + // + // editorControlsToolStripMenuItem + // + this.editorControlsToolStripMenuItem.Name = "editorControlsToolStripMenuItem"; + this.editorControlsToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.editorControlsToolStripMenuItem.Text = "Editor Controls"; + this.editorControlsToolStripMenuItem.Click += new System.EventHandler(this.editorControlsToolStripMenuItem_Click); + // + // setBulkSpedToolStripMenuItem + // + this.setBulkSpedToolStripMenuItem.Name = "setBulkSpedToolStripMenuItem"; + this.setBulkSpedToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.setBulkSpedToolStripMenuItem.Text = "Set Bulk Speed"; + this.setBulkSpedToolStripMenuItem.Click += new System.EventHandler(this.setBulkSpeedToolStripMenuItem_Click); + // + // javaAnimationSupportToolStripMenuItem + // + this.javaAnimationSupportToolStripMenuItem.Name = "javaAnimationSupportToolStripMenuItem"; + this.javaAnimationSupportToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.javaAnimationSupportToolStripMenuItem.Text = "Java Animation Support"; + this.javaAnimationSupportToolStripMenuItem.Click += new System.EventHandler(this.javaAnimationSupportToolStripMenuItem_Click); + // + // InterpolationCheckbox + // + this.InterpolationCheckbox.AutoSize = true; + this.InterpolationCheckbox.Location = new System.Drawing.Point(161, 63); + this.InterpolationCheckbox.Name = "InterpolationCheckbox"; + this.InterpolationCheckbox.Size = new System.Drawing.Size(129, 15); + this.InterpolationCheckbox.TabIndex = 17; + this.InterpolationCheckbox.Text = "Enable Interpolation"; + this.InterpolationCheckbox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.InterpolationCheckbox.UseSelectable = true; + this.InterpolationCheckbox.CheckedChanged += new System.EventHandler(this.InterpolationCheckbox_CheckedChanged); + // + // AnimationStartStopBtn + // + this.AnimationStartStopBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.AnimationStartStopBtn.Location = new System.Drawing.Point(157, 317); - this.AnimationStartStopBtn.Name = "AnimationStartStopBtn"; - this.AnimationStartStopBtn.Size = new System.Drawing.Size(232, 24); - this.AnimationStartStopBtn.Style = MetroFramework.MetroColorStyle.White; - this.AnimationStartStopBtn.TabIndex = 18; - this.AnimationStartStopBtn.Text = "Play Animation"; - this.AnimationStartStopBtn.Theme = MetroFramework.MetroThemeStyle.Dark; - this.AnimationStartStopBtn.UseSelectable = true; - this.AnimationStartStopBtn.Click += new System.EventHandler(this.AnimationStartStopBtn_Click); - // - // tileLabel - // - this.tileLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.tileLabel.AutoSize = true; - this.tileLabel.Location = new System.Drawing.Point(20, 341); - this.tileLabel.MinimumSize = new System.Drawing.Size(170, 19); - this.tileLabel.Name = "tileLabel"; - this.tileLabel.Size = new System.Drawing.Size(57, 19); - this.tileLabel.TabIndex = 20; - this.tileLabel.Text = "tileLabel"; - this.tileLabel.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // pictureBox1 - // - this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.AnimationStartStopBtn.Location = new System.Drawing.Point(157, 317); + this.AnimationStartStopBtn.Name = "AnimationStartStopBtn"; + this.AnimationStartStopBtn.Size = new System.Drawing.Size(232, 24); + this.AnimationStartStopBtn.Style = MetroFramework.MetroColorStyle.White; + this.AnimationStartStopBtn.TabIndex = 18; + this.AnimationStartStopBtn.Text = "Play Animation"; + this.AnimationStartStopBtn.Theme = MetroFramework.MetroThemeStyle.Dark; + this.AnimationStartStopBtn.UseSelectable = true; + this.AnimationStartStopBtn.Click += new System.EventHandler(this.AnimationStartStopBtn_Click); + // + // tileLabel + // + this.tileLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.tileLabel.AutoSize = true; + this.tileLabel.Location = new System.Drawing.Point(20, 341); + this.tileLabel.MinimumSize = new System.Drawing.Size(170, 19); + this.tileLabel.Name = "tileLabel"; + this.tileLabel.Size = new System.Drawing.Size(57, 19); + this.tileLabel.TabIndex = 20; + this.tileLabel.Text = "tileLabel"; + this.tileLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox1.Location = new System.Drawing.Point(154, 60); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(238, 24); - this.pictureBox1.TabIndex = 21; - this.pictureBox1.TabStop = false; - // - // animationPictureBox - // - this.animationPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.pictureBox1.Location = new System.Drawing.Point(154, 60); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(238, 24); + this.pictureBox1.TabIndex = 21; + this.pictureBox1.TabStop = false; + // + // animationPictureBox + // + this.animationPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.animationPictureBox.Location = new System.Drawing.Point(157, 88); - this.animationPictureBox.Name = "animationPictureBox"; - this.animationPictureBox.Size = new System.Drawing.Size(235, 223); - this.animationPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.animationPictureBox.TabIndex = 16; - this.animationPictureBox.TabStop = false; - // - // AnimationEditor - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(412, 362); - this.Controls.Add(this.InterpolationCheckbox); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.AnimationStartStopBtn); - this.Controls.Add(this.tileLabel); - this.Controls.Add(this.animationPictureBox); - this.Controls.Add(this.frameTreeView); - this.Controls.Add(this.menuStrip); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(412, 362); - this.Name = "AnimationEditor"; - this.Style = MetroFramework.MetroColorStyle.Silver; - this.Text = "Animation Editor"; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AnimationEditor_FormClosing); - this.contextMenuStrip1.ResumeLayout(false); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.animationPictureBox)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.animationPictureBox.Location = new System.Drawing.Point(157, 88); + this.animationPictureBox.Name = "animationPictureBox"; + this.animationPictureBox.Size = new System.Drawing.Size(235, 223); + this.animationPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.animationPictureBox.TabIndex = 16; + this.animationPictureBox.TabStop = false; + // + // frameTimeandTicksToolStripMenuItem + // + this.frameTimeandTicksToolStripMenuItem.Name = "frameTimeandTicksToolStripMenuItem"; + this.frameTimeandTicksToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.frameTimeandTicksToolStripMenuItem.Text = "Frame Time (and Ticks)"; + this.frameTimeandTicksToolStripMenuItem.Click += new System.EventHandler(this.frameTimeandTicksToolStripMenuItem_Click); + // + // AnimationEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(412, 362); + this.Controls.Add(this.InterpolationCheckbox); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.AnimationStartStopBtn); + this.Controls.Add(this.tileLabel); + this.Controls.Add(this.animationPictureBox); + this.Controls.Add(this.frameTreeView); + this.Controls.Add(this.menuStrip); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimumSize = new System.Drawing.Size(412, 362); + this.Name = "AnimationEditor"; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Text = "Animation Editor"; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AnimationEditor_FormClosing); + this.contextMenuStrip1.ResumeLayout(false); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.animationPictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -396,5 +405,6 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem importAnimationTextureToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem gifToolStripMenuItem; - } + private System.Windows.Forms.ToolStripMenuItem frameTimeandTicksToolStripMenuItem; + } } \ No newline at end of file diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index b46e9fe1..5b7256bd 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -78,7 +78,7 @@ namespace PckStudio.Forms.Editor foreach (var frame in currentAnimation.GetFrames()) { var imageIndex = currentAnimation.GetTextureIndex(frame.Texture); - frameTreeView.Nodes.Add(new TreeNode($"for {frame.Ticks} frames") + frameTreeView.Nodes.Add(new TreeNode($"for {frame.Ticks} ticks") { ImageIndex = imageIndex, SelectedImageIndex = imageIndex, @@ -371,10 +371,23 @@ namespace PckStudio.Forms.Editor if (first is JProperty p) { tileLabel.Text = (string)p.Value; - break; + return; } } - } + + switch(MessageBox.Show(this, + $"{TileName} is not a valid tile for animation, and will not play in game. Would you like to choose a new tile?", + "Not a valid tile", + MessageBoxButtons.YesNo)) + { + case DialogResult.Yes: + changeTileToolStripMenuItem_Click(null, null); + break; + default: + DialogResult = DialogResult.Abort; + break; + } + } private void exportJavaAnimationToolStripMenuItem_Click(object sender, EventArgs e) { @@ -395,13 +408,13 @@ namespace PckStudio.Forms.Editor private void howToInterpolation_Click(object sender, EventArgs e) { - MessageBox.Show("The Interpolation effect is when the animtion smoothly translates between the frames instead of simply displaying the next one. This can be seen with some vanilla Minecraft textures such as Magma and Prismarine.\n\nThe \"Interpolates\" checkbox above the animation controls this.", "Interpolation"); + MessageBox.Show("The Interpolation effect is when the animtion smoothly translates between the frames instead of simply displaying the next one. This can be seen with some vanilla Minecraft textures such as Magma and Prismarine.", "Interpolation"); } private void editorControlsToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("Simply drag and drop frames in the tree to rearrange your animation.\n\n" + - "You can also preview your animation at any time by simply pressing the \"Play Animation\" button!", "Editor Controls"); + "You can also preview your animation at any time by simply pressing the button under the animation display.", "Editor Controls"); } private void setBulkSpeedToolStripMenuItem_Click(object sender, EventArgs e) @@ -483,14 +496,17 @@ namespace PckStudio.Forms.Editor private void gifToolStripMenuItem_Click(object sender, EventArgs e) { - var fileDialog = new SaveFileDialog() - { - Filter = "GIF file|*.gif" - }; - if (fileDialog.ShowDialog(this) != DialogResult.OK) - return; + MessageBox.Show(this, "This feature is still under development", "Coming soon"); + return; // TODO + //var fileDialog = new SaveFileDialog() + //{ + // Filter = "GIF file|*.gif" + //}; + //if (fileDialog.ShowDialog(this) != DialogResult.OK) + // return; + //GifBitmapEncoder gifBitmapEncoder = new GifBitmapEncoder(); //foreach (Bitmap texture in currentAnimation.GetTextures()) @@ -510,5 +526,12 @@ namespace PckStudio.Forms.Editor // gifBitmapEncoder.Save(fs); //} } - } + + private void frameTimeandTicksToolStripMenuItem_Click(object sender, EventArgs e) + { + MessageBox.Show(this, "The frame time is the time that the current frame is displayed for. This unit is measured in ticks. " + + "All time related functions in Minecraft use ticks, notably redstone repeaters. There are 20 ticks in 1 second, so " + + "1 tick is 1/20 of a second. To find how long your frame is, divide the frame time by 20", "Frame Time and Ticks"); + } + } } diff --git a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs index 61e2e1f7..8ade989b 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.Designer.cs @@ -28,148 +28,158 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvancedOptions)); - this.treeMeta = new System.Windows.Forms.TreeView(); - this.comboBox1 = new MetroFramework.Controls.MetroComboBox(); - this.label1 = new System.Windows.Forms.Label(); - this.applyButton = new MetroFramework.Controls.MetroButton(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox(); - this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox(); - this.SuspendLayout(); - // - // treeMeta - // - resources.ApplyResources(this.treeMeta, "treeMeta"); - this.treeMeta.Name = "treeMeta"; - this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect); - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - resources.ApplyResources(this.comboBox1, "comboBox1"); - this.comboBox1.Items.AddRange(new object[] { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvancedOptions)); + this.treeMeta = new System.Windows.Forms.TreeView(); + this.comboBox1 = new MetroFramework.Controls.MetroComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.applyButton = new MetroFramework.Controls.MetroButton(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox(); + this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox(); + this.SuspendLayout(); + // + // treeMeta + // + resources.ApplyResources(this.treeMeta, "treeMeta"); + this.treeMeta.Name = "treeMeta"; + this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect); + // + // 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")}); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Style = MetroFramework.MetroColorStyle.Silver; - this.comboBox1.Theme = MetroFramework.MetroThemeStyle.Dark; - this.comboBox1.UseSelectable = true; - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Name = "label1"; - // - // applyButton - // - 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 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Name = "label2"; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.ForeColor = System.Drawing.Color.White; - this.label3.Name = "label3"; - // - // entryDataTextBox - // - // - // - // - 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.entryDataTextBox); - this.Controls.Add(this.applyButton); - this.Controls.Add(this.label1); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.treeMeta); - 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.TopMost = true; - this.ResumeLayout(false); - this.PerformLayout(); + resources.GetString("comboBox1.Items3"), + resources.GetString("comboBox1.Items4"), + resources.GetString("comboBox1.Items5"), + resources.GetString("comboBox1.Items6"), + resources.GetString("comboBox1.Items7"), + resources.GetString("comboBox1.Items8"), + resources.GetString("comboBox1.Items9"), + resources.GetString("comboBox1.Items10"), + resources.GetString("comboBox1.Items11"), + resources.GetString("comboBox1.Items12"), + resources.GetString("comboBox1.Items13")}); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Style = MetroFramework.MetroColorStyle.Silver; + this.comboBox1.Theme = MetroFramework.MetroThemeStyle.Dark; + this.comboBox1.UseSelectable = true; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Name = "label1"; + // + // applyButton + // + 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 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.ForeColor = System.Drawing.Color.White; + this.label2.Name = "label2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.ForeColor = System.Drawing.Color.White; + this.label3.Name = "label3"; + // + // entryDataTextBox + // + // + // + // + 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"))); + this.entryTypeTextBox.Lines = new string[0]; + resources.ApplyResources(this.entryTypeTextBox, "entryTypeTextBox"); + 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.entryDataTextBox); + this.Controls.Add(this.applyButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.treeMeta); + 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.TopMost = true; + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs index c34dfba0..b57b4386 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs @@ -1,4 +1,5 @@ using OMI.Formats.Pck; +using OMI.Workers.Pck; using System; using System.Data; using System.Drawing; @@ -11,6 +12,7 @@ namespace PckStudio public partial class AdvancedOptions : MetroFramework.Forms.MetroForm { PckFile currentPCK; + public bool littleEndian; public AdvancedOptions(PckFile currentPCKIn) { @@ -22,64 +24,104 @@ namespace PckStudio private void applyButton_Click(object sender, EventArgs e) { - switch (comboBox1.Text) + switch (comboBox1.SelectedIndex) { - case "All": + case 0: { - foreach (PckFile.FileData file in currentPCK.Files) - { - file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); - } - MessageBox.Show("Data Added to All Entries"); + applyBulkProperties(); + DialogResult = DialogResult.OK; } break; - case "64x64": + case > 0 and <= 13: { - foreach (PckFile.FileData file in currentPCK.Files) - { - MemoryStream png = new MemoryStream(file.Data); - if (Path.GetExtension(file.Filename) == ".png" && - Image.FromStream(png).Size.Height == Image.FromStream(png).Size.Width) - { - file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); - } - } - MessageBox.Show("Data Added to 64x64 Image Entries"); - } - break; - case "64x32": - { - foreach (PckFile.FileData file in currentPCK.Files) - { - MemoryStream png = new MemoryStream(file.Data); - if (Path.GetExtension(file.Filename) == ".png" && - Image.FromStream(png).Size.Height == Image.FromStream(png).Size.Width / 2) - { - file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); - } - } - MessageBox.Show("Data Added to 64x32 Image Entries"); - } - break; - case "PNG Files": - { - foreach (PckFile.FileData file in currentPCK.Files) - { - MemoryStream png = new MemoryStream(file.Data); - if (Path.GetExtension(file.Filename) == ".png") - { - file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); - } - } - MessageBox.Show("Data Added to All PNG Image Entries"); + applyBulkProperties((PckFile.FileData.FileType)(comboBox1.SelectedIndex - 1)); + DialogResult = DialogResult.OK; } break; default: - MessageBox.Show("Please Select an Application Argument"); + MessageBox.Show("Please select a filetype before applying"); break; } } + private void applyBulkProperties() + { + foreach (PckFile.FileData file in currentPCK.Files) + { + if (file.Filetype == PckFile.FileData.FileType.TexturePackInfoFile || + file.Filetype == PckFile.FileData.FileType.SkinDataFile) + { + try + { + var reader = new PckFileReader(littleEndian + ? OMI.Endianness.LittleEndian + : OMI.Endianness.BigEndian); + PckFile SubPCK = reader.FromStream(new MemoryStream(file.Data)); + foreach (PckFile.FileData SubFile in SubPCK.Files) + { + SubFile.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); + } + var writer = new PckFileWriter(SubPCK, littleEndian + ? OMI.Endianness.LittleEndian + : OMI.Endianness.BigEndian); + var stream = new MemoryStream(); + writer.WriteToStream(stream); + file.SetData(stream.ToArray()); + stream.Dispose(); + } + catch (OverflowException ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + } + } + + file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); + } + MessageBox.Show("Data added to all entries"); + } + + private void applyBulkProperties(PckFile.FileData.FileType filetype) + { + foreach (PckFile.FileData file in currentPCK.Files) + { + if (file.Filetype == PckFile.FileData.FileType.TexturePackInfoFile || + file.Filetype == PckFile.FileData.FileType.SkinDataFile) + { + try + { + var reader = new PckFileReader(littleEndian + ? OMI.Endianness.LittleEndian + : OMI.Endianness.BigEndian); + PckFile SubPCK = reader.FromStream(new MemoryStream(file.Data)); + foreach (PckFile.FileData SubFile in SubPCK.Files) + { + if (SubFile.Filetype == filetype) + { + SubFile.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); + } + } + var writer = new PckFileWriter(SubPCK, littleEndian + ? OMI.Endianness.LittleEndian + : OMI.Endianness.BigEndian); + var stream = new MemoryStream(); + writer.WriteToStream(stream); + file.SetData(stream.ToArray()); + stream.Dispose(); + } + catch (OverflowException ex) + { + System.Diagnostics.Debug.WriteLine(ex.Message); + } + } + + if (file.Filetype == filetype) + { + file.Properties.Add(entryTypeTextBox.Text, entryDataTextBox.Text); + } + } + MessageBox.Show($"Data Added to {filetype} File Entries"); + } + private void treeMeta_AfterSelect(object sender, TreeViewEventArgs e) { 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 d7c42b3c..c863ac5a 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.resx +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.resx @@ -144,22 +144,52 @@ 23 - All + All Files - 64x64 + Skin Files (.png;.tga) - 64x32 + Cape Files (.png;.tga) - PNG Files + Texture Files (.png;.tga) + + + UI Data Files (?) + + + Info Files (0) + + + Texture Pack Info Files (.pck) + + + Localization Files (.loc) + + + Game Rules Files (.grf) + + + Audio Files (.pck) + + + Colour Table Files (.col) + + + Game Rules Header Files (.grh) + + + Skin Data Files (.pck) + + + Material Files (.bin) - 71, 254 + 65, 254 - 82, 29 + 157, 29 1 @@ -336,9 +366,6 @@ False - - False - 19, 224 diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index e404abf3..2e4df64a 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -183,8 +183,9 @@ namespace PckStudio } catch { - MessageBox.Show("Failed to open pck\n" + - "If this is an Audio/Music Cues pck, please use the specialized editor while inside of the parent pck.", + MessageBox.Show("Failed to open pck. There's two common reasons for this:\n" + + "1. The file is audio/music cues PCK file. Please use the specialized editor while inside of a pck file.\n" + + "2. We're aware of an issue where a pck file might fail to load because it contains multiple entries with the same path.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return null; @@ -1324,8 +1325,12 @@ namespace PckStudio { //opens dialog for bulk minefile editing using AdvancedOptions advanced = new AdvancedOptions(currentPCK); + advanced.littleEndian = LittleEndianCheckBox.Checked; if (advanced.ShowDialog() == DialogResult.OK) + { wasModified = true; + BuildMainTreeView(); + } } private void closeToolStripMenuItem_Click(object sender, EventArgs e)