From 4ec72d46393449e8e641988b620c6feb3b827e21 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Sun, 11 Dec 2022 14:42:30 +0100 Subject: [PATCH 01/21] - removed unused using statements - expanded layout - added chaining window - fixed naming violations on all Modules - Made more validity checks for path variable and file name variable - Enabled fov again on spiral move - Enabled ease again on spiral move - Removed unused code --- MovementScriptGenerator/Circle.cs | 78 -- MovementScriptGenerator/CircleControl.cs | 30 +- MovementScriptGenerator/Form1.Designer.cs | 859 ++++++++++++------ MovementScriptGenerator/Form1.cs | 152 +++- MovementScriptGenerator/Form1.resx | 7 +- MovementScriptGenerator/Modules/Chain.cs | 9 + .../Modules/ChainElement.cs | 12 + MovementScriptGenerator/Modules/Frame.cs | 19 +- MovementScriptGenerator/Modules/Move.cs | 22 + .../Modules/MovementScript.cs | 12 +- .../Modules/Moves/Circle.cs | 95 ++ .../Modules/Moves/Spiral.cs | 185 ++++ MovementScriptGenerator/Modules/Position.cs | 13 +- MovementScriptGenerator/Modules/Rotation.cs | 13 +- .../MovementScriptGenerator.csproj | 11 +- MovementScriptGenerator/Spiral.cs | 229 ----- .../SpiralControl.Designer.cs | 50 +- MovementScriptGenerator/SpiralControl.cs | 47 +- 18 files changed, 1079 insertions(+), 764 deletions(-) delete mode 100644 MovementScriptGenerator/Circle.cs create mode 100644 MovementScriptGenerator/Modules/Chain.cs create mode 100644 MovementScriptGenerator/Modules/ChainElement.cs create mode 100644 MovementScriptGenerator/Modules/Move.cs create mode 100644 MovementScriptGenerator/Modules/Moves/Circle.cs create mode 100644 MovementScriptGenerator/Modules/Moves/Spiral.cs delete mode 100644 MovementScriptGenerator/Spiral.cs diff --git a/MovementScriptGenerator/Circle.cs b/MovementScriptGenerator/Circle.cs deleted file mode 100644 index 64b3d97..0000000 --- a/MovementScriptGenerator/Circle.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MovementScriptGenerator.Modules; - -namespace MovementScriptGenerator -{ - class Circle - { - public List GenerateFrames( - int fov, - float duration, - float rotX, - float rotZ, - float distance, - float startingPointDegree, - float sectorDegrees, - int iterations, - float height, - bool rotateClockwise - ) - { - List frames = new List(); - - float initialDegree = 0; - float maxDegrees = sectorDegrees - 1; - //float maxDegrees = 359; - float initialDegreeAddend = 1; - - if (!rotateClockwise) { - initialDegree *= -1; - maxDegrees *= -1; - initialDegreeAddend *= -1; - } - - for (float i = initialDegree; (rotateClockwise && i <= maxDegrees) || (!rotateClockwise && i >= maxDegrees); i += (float)initialDegreeAddend / iterations) - { - float usedDegree = i + startingPointDegree; - double radiant = usedDegree * Math.PI / 180; - - Frame frame = new Frame(); - frame.position = new Position(); - frame.rotation = new Rotation(); - - frame.position.x = (float)Math.Sin(radiant) * distance; - frame.position.y = height; - frame.position.z = (float)Math.Cos(radiant) * distance; - - frame.rotation.z = rotZ; - frame.rotation.x = rotX; - frame.rotation.y = usedDegree -180; - - if (usedDegree == 0 || usedDegree == 180 || usedDegree == 360) - { - frame.position.x = 0; - } - if (usedDegree == 90 || usedDegree == 270) - { - frame.position.z = 0; - } - - - frame.duration = duration / Math.Abs(maxDegrees) / iterations; - - if(fov > 0) - { - frame.fov = fov; - } - - frames.Add(frame); - } - - return frames; - } - } -} diff --git a/MovementScriptGenerator/CircleControl.cs b/MovementScriptGenerator/CircleControl.cs index dd566de..9b24f77 100644 --- a/MovementScriptGenerator/CircleControl.cs +++ b/MovementScriptGenerator/CircleControl.cs @@ -1,19 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using System.Windows.Forms; -using MovementScriptGenerator.Modules; namespace MovementScriptGenerator { public partial class CircleControl : UserControl { - private static Circle circle = new Circle(); List rotationTypes = new List() { @@ -33,28 +24,23 @@ private void initializeComboBoxes() cbRotation.SelectedIndex = 0; } - public MovementScript CreateMovementScript() + public Circle CreateMove(string moveName) { - MovementScript movementScript = new MovementScript(); - bool rotateClockwise = false; - if (cbRotation.SelectedIndex == 0) - { - rotateClockwise = true; - } - movementScript.frames = circle.GenerateFrames( + Circle circle = new Circle( + moveName, (int)numFOV.Value, (float)numDuration.Value, + (float)numHeight.Value, (float)numRotX.Value, (float)numRotZ.Value, (float)numDistance.Value, (float)numStartingPoint.Value, (float)numSector.Value, (int)numIterations.Value, - (float)numHeight.Value, - rotateClockwise - ); + cbRotation.SelectedIndex == 0 ? true : false + ); - return movementScript; + return circle; } } } diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index fff6806..be0d19f 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -33,10 +33,32 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.lblTitle = new System.Windows.Forms.Label(); + this.tableLayoutPanel13 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel14 = new System.Windows.Forms.TableLayoutPanel(); + this.label2 = new System.Windows.Forms.Label(); + this.tableLayoutPanel15 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel11 = new System.Windows.Forms.TableLayoutPanel(); + this.txtPath = new System.Windows.Forms.TextBox(); + this.lblPath = new System.Windows.Forms.Label(); + this.btnGenerateScript = new System.Windows.Forms.Button(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.txtFileName = new System.Windows.Forms.TextBox(); + this.lblFileName = new System.Windows.Forms.Label(); + this.tableLayoutPanel10 = new System.Windows.Forms.TableLayoutPanel(); + this.lblSyncToSong = new System.Windows.Forms.Label(); + this.checkSyncToSong = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); + this.lblLoop = new System.Windows.Forms.Label(); + this.checkLoop = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel12 = new System.Windows.Forms.TableLayoutPanel(); + this.lblAddToScript = new System.Windows.Forms.Label(); + this.checkAddToScript = new System.Windows.Forms.CheckBox(); + this.tvChain = new System.Windows.Forms.TreeView(); + this.tableLayoutPanel16 = new System.Windows.Forms.TableLayoutPanel(); + this.btnAddMoveToChain = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); this.flpContent = new System.Windows.Forms.FlowLayoutPanel(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.cbType = new System.Windows.Forms.ComboBox(); - this.lblType = new System.Windows.Forms.Label(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); this.lblMoveDescriptionTitle = new System.Windows.Forms.Label(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); @@ -46,135 +68,449 @@ private void InitializeComponent() this.lblSettingsTitle = new System.Windows.Forms.Label(); this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel(); this.lblDescription = new System.Windows.Forms.Label(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.txtName = new System.Windows.Forms.TextBox(); - this.lblName = new System.Windows.Forms.Label(); this.tlContent = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel10 = new System.Windows.Forms.TableLayoutPanel(); - this.lblSyncToSong = new System.Windows.Forms.Label(); - this.checkSyncToSong = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel12 = new System.Windows.Forms.TableLayoutPanel(); - this.lblAddToScript = new System.Windows.Forms.Label(); - this.checkAddToScript = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); - this.btnGenerate = new System.Windows.Forms.Button(); - this.tableLayoutPanel11 = new System.Windows.Forms.TableLayoutPanel(); - this.txtPath = new System.Windows.Forms.TextBox(); - this.lblPath = new System.Windows.Forms.Label(); + this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.cbType = new System.Windows.Forms.ComboBox(); + this.lblType = new System.Windows.Forms.Label(); + this.tableLayoutPanel17 = new System.Windows.Forms.TableLayoutPanel(); + this.txtMoveName = new System.Windows.Forms.TextBox(); + this.lblMoveName = new System.Windows.Forms.Label(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel13.SuspendLayout(); + this.tableLayoutPanel14.SuspendLayout(); + this.tableLayoutPanel15.SuspendLayout(); + this.tableLayoutPanel11.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel10.SuspendLayout(); + this.tableLayoutPanel9.SuspendLayout(); + this.tableLayoutPanel12.SuspendLayout(); + this.tableLayoutPanel16.SuspendLayout(); this.flpContent.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); this.tableLayoutPanel7.SuspendLayout(); this.tableLayoutPanel6.SuspendLayout(); this.tableLayoutPanel8.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel10.SuspendLayout(); - this.tableLayoutPanel12.SuspendLayout(); - this.tableLayoutPanel9.SuspendLayout(); - this.tableLayoutPanel11.SuspendLayout(); + this.flowLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.tableLayoutPanel17.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 3; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel1.Controls.Add(this.lblTitle, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.flpContent, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel11, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel13, 1, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 80F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(384, 811); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 7.5F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 87.5F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(954, 811); this.tableLayoutPanel1.TabIndex = 2; // // lblTitle // - this.lblTitle.Anchor = System.Windows.Forms.AnchorStyles.None; this.lblTitle.AutoSize = true; + this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill; this.lblTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.Location = new System.Drawing.Point(44, 26); + this.lblTitle.Location = new System.Drawing.Point(23, 0); this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(295, 29); + this.lblTitle.Size = new System.Drawing.Size(908, 60); this.lblTitle.TabIndex = 0; this.lblTitle.Text = "MovementScriptGenerator"; + this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // tableLayoutPanel13 + // + this.tableLayoutPanel13.ColumnCount = 2; + this.tableLayoutPanel13.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 300F)); + this.tableLayoutPanel13.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel13.Controls.Add(this.tableLayoutPanel14, 1, 0); + this.tableLayoutPanel13.Controls.Add(this.tableLayoutPanel16, 0, 0); + this.tableLayoutPanel13.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel13.Location = new System.Drawing.Point(23, 63); + this.tableLayoutPanel13.Name = "tableLayoutPanel13"; + this.tableLayoutPanel13.RowCount = 1; + this.tableLayoutPanel13.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel13.Size = new System.Drawing.Size(908, 703); + this.tableLayoutPanel13.TabIndex = 7; + // + // tableLayoutPanel14 + // + this.tableLayoutPanel14.ColumnCount = 1; + this.tableLayoutPanel14.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel14.Controls.Add(this.label2, 0, 0); + this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel15, 0, 3); + this.tableLayoutPanel14.Controls.Add(this.flowLayoutPanel1, 0, 1); + this.tableLayoutPanel14.Controls.Add(this.tvChain, 0, 2); + this.tableLayoutPanel14.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel14.Location = new System.Drawing.Point(303, 0); + this.tableLayoutPanel14.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); + this.tableLayoutPanel14.Name = "tableLayoutPanel14"; + this.tableLayoutPanel14.RowCount = 4; + this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F)); + this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel14.Size = new System.Drawing.Size(605, 703); + this.tableLayoutPanel14.TabIndex = 4; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Dock = System.Windows.Forms.DockStyle.Fill; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(3, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(599, 35); + this.label2.TabIndex = 5; + this.label2.Text = "Move Chain"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tableLayoutPanel15 + // + this.tableLayoutPanel15.ColumnCount = 2; + this.tableLayoutPanel15.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); + this.tableLayoutPanel15.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel15.Controls.Add(this.tableLayoutPanel11, 0, 0); + this.tableLayoutPanel15.Controls.Add(this.btnGenerateScript, 1, 0); + this.tableLayoutPanel15.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel15.Location = new System.Drawing.Point(0, 667); + this.tableLayoutPanel15.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel15.MinimumSize = new System.Drawing.Size(0, 30); + this.tableLayoutPanel15.Name = "tableLayoutPanel15"; + this.tableLayoutPanel15.RowCount = 1; + this.tableLayoutPanel15.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel15.Size = new System.Drawing.Size(605, 36); + this.tableLayoutPanel15.TabIndex = 0; + // + // tableLayoutPanel11 + // + this.tableLayoutPanel11.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel11.ColumnCount = 2; + this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel11.Controls.Add(this.txtPath, 1, 0); + this.tableLayoutPanel11.Controls.Add(this.lblPath, 0, 0); + this.tableLayoutPanel11.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel11.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel11.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel11.Name = "tableLayoutPanel11"; + this.tableLayoutPanel11.RowCount = 1; + this.tableLayoutPanel11.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel11.Size = new System.Drawing.Size(484, 36); + this.tableLayoutPanel11.TabIndex = 6; + // + // txtPath + // + this.txtPath.Dock = System.Windows.Forms.DockStyle.Bottom; + this.txtPath.Location = new System.Drawing.Point(43, 13); + this.txtPath.Name = "txtPath"; + this.txtPath.Size = new System.Drawing.Size(438, 20); + this.txtPath.TabIndex = 1; + this.txtPath.Text = "D:\\SteamLibrary\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScripts\\"; + // + // lblPath + // + this.lblPath.AutoSize = true; + this.lblPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblPath.Location = new System.Drawing.Point(3, 0); + this.lblPath.Name = "lblPath"; + this.lblPath.Size = new System.Drawing.Size(34, 36); + this.lblPath.TabIndex = 0; + this.lblPath.Text = "Path:"; + this.lblPath.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + this.ToolTip.SetToolTip(this.lblPath, "Only edit this if you want to change the directory/path where the file will be sa" + + "ved"); + // + // btnGenerateScript + // + this.btnGenerateScript.Location = new System.Drawing.Point(487, 3); + this.btnGenerateScript.Name = "btnGenerateScript"; + this.btnGenerateScript.Size = new System.Drawing.Size(97, 30); + this.btnGenerateScript.TabIndex = 1; + this.btnGenerateScript.Text = "Generate Script"; + this.btnGenerateScript.UseVisualStyleBackColor = true; + this.btnGenerateScript.Click += new System.EventHandler(this.btnGenerateScript_Click); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel2); + this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel10); + this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel9); + this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel12); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 35); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(0, 30); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(605, 35); + this.flowLayoutPanel1.TabIndex = 6; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.AutoSize = true; + this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel2.ColumnCount = 2; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); + this.tableLayoutPanel2.Controls.Add(this.txtFileName, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.lblFileName, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel2.MinimumSize = new System.Drawing.Size(0, 26); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(221, 26); + this.tableLayoutPanel2.TabIndex = 2; + // + // txtFileName + // + this.txtFileName.Location = new System.Drawing.Point(69, 3); + this.txtFileName.Name = "txtFileName"; + this.txtFileName.Size = new System.Drawing.Size(149, 20); + this.txtFileName.TabIndex = 1; + // + // lblFileName + // + this.lblFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblFileName.AutoSize = true; + this.lblFileName.Location = new System.Drawing.Point(3, 0); + this.lblFileName.Name = "lblFileName"; + this.lblFileName.Size = new System.Drawing.Size(54, 26); + this.lblFileName.TabIndex = 0; + this.lblFileName.Text = "File Name"; + this.lblFileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblFileName, "defines the name of movement script file that will be generated / added to.\r\nAdd " + + "this name to the script list in your camera script to make the camera use this s" + + "cript.\r\n"); + // + // tableLayoutPanel10 + // + this.tableLayoutPanel10.AutoSize = true; + this.tableLayoutPanel10.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel10.ColumnCount = 2; + this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel10.Controls.Add(this.lblSyncToSong, 0, 0); + this.tableLayoutPanel10.Controls.Add(this.checkSyncToSong, 1, 0); + this.tableLayoutPanel10.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel10.Location = new System.Drawing.Point(230, 3); + this.tableLayoutPanel10.MinimumSize = new System.Drawing.Size(0, 26); + this.tableLayoutPanel10.Name = "tableLayoutPanel10"; + this.tableLayoutPanel10.RowCount = 1; + this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel10.Size = new System.Drawing.Size(102, 26); + this.tableLayoutPanel10.TabIndex = 4; + // + // lblSyncToSong + // + this.lblSyncToSong.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblSyncToSong.AutoSize = true; + this.lblSyncToSong.Location = new System.Drawing.Point(3, 0); + this.lblSyncToSong.Name = "lblSyncToSong"; + this.lblSyncToSong.Size = new System.Drawing.Size(75, 26); + this.lblSyncToSong.TabIndex = 1; + this.lblSyncToSong.Text = "Sync To Song"; + this.lblSyncToSong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblSyncToSong, resources.GetString("lblSyncToSong.ToolTip")); + // + // checkSyncToSong + // + this.checkSyncToSong.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.checkSyncToSong.AutoSize = true; + this.checkSyncToSong.Checked = true; + this.checkSyncToSong.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkSyncToSong.Location = new System.Drawing.Point(84, 3); + this.checkSyncToSong.Name = "checkSyncToSong"; + this.checkSyncToSong.Size = new System.Drawing.Size(15, 20); + this.checkSyncToSong.TabIndex = 1; + this.checkSyncToSong.UseVisualStyleBackColor = true; + // + // tableLayoutPanel9 + // + this.tableLayoutPanel9.AutoSize = true; + this.tableLayoutPanel9.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel9.ColumnCount = 2; + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.Controls.Add(this.lblLoop, 0, 0); + this.tableLayoutPanel9.Controls.Add(this.checkLoop, 1, 0); + this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel9.Location = new System.Drawing.Point(338, 3); + this.tableLayoutPanel9.MinimumSize = new System.Drawing.Size(0, 26); + this.tableLayoutPanel9.Name = "tableLayoutPanel9"; + this.tableLayoutPanel9.RowCount = 1; + this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel9.Size = new System.Drawing.Size(58, 26); + this.tableLayoutPanel9.TabIndex = 6; + // + // lblLoop + // + this.lblLoop.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblLoop.AutoSize = true; + this.lblLoop.Location = new System.Drawing.Point(3, 0); + this.lblLoop.Name = "lblLoop"; + this.lblLoop.Size = new System.Drawing.Size(31, 26); + this.lblLoop.TabIndex = 1; + this.lblLoop.Text = "Loop"; + this.lblLoop.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblLoop, "On -> The movement script will repeat from the start, if the last move is finishe" + + "d.\r\nOff -> The camera will stay on the end position of the last move."); + // + // checkLoop + // + this.checkLoop.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.checkLoop.AutoSize = true; + this.checkLoop.Checked = true; + this.checkLoop.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkLoop.Location = new System.Drawing.Point(40, 3); + this.checkLoop.Name = "checkLoop"; + this.checkLoop.Size = new System.Drawing.Size(15, 20); + this.checkLoop.TabIndex = 1; + this.checkLoop.UseVisualStyleBackColor = true; + // + // tableLayoutPanel12 + // + this.tableLayoutPanel12.AutoSize = true; + this.tableLayoutPanel12.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel12.ColumnCount = 2; + this.tableLayoutPanel12.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel12.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel12.Controls.Add(this.lblAddToScript, 0, 0); + this.tableLayoutPanel12.Controls.Add(this.checkAddToScript, 1, 0); + this.tableLayoutPanel12.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel12.Location = new System.Drawing.Point(402, 3); + this.tableLayoutPanel12.MinimumSize = new System.Drawing.Size(0, 26); + this.tableLayoutPanel12.Name = "tableLayoutPanel12"; + this.tableLayoutPanel12.RowCount = 1; + this.tableLayoutPanel12.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel12.Size = new System.Drawing.Size(137, 26); + this.tableLayoutPanel12.TabIndex = 5; + // + // lblAddToScript + // + this.lblAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblAddToScript.AutoSize = true; + this.lblAddToScript.Location = new System.Drawing.Point(3, 0); + this.lblAddToScript.Name = "lblAddToScript"; + this.lblAddToScript.Size = new System.Drawing.Size(110, 26); + this.lblAddToScript.TabIndex = 1; + this.lblAddToScript.Text = "Add To existing Script"; + this.lblAddToScript.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblAddToScript, resources.GetString("lblAddToScript.ToolTip")); + // + // checkAddToScript + // + this.checkAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.checkAddToScript.AutoSize = true; + this.checkAddToScript.Location = new System.Drawing.Point(119, 3); + this.checkAddToScript.Name = "checkAddToScript"; + this.checkAddToScript.Size = new System.Drawing.Size(15, 20); + this.checkAddToScript.TabIndex = 1; + this.checkAddToScript.UseVisualStyleBackColor = true; + // + // tvChain + // + this.tvChain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tvChain.Location = new System.Drawing.Point(3, 73); + this.tvChain.Name = "tvChain"; + this.tvChain.Size = new System.Drawing.Size(599, 591); + this.tvChain.TabIndex = 7; + // + // tableLayoutPanel16 + // + this.tableLayoutPanel16.ColumnCount = 1; + this.tableLayoutPanel16.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel16.Controls.Add(this.btnAddMoveToChain, 0, 3); + this.tableLayoutPanel16.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel16.Controls.Add(this.flpContent, 0, 2); + this.tableLayoutPanel16.Controls.Add(this.flowLayoutPanel2, 0, 1); + this.tableLayoutPanel16.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel16.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel16.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.tableLayoutPanel16.Name = "tableLayoutPanel16"; + this.tableLayoutPanel16.RowCount = 4; + this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F)); + this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tableLayoutPanel16.Size = new System.Drawing.Size(297, 703); + this.tableLayoutPanel16.TabIndex = 5; + // + // btnAddMoveToChain + // + this.btnAddMoveToChain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.btnAddMoveToChain.Location = new System.Drawing.Point(3, 670); + this.btnAddMoveToChain.Name = "btnAddMoveToChain"; + this.btnAddMoveToChain.Size = new System.Drawing.Size(82, 30); + this.btnAddMoveToChain.TabIndex = 2; + this.btnAddMoveToChain.Text = "Add To Chain"; + this.btnAddMoveToChain.UseVisualStyleBackColor = true; + this.btnAddMoveToChain.Click += new System.EventHandler(this.btnAddMoveToChain_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(3, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(291, 35); + this.label1.TabIndex = 4; + this.label1.Text = "Move"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // flpContent // this.flpContent.AutoScroll = true; - this.flpContent.Controls.Add(this.tableLayoutPanel4); this.flpContent.Controls.Add(this.tableLayoutPanel5); this.flpContent.Controls.Add(this.tableLayoutPanel3); this.flpContent.Controls.Add(this.tableLayoutPanel7); this.flpContent.Controls.Add(this.tableLayoutPanel6); this.flpContent.Controls.Add(this.tableLayoutPanel8); - this.flpContent.Controls.Add(this.tableLayoutPanel2); this.flpContent.Controls.Add(this.tlContent); - this.flpContent.Controls.Add(this.tableLayoutPanel10); - this.flpContent.Controls.Add(this.tableLayoutPanel12); - this.flpContent.Controls.Add(this.tableLayoutPanel9); - this.flpContent.Location = new System.Drawing.Point(41, 84); + this.flpContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpContent.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flpContent.Location = new System.Drawing.Point(0, 70); + this.flpContent.Margin = new System.Windows.Forms.Padding(0); this.flpContent.Name = "flpContent"; - this.flpContent.Size = new System.Drawing.Size(301, 642); + this.flpContent.Size = new System.Drawing.Size(297, 597); this.flpContent.TabIndex = 3; - // - // tableLayoutPanel4 - // - this.tableLayoutPanel4.ColumnCount = 2; - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel4.Controls.Add(this.cbType, 1, 0); - this.tableLayoutPanel4.Controls.Add(this.lblType, 0, 0); - this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel4.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 1; - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel4.Size = new System.Drawing.Size(295, 26); - this.tableLayoutPanel4.TabIndex = 1; - // - // cbType - // - this.cbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbType.FormattingEnabled = true; - this.cbType.Items.AddRange(new object[] { - "circle around player"}); - this.cbType.Location = new System.Drawing.Point(91, 3); - this.cbType.Name = "cbType"; - this.cbType.Size = new System.Drawing.Size(121, 21); - this.cbType.TabIndex = 1; - this.cbType.SelectedIndexChanged += new System.EventHandler(this.cbType_SelectedIndexChanged); - // - // lblType - // - this.lblType.AutoSize = true; - this.lblType.Location = new System.Drawing.Point(3, 0); - this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(64, 13); - this.lblType.TabIndex = 1; - this.lblType.Text = "Move Type:"; + this.flpContent.WrapContents = false; // // tableLayoutPanel5 // this.tableLayoutPanel5.ColumnCount = 2; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 45.29617F)); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 54.70383F)); this.tableLayoutPanel5.Controls.Add(this.lblMoveDescriptionTitle, 0, 0); - this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 35); + this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 3); this.tableLayoutPanel5.MinimumSize = new System.Drawing.Size(0, 26); this.tableLayoutPanel5.Name = "tableLayoutPanel5"; this.tableLayoutPanel5.RowCount = 1; this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(295, 26); + this.tableLayoutPanel5.Size = new System.Drawing.Size(284, 26); this.tableLayoutPanel5.TabIndex = 28; // // lblMoveDescriptionTitle @@ -184,7 +520,7 @@ private void InitializeComponent() this.lblMoveDescriptionTitle.AutoSize = true; this.lblMoveDescriptionTitle.Location = new System.Drawing.Point(3, 0); this.lblMoveDescriptionTitle.Name = "lblMoveDescriptionTitle"; - this.lblMoveDescriptionTitle.Size = new System.Drawing.Size(82, 26); + this.lblMoveDescriptionTitle.Size = new System.Drawing.Size(122, 13); this.lblMoveDescriptionTitle.TabIndex = 24; this.lblMoveDescriptionTitle.Text = "Move Description:"; // @@ -195,12 +531,12 @@ private void InitializeComponent() this.tableLayoutPanel3.ColumnCount = 2; this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 80); + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 35); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.RowCount = 1; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 1F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(0, 0); + this.tableLayoutPanel3.Size = new System.Drawing.Size(284, 0); this.tableLayoutPanel3.TabIndex = 13; // // tableLayoutPanel7 @@ -212,13 +548,13 @@ private void InitializeComponent() this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel7.Controls.Add(this.lblMoveDescription, 0, 0); this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel7.Location = new System.Drawing.Point(9, 67); - this.tableLayoutPanel7.MaximumSize = new System.Drawing.Size(300, 0); + this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 41); + this.tableLayoutPanel7.MaximumSize = new System.Drawing.Size(285, 0); this.tableLayoutPanel7.MinimumSize = new System.Drawing.Size(0, 26); this.tableLayoutPanel7.Name = "tableLayoutPanel7"; this.tableLayoutPanel7.RowCount = 1; this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.Size = new System.Drawing.Size(251, 26); + this.tableLayoutPanel7.Size = new System.Drawing.Size(284, 26); this.tableLayoutPanel7.TabIndex = 31; // // lblMoveDescription @@ -229,9 +565,9 @@ private void InitializeComponent() this.lblMoveDescription.MaximumSize = new System.Drawing.Size(290, 0); this.lblMoveDescription.Name = "lblMoveDescription"; this.lblMoveDescription.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10); - this.lblMoveDescription.Size = new System.Drawing.Size(245, 26); + this.lblMoveDescription.Size = new System.Drawing.Size(278, 26); this.lblMoveDescription.TabIndex = 25; - this.lblMoveDescription.Text = "Description Text that is here if no description exists"; + this.lblMoveDescription.Text = "Description Placeholder"; // // tableLayoutPanel6 // @@ -239,13 +575,14 @@ private void InitializeComponent() this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); this.tableLayoutPanel6.Controls.Add(this.lblSettingsTitle, 0, 0); - this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 99); + this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 73); this.tableLayoutPanel6.MinimumSize = new System.Drawing.Size(0, 26); this.tableLayoutPanel6.Name = "tableLayoutPanel6"; this.tableLayoutPanel6.RowCount = 1; this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel6.Size = new System.Drawing.Size(295, 26); + this.tableLayoutPanel6.Size = new System.Drawing.Size(284, 26); this.tableLayoutPanel6.TabIndex = 29; // // lblSettingsTitle @@ -263,63 +600,25 @@ private void InitializeComponent() this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel8.Controls.Add(this.lblDescription, 0, 0); - this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 131); + this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 105); + this.tableLayoutPanel8.MaximumSize = new System.Drawing.Size(285, 0); this.tableLayoutPanel8.MinimumSize = new System.Drawing.Size(0, 26); this.tableLayoutPanel8.Name = "tableLayoutPanel8"; this.tableLayoutPanel8.RowCount = 1; this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel8.Size = new System.Drawing.Size(287, 26); + this.tableLayoutPanel8.Size = new System.Drawing.Size(284, 26); this.tableLayoutPanel8.TabIndex = 32; // // lblDescription // + this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill; this.lblDescription.Location = new System.Drawing.Point(3, 0); this.lblDescription.Name = "lblDescription"; - this.lblDescription.Size = new System.Drawing.Size(281, 26); + this.lblDescription.Size = new System.Drawing.Size(278, 26); this.lblDescription.TabIndex = 11; this.lblDescription.Text = "Descriptions to the settings can be found when hovering over the corresponding la" + "bels.\r\n"; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.AutoSize = true; - this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel2.Controls.Add(this.txtName, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.lblName, 0, 0); - this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 163); - this.tableLayoutPanel2.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 1; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(221, 26); - this.tableLayoutPanel2.TabIndex = 2; - // - // txtName - // - this.txtName.Location = new System.Drawing.Point(69, 3); - this.txtName.Name = "txtName"; - this.txtName.Size = new System.Drawing.Size(149, 20); - this.txtName.TabIndex = 1; - // - // lblName - // - this.lblName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.lblName.AutoSize = true; - this.lblName.Location = new System.Drawing.Point(3, 0); - this.lblName.Name = "lblName"; - this.lblName.Size = new System.Drawing.Size(54, 26); - this.lblName.TabIndex = 0; - this.lblName.Text = "File Name"; - this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblName, "defines the name of movement script file that will be generated / added to.\r\nAdd " + - "this name to the script list in your camera script to make the camera use this s" + - "cript.\r\n"); // // tlContent // @@ -330,7 +629,7 @@ private void InitializeComponent() this.tlContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tlContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlContent.Location = new System.Drawing.Point(0, 192); + this.tlContent.Location = new System.Drawing.Point(0, 134); this.tlContent.Margin = new System.Windows.Forms.Padding(0); this.tlContent.MaximumSize = new System.Drawing.Size(295, 0); this.tlContent.MinimumSize = new System.Drawing.Size(290, 100); @@ -342,156 +641,92 @@ private void InitializeComponent() this.tlContent.Size = new System.Drawing.Size(290, 100); this.tlContent.TabIndex = 3; // - // tableLayoutPanel10 + // flowLayoutPanel2 // - this.tableLayoutPanel10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel10.AutoSize = true; - this.tableLayoutPanel10.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel10.ColumnCount = 2; - this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel10.Controls.Add(this.lblSyncToSong, 0, 0); - this.tableLayoutPanel10.Controls.Add(this.checkSyncToSong, 1, 0); - this.tableLayoutPanel10.Location = new System.Drawing.Point(3, 295); - this.tableLayoutPanel10.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel10.Name = "tableLayoutPanel10"; - this.tableLayoutPanel10.RowCount = 1; - this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel10.Size = new System.Drawing.Size(270, 26); - this.tableLayoutPanel10.TabIndex = 4; - // - // lblSyncToSong - // - this.lblSyncToSong.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.lblSyncToSong.AutoSize = true; - this.lblSyncToSong.Location = new System.Drawing.Point(3, 0); - this.lblSyncToSong.Name = "lblSyncToSong"; - this.lblSyncToSong.Size = new System.Drawing.Size(75, 26); - this.lblSyncToSong.TabIndex = 1; - this.lblSyncToSong.Text = "Sync To Song"; - this.lblSyncToSong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblSyncToSong, resources.GetString("lblSyncToSong.ToolTip")); - // - // checkSyncToSong + this.flowLayoutPanel2.Controls.Add(this.tableLayoutPanel4); + this.flowLayoutPanel2.Controls.Add(this.tableLayoutPanel17); + this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 35); + this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel2.Name = "flowLayoutPanel2"; + this.flowLayoutPanel2.Size = new System.Drawing.Size(297, 35); + this.flowLayoutPanel2.TabIndex = 5; // - this.checkSyncToSong.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.checkSyncToSong.AutoSize = true; - this.checkSyncToSong.Checked = true; - this.checkSyncToSong.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkSyncToSong.Location = new System.Drawing.Point(84, 3); - this.checkSyncToSong.Name = "checkSyncToSong"; - this.checkSyncToSong.Size = new System.Drawing.Size(15, 20); - this.checkSyncToSong.TabIndex = 1; - this.checkSyncToSong.UseVisualStyleBackColor = true; - // - // tableLayoutPanel12 - // - this.tableLayoutPanel12.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel12.ColumnCount = 2; - this.tableLayoutPanel12.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel12.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel12.Controls.Add(this.lblAddToScript, 0, 0); - this.tableLayoutPanel12.Controls.Add(this.checkAddToScript, 1, 0); - this.tableLayoutPanel12.Location = new System.Drawing.Point(3, 327); - this.tableLayoutPanel12.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel12.Name = "tableLayoutPanel12"; - this.tableLayoutPanel12.RowCount = 1; - this.tableLayoutPanel12.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel12.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel12.Size = new System.Drawing.Size(295, 26); - this.tableLayoutPanel12.TabIndex = 5; - // - // lblAddToScript - // - this.lblAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.lblAddToScript.AutoSize = true; - this.lblAddToScript.Location = new System.Drawing.Point(3, 0); - this.lblAddToScript.Name = "lblAddToScript"; - this.lblAddToScript.Size = new System.Drawing.Size(80, 26); - this.lblAddToScript.TabIndex = 1; - this.lblAddToScript.Text = "Add To existing Script"; - this.lblAddToScript.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblAddToScript, resources.GetString("lblAddToScript.ToolTip")); - // - // checkAddToScript - // - this.checkAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.checkAddToScript.AutoSize = true; - this.checkAddToScript.Location = new System.Drawing.Point(91, 3); - this.checkAddToScript.Name = "checkAddToScript"; - this.checkAddToScript.Size = new System.Drawing.Size(15, 20); - this.checkAddToScript.TabIndex = 1; - this.checkAddToScript.UseVisualStyleBackColor = true; - // - // tableLayoutPanel9 - // - this.tableLayoutPanel9.ColumnCount = 2; - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel9.Controls.Add(this.btnGenerate, 0, 0); - this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel9.Location = new System.Drawing.Point(3, 359); - this.tableLayoutPanel9.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel9.Name = "tableLayoutPanel9"; - this.tableLayoutPanel9.RowCount = 1; - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel9.Size = new System.Drawing.Size(295, 26); - this.tableLayoutPanel9.TabIndex = 6; - // - // btnGenerate - // - this.btnGenerate.Location = new System.Drawing.Point(3, 3); - this.btnGenerate.Name = "btnGenerate"; - this.btnGenerate.Size = new System.Drawing.Size(82, 20); - this.btnGenerate.TabIndex = 1; - this.btnGenerate.Text = "Generate Script"; - this.btnGenerate.UseVisualStyleBackColor = true; - this.btnGenerate.Click += new System.EventHandler(this.btnGenerate_Click); - // - // tableLayoutPanel11 + // tableLayoutPanel4 // - this.tableLayoutPanel11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel11.ColumnCount = 2; - this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 17.9402F)); - this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 82.0598F)); - this.tableLayoutPanel11.Controls.Add(this.txtPath, 1, 0); - this.tableLayoutPanel11.Controls.Add(this.lblPath, 0, 0); - this.tableLayoutPanel11.Location = new System.Drawing.Point(41, 757); - this.tableLayoutPanel11.Name = "tableLayoutPanel11"; - this.tableLayoutPanel11.RowCount = 1; - this.tableLayoutPanel11.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel11.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel11.Size = new System.Drawing.Size(301, 26); - this.tableLayoutPanel11.TabIndex = 6; + this.tableLayoutPanel4.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel4.ColumnCount = 2; + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel4.Controls.Add(this.cbType, 1, 0); + this.tableLayoutPanel4.Controls.Add(this.lblType, 0, 0); + this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel4.MinimumSize = new System.Drawing.Size(0, 30); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 1; + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel4.Size = new System.Drawing.Size(135, 30); + this.tableLayoutPanel4.TabIndex = 1; // - // txtPath + // cbType // - this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtPath.Location = new System.Drawing.Point(57, 3); - this.txtPath.Name = "txtPath"; - this.txtPath.Size = new System.Drawing.Size(241, 20); - this.txtPath.TabIndex = 1; - this.txtPath.Text = "D:\\SteamLibrary\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScripts\\"; + this.cbType.Dock = System.Windows.Forms.DockStyle.Fill; + this.cbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbType.FormattingEnabled = true; + this.cbType.Items.AddRange(new object[] { + "circle around player"}); + this.cbType.Location = new System.Drawing.Point(43, 3); + this.cbType.Name = "cbType"; + this.cbType.Size = new System.Drawing.Size(90, 21); + this.cbType.TabIndex = 1; + this.cbType.SelectedIndexChanged += new System.EventHandler(this.cbType_SelectedIndexChanged); // - // lblPath + // lblType // - this.lblPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.lblPath.AutoSize = true; - this.lblPath.Location = new System.Drawing.Point(3, 0); - this.lblPath.Name = "lblPath"; - this.lblPath.Size = new System.Drawing.Size(29, 26); - this.lblPath.TabIndex = 0; - this.lblPath.Text = "Path"; - this.lblPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblPath, "Only edit this if you want to change the directory/path where the file will be sa" + - "ved"); + this.lblType.AutoSize = true; + this.lblType.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblType.Location = new System.Drawing.Point(3, 0); + this.lblType.Name = "lblType"; + this.lblType.Size = new System.Drawing.Size(34, 30); + this.lblType.TabIndex = 1; + this.lblType.Text = "Type:"; + this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // tableLayoutPanel17 + // + this.tableLayoutPanel17.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel17.ColumnCount = 2; + this.tableLayoutPanel17.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel17.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel17.Controls.Add(this.txtMoveName, 0, 0); + this.tableLayoutPanel17.Controls.Add(this.lblMoveName, 0, 0); + this.tableLayoutPanel17.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel17.Location = new System.Drawing.Point(144, 3); + this.tableLayoutPanel17.MinimumSize = new System.Drawing.Size(0, 30); + this.tableLayoutPanel17.Name = "tableLayoutPanel17"; + this.tableLayoutPanel17.RowCount = 1; + this.tableLayoutPanel17.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel17.Size = new System.Drawing.Size(150, 30); + this.tableLayoutPanel17.TabIndex = 2; + // + // txtMoveName + // + this.txtMoveName.Location = new System.Drawing.Point(47, 3); + this.txtMoveName.Name = "txtMoveName"; + this.txtMoveName.Size = new System.Drawing.Size(102, 20); + this.txtMoveName.TabIndex = 2; + // + // lblMoveName + // + this.lblMoveName.AutoSize = true; + this.lblMoveName.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblMoveName.Location = new System.Drawing.Point(3, 0); + this.lblMoveName.Name = "lblMoveName"; + this.lblMoveName.Size = new System.Drawing.Size(38, 30); + this.lblMoveName.TabIndex = 1; + this.lblMoveName.Text = "Name:"; + this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // ToolTip // @@ -504,19 +739,34 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 811); + this.ClientSize = new System.Drawing.Size(954, 811); this.Controls.Add(this.tableLayoutPanel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximumSize = new System.Drawing.Size(400, 1000); - this.MinimumSize = new System.Drawing.Size(400, 500); + this.MinimumSize = new System.Drawing.Size(970, 100); this.Name = "Main"; this.Text = "MovementScriptGenerator"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel13.ResumeLayout(false); + this.tableLayoutPanel14.ResumeLayout(false); + this.tableLayoutPanel14.PerformLayout(); + this.tableLayoutPanel15.ResumeLayout(false); + this.tableLayoutPanel11.ResumeLayout(false); + this.tableLayoutPanel11.PerformLayout(); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel10.ResumeLayout(false); + this.tableLayoutPanel10.PerformLayout(); + this.tableLayoutPanel9.ResumeLayout(false); + this.tableLayoutPanel9.PerformLayout(); + this.tableLayoutPanel12.ResumeLayout(false); + this.tableLayoutPanel12.PerformLayout(); + this.tableLayoutPanel16.ResumeLayout(false); + this.tableLayoutPanel16.PerformLayout(); this.flpContent.ResumeLayout(false); this.flpContent.PerformLayout(); - this.tableLayoutPanel4.ResumeLayout(false); - this.tableLayoutPanel4.PerformLayout(); this.tableLayoutPanel5.ResumeLayout(false); this.tableLayoutPanel5.PerformLayout(); this.tableLayoutPanel7.ResumeLayout(false); @@ -524,15 +774,11 @@ private void InitializeComponent() this.tableLayoutPanel6.ResumeLayout(false); this.tableLayoutPanel6.PerformLayout(); this.tableLayoutPanel8.ResumeLayout(false); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel10.ResumeLayout(false); - this.tableLayoutPanel10.PerformLayout(); - this.tableLayoutPanel12.ResumeLayout(false); - this.tableLayoutPanel12.PerformLayout(); - this.tableLayoutPanel9.ResumeLayout(false); - this.tableLayoutPanel11.ResumeLayout(false); - this.tableLayoutPanel11.PerformLayout(); + this.flowLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel4.PerformLayout(); + this.tableLayoutPanel17.ResumeLayout(false); + this.tableLayoutPanel17.PerformLayout(); this.ResumeLayout(false); } @@ -546,9 +792,9 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox cbType; private System.Windows.Forms.Label lblSettingsTitle; private System.Windows.Forms.ToolTip ToolTip; - private System.Windows.Forms.Label lblName; - private System.Windows.Forms.TextBox txtName; - private System.Windows.Forms.Button btnGenerate; + private System.Windows.Forms.Label lblFileName; + private System.Windows.Forms.TextBox txtFileName; + private System.Windows.Forms.Button btnGenerateScript; private System.Windows.Forms.Label lblDescription; private System.Windows.Forms.Label lblPath; private System.Windows.Forms.TextBox txtPath; @@ -566,10 +812,25 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel8; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel12; private System.Windows.Forms.Label lblAddToScript; private System.Windows.Forms.CheckBox checkAddToScript; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel13; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel14; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel15; + private System.Windows.Forms.Button btnAddMoveToChain; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel16; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9; + private System.Windows.Forms.Label lblLoop; + private System.Windows.Forms.CheckBox checkLoop; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel17; + private System.Windows.Forms.TextBox txtMoveName; + private System.Windows.Forms.Label lblMoveName; + private System.Windows.Forms.TreeView tvChain; } } diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 26d15ec..c3ac04e 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -1,12 +1,7 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; using MovementScriptGenerator.Modules; using Newtonsoft.Json; @@ -18,6 +13,13 @@ public partial class Main : Form CircleControl circleControl = new CircleControl(); SpiralControl spiralControl = new SpiralControl(); + private static readonly char[] illegalCharsForExplorer = "/<>:/\\\"|?*".ToCharArray(); + + Chain chain = new Chain() + { + Elements = new List() + }; + List moveTypes = new List() { "circle", @@ -35,23 +37,24 @@ public partial class Main : Form public Main() { InitializeComponent(); - initializeComboBoxes(); - updateDescription(); - updateContent(); + InitializeComboBoxes(); + UpdateDescription(); + UpdateContent(); + UpdateChainWindow(); } - private void initializeComboBoxes() + private void InitializeComboBoxes() { cbType.DataSource = moveTypes; cbType.SelectedIndex = 0; } - private void updateDescription() + private void UpdateDescription() { lblMoveDescription.Text = moveDescriptions[cbType.SelectedIndex]; } - private void updateContent() + private void UpdateContent() { tlContent.Controls.Clear(); switch (cbType.SelectedIndex) @@ -65,11 +68,30 @@ private void updateContent() } } - private bool GenerateMovementScriptFile(MovementScript script, string path) + private void UpdateChainWindow() + { + foreach(ChainElement el in chain.Elements) + { + tvChain.BeginUpdate(); + tvChain.Nodes.Clear(); + tvChain.Nodes.Add(el.Name); + tvChain.EndUpdate(); + } + } + + private bool GenerateMovementScriptFile(MovementScript script, string filePath) { + if (File.Exists(filePath)) + { + if(MessageBox.Show("A file with the given name already exists.\nWould you like to overwrite that file?", "Overwrite existing File", MessageBoxButtons.YesNo) == DialogResult.No) + { + return false; + } + } + try { - using (StreamWriter file = File.CreateText(path)) + using (StreamWriter file = File.CreateText(filePath)) { JsonSerializer serializer = new JsonSerializer(); serializer.Formatting = Formatting.Indented; @@ -80,31 +102,31 @@ private bool GenerateMovementScriptFile(MovementScript script, string path) } catch { - MessageBox.Show($"File could not be generated.\nPlease dont use any special characters in the file name"); + MessageBox.Show($"Something went wrong while generating the file.\nPlease make sure that the file name and file path are viable and don't contain any not allowed characters."); return false; } } - private bool AddToMovementScriptFile(MovementScript script, string path) + private bool AddToMovementScriptFile(MovementScript script, string filePath) { JsonSerializer serializer = new JsonSerializer(); - if (!File.Exists(path)) + if (!File.Exists(filePath)) { MessageBox.Show("File doesn't exist!"); return false; } - string previousFileContent = File.ReadAllText(path); + string previousFileContent = File.ReadAllText(filePath); try { MovementScript previousMovementScript = JsonConvert.DeserializeObject(previousFileContent); - script.frames.InsertRange(0, previousMovementScript.frames); + script.Frames.InsertRange(0, previousMovementScript.Frames); - using (StreamWriter file = File.CreateText(path)) + using (StreamWriter file = File.CreateText(filePath)) { serializer.Formatting = Formatting.Indented; @@ -120,50 +142,102 @@ private bool AddToMovementScriptFile(MovementScript script, string path) }; } - private void btnGenerate_Click(object sender, EventArgs e) + private void cbType_SelectedIndexChanged(object sender, EventArgs e) { - string filePath = $@"{txtPath.Text}{txtName.Text}.Json"; + UpdateDescription(); + UpdateContent(); + } - if (txtName.Text.Replace(" ", String.Empty) == "") + private void btnAddMoveToChain_Click(object sender, EventArgs e) + { + string moveName = txtMoveName.Text; + if (moveName.Replace(" ", String.Empty) == "") { - MessageBox.Show("Filename is missing!"); - txtName.Focus(); - return; + moveName = null; } - MovementScript movementScript = new MovementScript(); - switch (cbType.SelectedIndex) { case 0: - movementScript = circleControl.CreateMovementScript(); + Circle circle = circleControl.CreateMove(moveName); + chain.Elements.Add(circle); break; case 1: - movementScript = spiralControl.CreateMovementScript(); + Spiral spiral = spiralControl.CreateMove(moveName); + chain.Elements.Add(spiral); break; } - movementScript.syncToSong = checkSyncToSong.Checked; + tvChain.Nodes.Add(chain.Elements.Last().Name); + } + + private void btnGenerateScript_Click(object sender, EventArgs e) + { + string filePath = $@"{txtPath.Text}{txtFileName.Text}.Json"; + + if (txtFileName.Text.Replace(" ", String.Empty) == "") + { + MessageBox.Show("Filename is missing!"); + txtFileName.Focus(); + return; + } + + if (txtFileName.Text.IndexOfAny(illegalCharsForExplorer) != -1) + { + MessageBox.Show($"Couldn't generate the file because there are not allowed special characters in the filename.\nPlease make sure to not use any of these characters:\n{new string(illegalCharsForExplorer)}"); + return; + } + + if (filePath.IndexOfAny(Path.GetInvalidPathChars()) != -1) + { + MessageBox.Show($"Couldn't generate the file because the file path is invalid.\nPlease check that the file path is correct and pointing to the right folder."); + return; + } + + if (!Directory.Exists(txtPath.Text)) + { + MessageBox.Show("Couldn't find a directory at the given path.\nPlease make sure that the path points to an existsing directory on your device."); + return; + } + + if(chain.Elements.Count <= 0) + { + MessageBox.Show("Can't create a movement script without any moves.\nPlease add moves to the chain before trying to generate a movement script."); + return; + } + + List scriptFrames = new List(); + + foreach (ChainElement chainEl in chain.Elements) + { + if (chainEl is Move moveEl) + { + List moveFrames = moveEl.GenerateFrames(); + scriptFrames.AddRange(moveFrames); + } + } + + MovementScript movementScript = new MovementScript() + { + Frames = scriptFrames, + SyncToSong = checkSyncToSong.Checked, + Loop = checkLoop.Checked + }; + if (checkAddToScript.Checked) { - if(AddToMovementScriptFile(movementScript, filePath)) + if (AddToMovementScriptFile(movementScript, filePath)) { - MessageBox.Show("Move added to MovementScript"); + MessageBox.Show("Chain added to Movement Script"); }; } else { - if(GenerateMovementScriptFile(movementScript, filePath)) + if (GenerateMovementScriptFile(movementScript, filePath)) { MessageBox.Show("Movement Script generated"); }; } } - - private void cbType_SelectedIndexChanged(object sender, EventArgs e) - { - updateDescription(); - updateContent(); - } } } diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index 5f13cf2..167a161 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -127,11 +127,12 @@ Off -> the script will start playing at the start of the song and not stop in (this has no effect on if the script will play in the normal menu / outside of songs) - On -> if a file with the given name exists, the move will be added to that file. Useful to chain moves together. -Will overwrite the "Sync To Song" of the existing file! + On -> if a movement script file with the given name exists, the moves will be added to that files moves. +Will overwrite the "Sync To Song" and "Loop" options of the existing file! (Make sure that the file is a MovementScript File!) -Off -> A new file will be created for the move. If a file with the same name exists, that file will be overwritten! +Off -> A new movement script file will be created for the move. +If a file with the same name exists, that file will be overwritten! diff --git a/MovementScriptGenerator/Modules/Chain.cs b/MovementScriptGenerator/Modules/Chain.cs new file mode 100644 index 0000000..9b2cc28 --- /dev/null +++ b/MovementScriptGenerator/Modules/Chain.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace MovementScriptGenerator.Modules +{ + public class Chain + { + public List Elements { get; set; } + } +} diff --git a/MovementScriptGenerator/Modules/ChainElement.cs b/MovementScriptGenerator/Modules/ChainElement.cs new file mode 100644 index 0000000..61a1d96 --- /dev/null +++ b/MovementScriptGenerator/Modules/ChainElement.cs @@ -0,0 +1,12 @@ + +namespace MovementScriptGenerator.Modules +{ + public class ChainElement + { + public ChainElement(string name) + { + Name = name; + } + public string Name { get; set; } + } +} diff --git a/MovementScriptGenerator/Modules/Frame.cs b/MovementScriptGenerator/Modules/Frame.cs index 835c670..28ffc98 100644 --- a/MovementScriptGenerator/Modules/Frame.cs +++ b/MovementScriptGenerator/Modules/Frame.cs @@ -1,18 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace MovementScriptGenerator.Modules { public class Frame { - public Position position { get; set; } - public Rotation rotation { get; set; } - public float duration { get; set; } - public float holdTime { get; set; } - public string transition { get; set; } - public float fov { get; set; } + public Position Position { get; set; } + public Rotation Rotation { get; set; } + public float Duration { get; set; } + public float HoldTime { get; set; } + public string Transition { get; set; } + public float Fov { get; set; } } } diff --git a/MovementScriptGenerator/Modules/Move.cs b/MovementScriptGenerator/Modules/Move.cs new file mode 100644 index 0000000..413ef99 --- /dev/null +++ b/MovementScriptGenerator/Modules/Move.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace MovementScriptGenerator.Modules +{ + public abstract class Move : ChainElement + { + + public Move(string name, int fov, float duration, float height) : base(name) + { + Fov = fov; + Duration = duration; + Height = height; + } + + public int Fov { get; set; } + public float Duration { get; set; } + public float Height { get; set; } + + public abstract List GenerateFrames(); + + } +} diff --git a/MovementScriptGenerator/Modules/MovementScript.cs b/MovementScriptGenerator/Modules/MovementScript.cs index 100f945..224d724 100644 --- a/MovementScriptGenerator/Modules/MovementScript.cs +++ b/MovementScriptGenerator/Modules/MovementScript.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace MovementScriptGenerator.Modules { public class MovementScript { - public bool syncToSong { get; set; } - public List frames { get; set; } + public bool SyncToSong { get; set; } + + public bool Loop { get; set; } + public List Frames { get; set; } } } diff --git a/MovementScriptGenerator/Modules/Moves/Circle.cs b/MovementScriptGenerator/Modules/Moves/Circle.cs new file mode 100644 index 0000000..145ab3b --- /dev/null +++ b/MovementScriptGenerator/Modules/Moves/Circle.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using MovementScriptGenerator.Modules; + +namespace MovementScriptGenerator +{ + public class Circle : Move + { + private float rotX; + private float rotZ; + private float distance; + private float startingPointDegree; + private float sectorDegrees; + private int iterations; + private bool rotateClockwise; + public Circle( + string name, + int fov, + float duration, + float height, + float rotX, + float rotZ, + float distance, + float startingPointDegree, + float sectorDegrees, + int iterations, + bool rotateClockwise) : base(name, fov, duration, height) + { + Name = name ?? "circleMove"; + Fov = fov; + Duration = duration; + Height = height; + this.rotX = rotX; + this.rotZ = rotZ; + this.distance = distance; + this.startingPointDegree = startingPointDegree; + this.sectorDegrees = sectorDegrees; + this.iterations = iterations; + this.rotateClockwise = rotateClockwise; + } + public override List GenerateFrames() + { + List frames = new List(); + + float initialDegree = 0; + float maxDegrees = sectorDegrees - 1; + float initialDegreeAddend = 1; + + if (!rotateClockwise) { + initialDegree *= -1; + maxDegrees *= -1; + initialDegreeAddend *= -1; + } + + for (float i = initialDegree; (rotateClockwise && i <= maxDegrees) || (!rotateClockwise && i >= maxDegrees); i += (float)initialDegreeAddend / iterations) + { + float usedDegree = i + startingPointDegree; + double radiant = usedDegree * Math.PI / 180; + + Frame frame = new Frame(); + frame.Position = new Position(); + frame.Rotation = new Rotation(); + + frame.Position.X = (float)Math.Sin(radiant) * distance; + frame.Position.Y = Height; + frame.Position.Z = (float)Math.Cos(radiant) * distance; + + frame.Rotation.Z = rotZ; + frame.Rotation.X = rotX; + frame.Rotation.Y = usedDegree -180; + + if (usedDegree == 0 || usedDegree == 180 || usedDegree == 360) + { + frame.Position.X = 0; + } + if (usedDegree == 90 || usedDegree == 270) + { + frame.Position.Z = 0; + } + + + frame.Duration = Duration / Math.Abs(maxDegrees) / iterations; + + if(Fov > 0) + { + frame.Fov = Fov; + } + + frames.Add(frame); + } + + return frames; + } + } +} diff --git a/MovementScriptGenerator/Modules/Moves/Spiral.cs b/MovementScriptGenerator/Modules/Moves/Spiral.cs new file mode 100644 index 0000000..007d83a --- /dev/null +++ b/MovementScriptGenerator/Modules/Moves/Spiral.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using MovementScriptGenerator.Modules; + +namespace MovementScriptGenerator +{ + public class Spiral : Move + { + private float startDistance; + private float endDistance; + private float horizontalRot; + private float verticalRot; + private float spiralAmmount; + private bool spiralClockwise; + private float startHold; + private float endHold; + private bool ease; + public Spiral( + string name, + int fov, + float duration, + float height, + float startDistance, + float endDistance, + float horizontalRot, + float verticalRot, + int spiralAmmount, + bool spiralClockwise, + float startHold, + float endHold, + bool ease) : base(name, fov, duration, height) + { + Name = name ?? "spiralMove"; + Fov = fov; + Duration = duration; + Height = height; + this.startDistance = startDistance; + this.endDistance = endDistance; + this.horizontalRot = horizontalRot; + this.verticalRot = verticalRot; + this.spiralAmmount = spiralAmmount; + this.spiralClockwise = spiralClockwise; + this.startHold = startHold; + this.endHold = endHold; + this.ease = ease; + } + public override List GenerateFrames() + { + List frames = new List(); + + double horizontalRadiant = horizontalRot * Math.PI / 180; + + float xHorizontal = (float)Math.Sin(horizontalRadiant); + float zHorizontal = (float)Math.Cos(horizontalRadiant); + + double verticalRadiant = verticalRot * Math.PI / 180; + + float yVertical = (float)Math.Sin(verticalRadiant); + float zVertical = (float)Math.Cos(verticalRadiant); + + float pathLength = startDistance - endDistance; + float spiralLength = pathLength / spiralAmmount; + + switch (horizontalRot) + { + case 0: + zHorizontal = 1; + break; + case 90: + case -90: + case 270: + case -270: + zHorizontal = 0; + break; + case 180: + case -180: + case 360: + case -360: + xHorizontal = 0; + break; + } + + switch (verticalRot) + { + case 0: + yVertical = 0; + break; + case 90: + case -90: + case 270: + case -270: + zVertical = 0; + break; + } + + Frame startFrame = new Frame() + { + Position = new Position() + { + X = xHorizontal * zVertical * startDistance, + Y = yVertical * startDistance + Height, + Z = zHorizontal * zVertical * startDistance + }, + + Rotation = new Rotation() + { + X = verticalRot, + Y = horizontalRot - 180, + Z = 0 + }, + + HoldTime = startHold, + + Fov = Fov + }; + frames.Add(startFrame); + + for(int i = 0; i < spiralAmmount; i++) + { + List spiralFrames = new List(); + + float SpiralStartDistance = startDistance - (i*spiralLength); + float spiralHalfwayDistance = SpiralStartDistance - (spiralLength / 2); + float spiralEndDistance = spiralHalfwayDistance - (spiralLength / 2); + + for(int rotation = 1; rotation < 360; rotation++) + { + float spiralFrameDistance = SpiralStartDistance - (spiralLength / 360 * rotation); + + Frame spiralFrame = new Frame() + { + Position = new Position() + { + X = xHorizontal * zVertical * spiralFrameDistance, + Y = yVertical * spiralFrameDistance + Height, + Z = zHorizontal * zVertical * spiralFrameDistance + }, + + Rotation = new Rotation() + { + X = verticalRot, + Y = horizontalRot - 180, + Z = spiralClockwise ? -rotation : rotation + }, + + Duration = Duration / spiralAmmount / 360, + + Fov = Fov + }; + + spiralFrames.Add(spiralFrame); + } + + frames.AddRange(spiralFrames); + } + + Frame endFrame = new Frame() + { + Position = new Position() + { + X = xHorizontal * zVertical * endDistance, + Y = yVertical * endDistance + Height, + Z = zHorizontal * zVertical * endDistance + }, + + Rotation = new Rotation() + { + X = verticalRot, + Y = horizontalRot - 180, + Z = spiralAmmount > 0 ? (spiralClockwise ? -360 : 360) : 0 + }, + + HoldTime = endHold, + + Transition = ease && spiralAmmount <= 0 ? "Eased" : "Linear", + + Duration = spiralAmmount > 0 ? (Duration / spiralAmmount / 360) : Duration, + + Fov = Fov + }; + frames.Add(endFrame); + return frames; + } + } +} diff --git a/MovementScriptGenerator/Modules/Position.cs b/MovementScriptGenerator/Modules/Position.cs index ca9d5fb..122bd5f 100644 --- a/MovementScriptGenerator/Modules/Position.cs +++ b/MovementScriptGenerator/Modules/Position.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace MovementScriptGenerator.Modules { public class Position { - public float x { get; set; } - public float y { get; set; } - public float z { get; set; } + public float X { get; set; } + public float Y { get; set; } + public float Z { get; set; } } } diff --git a/MovementScriptGenerator/Modules/Rotation.cs b/MovementScriptGenerator/Modules/Rotation.cs index 70a199c..8722b6b 100644 --- a/MovementScriptGenerator/Modules/Rotation.cs +++ b/MovementScriptGenerator/Modules/Rotation.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace MovementScriptGenerator.Modules { public class Rotation { - public float x { get; set; } - public float y { get; set; } - public float z { get; set; } + public float X { get; set; } + public float Y { get; set; } + public float Z { get; set; } } } diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 44ae164..38132bc 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -36,6 +36,7 @@ Icon.ico + ..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll @@ -52,14 +53,17 @@ - + Form Form1.cs + + + @@ -71,7 +75,7 @@ CircleControl.cs - + UserControl @@ -113,5 +117,8 @@ + + + \ No newline at end of file diff --git a/MovementScriptGenerator/Spiral.cs b/MovementScriptGenerator/Spiral.cs deleted file mode 100644 index 8315299..0000000 --- a/MovementScriptGenerator/Spiral.cs +++ /dev/null @@ -1,229 +0,0 @@ -using System; -using System.Collections.Generic; -using MovementScriptGenerator.Modules; - -namespace MovementScriptGenerator -{ - class Spiral - { - public List GenerateFrames( - float fov, - float duration, - float startDistance, - float endDistance, - float endHeight, - float horizontalRot, - float verticalRot, - int spiralAmmount, - bool spiralClockwise, - float startHold, - float endHold, - bool ease - ) - { - List frames = new List(); - - double horizontalRadiant = horizontalRot * Math.PI / 180; - - float xHorizontal = (float)Math.Sin(horizontalRadiant); - float zHorizontal = (float)Math.Cos(horizontalRadiant); - - double verticalRadiant = verticalRot * Math.PI / 180; - - float yVertical = (float)Math.Sin(verticalRadiant); - float zVertical = (float)Math.Cos(verticalRadiant); - - float pathLength = startDistance - endDistance; - float spiralLength = pathLength / spiralAmmount; - - switch (horizontalRot) - { - case 0: - zHorizontal = 1; - break; - case 90: - case -90: - case 270: - case -270: - zHorizontal = 0; - break; - case 180: - case -180: - case 360: - case -360: - xHorizontal = 0; - break; - } - - switch (verticalRot) - { - case 0: - yVertical = 0; - break; - case 90: - case -90: - case 270: - case -270: - zVertical = 0; - break; - case 180: - case -180: - case 360: - case -360: - //zVertical = 0; - break; - } - - Frame startFrame = new Frame() - { - position = new Position() - { - x = xHorizontal * zVertical * startDistance, - y = yVertical * startDistance + endHeight, - z = zHorizontal * zVertical * startDistance - }, - - rotation = new Rotation() - { - x = verticalRot, - y = horizontalRot - 180, - z = 0 - }, - - holdTime = startHold - }; - frames.Add(startFrame); - - for(int i = 0; i < spiralAmmount; i++) - { - List spiralFrames = new List(); - - float SpiralStartDistance = startDistance - (i*spiralLength); - float spiralHalfwayDistance = SpiralStartDistance - (spiralLength / 2); - float spiralEndDistance = spiralHalfwayDistance - (spiralLength / 2); - - for(int rotation = 1; rotation < 360; rotation++) - { - float spiralFrameDistance = SpiralStartDistance - (spiralLength / 360 * rotation); - - Frame spiralFrame = new Frame() - { - position = new Position() - { - x = xHorizontal * zVertical * spiralFrameDistance, - y = yVertical * spiralFrameDistance + endHeight, - z = zHorizontal * zVertical * spiralFrameDistance - }, - - rotation = new Rotation() - { - x = verticalRot, - y = horizontalRot - 180, - z = spiralClockwise ? -rotation : rotation - }, - - duration = duration / spiralAmmount / 360 - }; - - spiralFrames.Add(spiralFrame); - } - - /*if(i != 0) - { - Frame spiralStartFrame = new Frame() - { - position = new Position() - { - x = xHorizontal * zVertical * SpiralStartDistance, - y = yVertical * SpiralStartDistance + endHeight, - z = zHorizontal * zVertical * SpiralStartDistance - }, - - rotation = new Rotation() - { - x = verticalRot, - y = horizontalRot - 180, - z = 0 - }, - }; - - spiralFrames.Add(spiralStartFrame); - } - - Frame spiralHalfwayFrame = new Frame() - { - position = new Position() - { - x = xHorizontal * zVertical * spiralHalfwayDistance, - y = yVertical * spiralHalfwayDistance + endHeight, - z = zHorizontal * zVertical * spiralHalfwayDistance - }, - - rotation = new Rotation() - { - x = verticalRot, - y = horizontalRot - 180, - z = spiralClockwise ? 180 : -180 - }, - - duration = duration / spiralAmmount / 2 - }; - - spiralFrames.Add(spiralHalfwayFrame); - - if(i != spiralAmmount -1) - { - Frame spiralEndFrame = new Frame() - { - position = new Position() - { - x = xHorizontal * zVertical * spiralEndDistance, - y = yVertical * spiralEndDistance + endHeight, - z = zHorizontal * zVertical * spiralEndDistance - }, - - rotation = new Rotation() - { - x = verticalRot, - y = horizontalRot - 180, - z = spiralClockwise ? 360 : -360 - }, - - duration = duration / spiralAmmount / 2 - }; - - spiralFrames.Add(spiralEndFrame); - - }*/ - - frames.AddRange(spiralFrames); - } - - Frame endFrame = new Frame() - { - position = new Position() - { - x = xHorizontal * zVertical * endDistance, - y = yVertical * endDistance + endHeight, - z = zHorizontal * zVertical * endDistance - }, - - rotation = new Rotation() - { - x = verticalRot, - y = horizontalRot - 180, - z = spiralAmmount > 0 ? (spiralClockwise ? -360 : 360) : 0 - }, - - holdTime = endHold, - - transition = ease && spiralAmmount < 0 ? "Eased" : "Linear", - - duration = spiralAmmount > 0 ? (duration / spiralAmmount / 360) : duration - //duration = spiralAmmount > 0 ? (duration / spiralAmmount / 2) : duration - }; - frames.Add(endFrame); - return frames; - } - } -} diff --git a/MovementScriptGenerator/SpiralControl.Designer.cs b/MovementScriptGenerator/SpiralControl.Designer.cs index 8c5d902..f8f7b0f 100644 --- a/MovementScriptGenerator/SpiralControl.Designer.cs +++ b/MovementScriptGenerator/SpiralControl.Designer.cs @@ -38,8 +38,8 @@ private void InitializeComponent() this.numEndDistance = new System.Windows.Forms.NumericUpDown(); this.lblEndDistance = new System.Windows.Forms.Label(); this.tableLayoutPanel11 = new System.Windows.Forms.TableLayoutPanel(); - this.numEndHeight = new System.Windows.Forms.NumericUpDown(); - this.lblEndHeight = new System.Windows.Forms.Label(); + this.numHeight = new System.Windows.Forms.NumericUpDown(); + this.lblHeight = new System.Windows.Forms.Label(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.numHorizontalRot = new System.Windows.Forms.NumericUpDown(); this.lblHorizontalRot = new System.Windows.Forms.Label(); @@ -74,7 +74,7 @@ private void InitializeComponent() this.tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numEndDistance)).BeginInit(); this.tableLayoutPanel11.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numEndHeight)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numHeight)).BeginInit(); this.tableLayoutPanel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numHorizontalRot)).BeginInit(); this.tableLayoutPanel10.SuspendLayout(); @@ -216,8 +216,8 @@ private void InitializeComponent() this.tableLayoutPanel11.ColumnCount = 2; this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel11.Controls.Add(this.numEndHeight, 0, 0); - this.tableLayoutPanel11.Controls.Add(this.lblEndHeight, 0, 0); + this.tableLayoutPanel11.Controls.Add(this.numHeight, 0, 0); + this.tableLayoutPanel11.Controls.Add(this.lblHeight, 0, 0); this.tableLayoutPanel11.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel11.Location = new System.Drawing.Point(3, 73); this.tableLayoutPanel11.Name = "tableLayoutPanel11"; @@ -227,31 +227,31 @@ private void InitializeComponent() this.tableLayoutPanel11.Size = new System.Drawing.Size(254, 26); this.tableLayoutPanel11.TabIndex = 3; // - // numEndHeight + // numHeight // - this.numEndHeight.DecimalPlaces = 5; - this.numEndHeight.Location = new System.Drawing.Point(130, 3); - this.numEndHeight.Minimum = new decimal(new int[] { + this.numHeight.DecimalPlaces = 5; + this.numHeight.Location = new System.Drawing.Point(130, 3); + this.numHeight.Minimum = new decimal(new int[] { 100, 0, 0, -2147483648}); - this.numEndHeight.Name = "numEndHeight"; - this.numEndHeight.Size = new System.Drawing.Size(120, 20); - this.numEndHeight.TabIndex = 1; + this.numHeight.Name = "numHeight"; + this.numHeight.Size = new System.Drawing.Size(120, 20); + this.numHeight.TabIndex = 1; // - // lblEndHeight + // lblHeight // - this.lblEndHeight.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.lblHeight.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.lblEndHeight.AutoSize = true; - this.lblEndHeight.Location = new System.Drawing.Point(3, 0); - this.lblEndHeight.Name = "lblEndHeight"; - this.lblEndHeight.Size = new System.Drawing.Size(38, 26); - this.lblEndHeight.TabIndex = 1; - this.lblEndHeight.Text = "Height"; - this.lblEndHeight.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblEndHeight, "Defines at what height (on the y-axis) the move will be executed at.\r\nIf End Dist" + + this.lblHeight.AutoSize = true; + this.lblHeight.Location = new System.Drawing.Point(3, 0); + this.lblHeight.Name = "lblHeight"; + this.lblHeight.Size = new System.Drawing.Size(38, 26); + this.lblHeight.TabIndex = 1; + this.lblHeight.Text = "Height"; + this.lblHeight.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblHeight, "Defines at what height (on the y-axis) the move will be executed at.\r\nIf End Dist" + "ance is defined as 0, this will be the height at which the camera will stop at."); // // tableLayoutPanel3 @@ -702,7 +702,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.numEndDistance)).EndInit(); this.tableLayoutPanel11.ResumeLayout(false); this.tableLayoutPanel11.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numEndHeight)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numHeight)).EndInit(); this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numHorizontalRot)).EndInit(); @@ -768,8 +768,8 @@ private void InitializeComponent() private System.Windows.Forms.Label lblEndHoldTime; private System.Windows.Forms.NumericUpDown numEndDistance; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel11; - private System.Windows.Forms.NumericUpDown numEndHeight; - private System.Windows.Forms.Label lblEndHeight; + private System.Windows.Forms.NumericUpDown numHeight; + private System.Windows.Forms.Label lblHeight; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel12; private System.Windows.Forms.Label lblEase; private System.Windows.Forms.CheckBox checkEase; diff --git a/MovementScriptGenerator/SpiralControl.cs b/MovementScriptGenerator/SpiralControl.cs index ac3c171..14aec92 100644 --- a/MovementScriptGenerator/SpiralControl.cs +++ b/MovementScriptGenerator/SpiralControl.cs @@ -1,19 +1,11 @@ -using MovementScriptGenerator.Modules; -using System; +using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace MovementScriptGenerator { public partial class SpiralControl : UserControl { - private static Spiral spiral = new Spiral(); List rotationTypes = new List() { @@ -48,30 +40,25 @@ private void numSpiralAmmount_ValueChanged(object sender, EventArgs e) } } - public MovementScript CreateMovementScript() + public Spiral CreateMove(string moveName) { - MovementScript movementScript = new MovementScript(); - bool spiralClockwise = false; - if (cbSpiralRotation.SelectedIndex == 0) - { - spiralClockwise = true; - } - movementScript.frames = spiral.GenerateFrames( - (int)numFOV.Value, - (float)numDuration.Value, - (float)numStartDistance.Value, - (float)numEndDistance.Value, - (float)numEndHeight.Value, - (float)numHorizontalRot.Value, - (float)numVerticalRot.Value, - (int)numSpiralAmmount.Value, - spiralClockwise, - (float)numStartHoldTime.Value, - (float)numEndHoldTime.Value, + Spiral spiral = new Spiral( + moveName, + (int) numFOV.Value, + (float) numDuration.Value, + (float) numHeight.Value, + (float) numStartDistance.Value, + (float) numEndDistance.Value, + (float) numHorizontalRot.Value, + (float) numVerticalRot.Value, + (int) numSpiralAmmount.Value, + cbSpiralRotation.SelectedIndex == 0 ? true : false, + (float) numStartHoldTime.Value, + (float) numEndHoldTime.Value, checkEase.Checked - ); + ); - return movementScript; + return spiral; } } } From f118a3ab263da9e015de7dc182bd8f2b5a9d5048 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Tue, 13 Dec 2022 23:42:32 +0100 Subject: [PATCH 02/21] - added getters to Circle and Spiral - fixed naming violations in Circle and Spiral - added functionality to copy settings of an existing chain element - added functionality to update settings of an existing chain element - added ui for chain element handling --- MovementScriptGenerator/CircleControl.cs | 25 +- MovementScriptGenerator/Form1.Designer.cs | 238 +++++++++++++++++- MovementScriptGenerator/Form1.cs | 134 +++++++++- MovementScriptGenerator/Form1.resx | 3 + .../Modules/Moves/Circle.cs | 47 ++-- .../Modules/Moves/Spiral.cs | 90 +++---- MovementScriptGenerator/SpiralControl.cs | 25 ++ 7 files changed, 482 insertions(+), 80 deletions(-) diff --git a/MovementScriptGenerator/CircleControl.cs b/MovementScriptGenerator/CircleControl.cs index 9b24f77..d693ab6 100644 --- a/MovementScriptGenerator/CircleControl.cs +++ b/MovementScriptGenerator/CircleControl.cs @@ -24,6 +24,29 @@ private void initializeComboBoxes() cbRotation.SelectedIndex = 0; } + public bool Populate(Circle original) + { + try + { + numFOV.Value = original.Fov; + numDuration.Value = (decimal)original.Duration; + numHeight.Value = (decimal)original.Height; + numRotX.Value = (decimal)original.RotX; + numRotZ.Value = (decimal)original.RotZ; + numDistance.Value = (decimal)original.Distance; + numStartingPoint.Value = (decimal)original.StartingPointDegree; + numSector.Value = (decimal)original.SectorDegrees; + numIterations.Value = original.Iterations; + cbRotation.SelectedIndex = original.RotateClockwise ? 0 : 1; + } + catch + { + return false; + } + + return true; + } + public Circle CreateMove(string moveName) { Circle circle = new Circle( @@ -37,7 +60,7 @@ public Circle CreateMove(string moveName) (float)numStartingPoint.Value, (float)numSector.Value, (int)numIterations.Value, - cbRotation.SelectedIndex == 0 ? true : false + cbRotation.SelectedIndex == 0 ); return circle; diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index be0d19f..45b3c79 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -54,9 +54,22 @@ private void InitializeComponent() this.tableLayoutPanel12 = new System.Windows.Forms.TableLayoutPanel(); this.lblAddToScript = new System.Windows.Forms.Label(); this.checkAddToScript = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel18 = new System.Windows.Forms.TableLayoutPanel(); this.tvChain = new System.Windows.Forms.TreeView(); + this.tableLayoutPanel19 = new System.Windows.Forms.TableLayoutPanel(); + this.lblElementOptions = new System.Windows.Forms.Label(); + this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); + this.tableLayoutPanel20 = new System.Windows.Forms.TableLayoutPanel(); + this.btnElementMoveDown = new System.Windows.Forms.Button(); + this.btnElementMoveUp = new System.Windows.Forms.Button(); + this.btnElementDuplicate = new System.Windows.Forms.Button(); + this.btnElementEditSettings = new System.Windows.Forms.Button(); + this.btnElementApplySettings = new System.Windows.Forms.Button(); + this.btnElementDelete = new System.Windows.Forms.Button(); this.tableLayoutPanel16 = new System.Windows.Forms.TableLayoutPanel(); + this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.btnAddMoveToChain = new System.Windows.Forms.Button(); + this.btnResetMoveSettings = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.flpContent = new System.Windows.Forms.FlowLayoutPanel(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); @@ -87,7 +100,12 @@ private void InitializeComponent() this.tableLayoutPanel10.SuspendLayout(); this.tableLayoutPanel9.SuspendLayout(); this.tableLayoutPanel12.SuspendLayout(); + this.tableLayoutPanel18.SuspendLayout(); + this.tableLayoutPanel19.SuspendLayout(); + this.flowLayoutPanel4.SuspendLayout(); + this.tableLayoutPanel20.SuspendLayout(); this.tableLayoutPanel16.SuspendLayout(); + this.flowLayoutPanel3.SuspendLayout(); this.flpContent.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); this.tableLayoutPanel7.SuspendLayout(); @@ -150,7 +168,7 @@ private void InitializeComponent() this.tableLayoutPanel14.Controls.Add(this.label2, 0, 0); this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel15, 0, 3); this.tableLayoutPanel14.Controls.Add(this.flowLayoutPanel1, 0, 1); - this.tableLayoutPanel14.Controls.Add(this.tvChain, 0, 2); + this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel18, 0, 2); this.tableLayoutPanel14.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel14.Location = new System.Drawing.Point(303, 0); this.tableLayoutPanel14.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); @@ -427,19 +445,176 @@ private void InitializeComponent() this.checkAddToScript.TabIndex = 1; this.checkAddToScript.UseVisualStyleBackColor = true; // + // tableLayoutPanel18 + // + this.tableLayoutPanel18.ColumnCount = 2; + this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); + this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel18.Controls.Add(this.tvChain, 0, 0); + this.tableLayoutPanel18.Controls.Add(this.tableLayoutPanel19, 1, 0); + this.tableLayoutPanel18.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel18.Location = new System.Drawing.Point(0, 70); + this.tableLayoutPanel18.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel18.Name = "tableLayoutPanel18"; + this.tableLayoutPanel18.RowCount = 1; + this.tableLayoutPanel18.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel18.Size = new System.Drawing.Size(605, 597); + this.tableLayoutPanel18.TabIndex = 7; + // // tvChain // this.tvChain.Dock = System.Windows.Forms.DockStyle.Fill; - this.tvChain.Location = new System.Drawing.Point(3, 73); + this.tvChain.HideSelection = false; + this.tvChain.Location = new System.Drawing.Point(3, 3); this.tvChain.Name = "tvChain"; - this.tvChain.Size = new System.Drawing.Size(599, 591); + this.tvChain.Size = new System.Drawing.Size(478, 591); this.tvChain.TabIndex = 7; // + // tableLayoutPanel19 + // + this.tableLayoutPanel19.ColumnCount = 1; + this.tableLayoutPanel19.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel19.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel19.Controls.Add(this.lblElementOptions, 0, 0); + this.tableLayoutPanel19.Controls.Add(this.flowLayoutPanel4, 0, 1); + this.tableLayoutPanel19.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel19.Location = new System.Drawing.Point(484, 0); + this.tableLayoutPanel19.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel19.Name = "tableLayoutPanel19"; + this.tableLayoutPanel19.RowCount = 2; + this.tableLayoutPanel19.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel19.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 90F)); + this.tableLayoutPanel19.Size = new System.Drawing.Size(121, 597); + this.tableLayoutPanel19.TabIndex = 8; + // + // lblElementOptions + // + this.lblElementOptions.AutoSize = true; + this.lblElementOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblElementOptions.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblElementOptions.Location = new System.Drawing.Point(3, 0); + this.lblElementOptions.MaximumSize = new System.Drawing.Size(0, 59); + this.lblElementOptions.Name = "lblElementOptions"; + this.lblElementOptions.Size = new System.Drawing.Size(115, 59); + this.lblElementOptions.TabIndex = 5; + this.lblElementOptions.Text = "Element Options"; + this.lblElementOptions.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // flowLayoutPanel4 + // + this.flowLayoutPanel4.AutoScroll = true; + this.flowLayoutPanel4.Controls.Add(this.tableLayoutPanel20); + this.flowLayoutPanel4.Controls.Add(this.btnElementDuplicate); + this.flowLayoutPanel4.Controls.Add(this.btnElementEditSettings); + this.flowLayoutPanel4.Controls.Add(this.btnElementApplySettings); + this.flowLayoutPanel4.Controls.Add(this.btnElementDelete); + this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel4.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanel4.Location = new System.Drawing.Point(0, 59); + this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel4.Name = "flowLayoutPanel4"; + this.flowLayoutPanel4.Size = new System.Drawing.Size(121, 538); + this.flowLayoutPanel4.TabIndex = 6; + this.flowLayoutPanel4.WrapContents = false; + // + // tableLayoutPanel20 + // + this.tableLayoutPanel20.ColumnCount = 2; + this.tableLayoutPanel20.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel20.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel20.Controls.Add(this.btnElementMoveDown, 1, 0); + this.tableLayoutPanel20.Controls.Add(this.btnElementMoveUp, 0, 0); + this.tableLayoutPanel20.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel20.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel20.Name = "tableLayoutPanel20"; + this.tableLayoutPanel20.RowCount = 1; + this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.tableLayoutPanel20.Size = new System.Drawing.Size(121, 40); + this.tableLayoutPanel20.TabIndex = 2; + // + // btnElementMoveDown + // + this.btnElementMoveDown.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementMoveDown.Enabled = false; + this.btnElementMoveDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementMoveDown.Location = new System.Drawing.Point(63, 3); + this.btnElementMoveDown.Name = "btnElementMoveDown"; + this.btnElementMoveDown.Size = new System.Drawing.Size(55, 34); + this.btnElementMoveDown.TabIndex = 1; + this.btnElementMoveDown.Text = "↓"; + this.btnElementMoveDown.UseVisualStyleBackColor = true; + // + // btnElementMoveUp + // + this.btnElementMoveUp.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementMoveUp.Enabled = false; + this.btnElementMoveUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementMoveUp.Location = new System.Drawing.Point(3, 3); + this.btnElementMoveUp.Name = "btnElementMoveUp"; + this.btnElementMoveUp.Size = new System.Drawing.Size(54, 34); + this.btnElementMoveUp.TabIndex = 0; + this.btnElementMoveUp.Text = "↑"; + this.btnElementMoveUp.UseVisualStyleBackColor = true; + // + // btnElementDuplicate + // + this.btnElementDuplicate.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementDuplicate.Enabled = false; + this.btnElementDuplicate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementDuplicate.Location = new System.Drawing.Point(3, 43); + this.btnElementDuplicate.MinimumSize = new System.Drawing.Size(115, 0); + this.btnElementDuplicate.Name = "btnElementDuplicate"; + this.btnElementDuplicate.Size = new System.Drawing.Size(115, 23); + this.btnElementDuplicate.TabIndex = 3; + this.btnElementDuplicate.Text = "Duplicate"; + this.btnElementDuplicate.UseVisualStyleBackColor = true; + // + // btnElementEditSettings + // + this.btnElementEditSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementEditSettings.Enabled = false; + this.btnElementEditSettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementEditSettings.Location = new System.Drawing.Point(3, 72); + this.btnElementEditSettings.MinimumSize = new System.Drawing.Size(115, 0); + this.btnElementEditSettings.Name = "btnElementEditSettings"; + this.btnElementEditSettings.Size = new System.Drawing.Size(115, 23); + this.btnElementEditSettings.TabIndex = 5; + this.btnElementEditSettings.Text = "Edit Settings"; + this.btnElementEditSettings.UseVisualStyleBackColor = true; + this.btnElementEditSettings.Click += new System.EventHandler(this.btnElementEditSettings_Click); + // + // btnElementApplySettings + // + this.btnElementApplySettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementApplySettings.Enabled = false; + this.btnElementApplySettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementApplySettings.Location = new System.Drawing.Point(3, 101); + this.btnElementApplySettings.MinimumSize = new System.Drawing.Size(115, 0); + this.btnElementApplySettings.Name = "btnElementApplySettings"; + this.btnElementApplySettings.Size = new System.Drawing.Size(115, 23); + this.btnElementApplySettings.TabIndex = 6; + this.btnElementApplySettings.Text = "Apply Settings"; + this.btnElementApplySettings.UseVisualStyleBackColor = true; + // + // btnElementDelete + // + this.btnElementDelete.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementDelete.Enabled = false; + this.btnElementDelete.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementDelete.Location = new System.Drawing.Point(3, 130); + this.btnElementDelete.MinimumSize = new System.Drawing.Size(115, 0); + this.btnElementDelete.Name = "btnElementDelete"; + this.btnElementDelete.Size = new System.Drawing.Size(115, 23); + this.btnElementDelete.TabIndex = 4; + this.btnElementDelete.Text = "Delete"; + this.btnElementDelete.UseVisualStyleBackColor = true; + // // tableLayoutPanel16 // this.tableLayoutPanel16.ColumnCount = 1; this.tableLayoutPanel16.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel16.Controls.Add(this.btnAddMoveToChain, 0, 3); + this.tableLayoutPanel16.Controls.Add(this.flowLayoutPanel3, 0, 3); this.tableLayoutPanel16.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel16.Controls.Add(this.flpContent, 0, 2); this.tableLayoutPanel16.Controls.Add(this.flowLayoutPanel2, 0, 1); @@ -455,18 +630,49 @@ private void InitializeComponent() this.tableLayoutPanel16.Size = new System.Drawing.Size(297, 703); this.tableLayoutPanel16.TabIndex = 5; // + // flowLayoutPanel3 + // + this.flowLayoutPanel3.Controls.Add(this.btnAddMoveToChain); + this.flowLayoutPanel3.Controls.Add(this.btnResetMoveSettings); + this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 667); + this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel3.MinimumSize = new System.Drawing.Size(0, 30); + this.flowLayoutPanel3.Name = "flowLayoutPanel3"; + this.flowLayoutPanel3.Size = new System.Drawing.Size(297, 36); + this.flowLayoutPanel3.TabIndex = 7; + // // btnAddMoveToChain // this.btnAddMoveToChain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.btnAddMoveToChain.Location = new System.Drawing.Point(3, 670); + this.btnAddMoveToChain.AutoSize = true; + this.btnAddMoveToChain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnAddMoveToChain.Location = new System.Drawing.Point(0, 3); + this.btnAddMoveToChain.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); + this.btnAddMoveToChain.MinimumSize = new System.Drawing.Size(0, 26); this.btnAddMoveToChain.Name = "btnAddMoveToChain"; - this.btnAddMoveToChain.Size = new System.Drawing.Size(82, 30); + this.btnAddMoveToChain.Size = new System.Drawing.Size(82, 26); this.btnAddMoveToChain.TabIndex = 2; this.btnAddMoveToChain.Text = "Add To Chain"; this.btnAddMoveToChain.UseVisualStyleBackColor = true; this.btnAddMoveToChain.Click += new System.EventHandler(this.btnAddMoveToChain_Click); // + // btnResetMoveSettings + // + this.btnResetMoveSettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.btnResetMoveSettings.Location = new System.Drawing.Point(88, 3); + this.btnResetMoveSettings.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); + this.btnResetMoveSettings.MinimumSize = new System.Drawing.Size(0, 26); + this.btnResetMoveSettings.Name = "btnResetMoveSettings"; + this.btnResetMoveSettings.Size = new System.Drawing.Size(103, 26); + this.btnResetMoveSettings.TabIndex = 3; + this.btnResetMoveSettings.Text = "Reset To Defaults"; + this.ToolTip.SetToolTip(this.btnResetMoveSettings, "Resets the currently selected move settings to their default values."); + this.btnResetMoveSettings.UseVisualStyleBackColor = true; + this.btnResetMoveSettings.Click += new System.EventHandler(this.btnResetMoveControl_Click); + // // label1 // this.label1.AutoSize = true; @@ -763,8 +969,15 @@ private void InitializeComponent() this.tableLayoutPanel9.PerformLayout(); this.tableLayoutPanel12.ResumeLayout(false); this.tableLayoutPanel12.PerformLayout(); + this.tableLayoutPanel18.ResumeLayout(false); + this.tableLayoutPanel19.ResumeLayout(false); + this.tableLayoutPanel19.PerformLayout(); + this.flowLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel20.ResumeLayout(false); this.tableLayoutPanel16.ResumeLayout(false); this.tableLayoutPanel16.PerformLayout(); + this.flowLayoutPanel3.ResumeLayout(false); + this.flowLayoutPanel3.PerformLayout(); this.flpContent.ResumeLayout(false); this.flpContent.PerformLayout(); this.tableLayoutPanel5.ResumeLayout(false); @@ -831,6 +1044,19 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtMoveName; private System.Windows.Forms.Label lblMoveName; private System.Windows.Forms.TreeView tvChain; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; + private System.Windows.Forms.Button btnResetMoveSettings; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel18; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel19; + private System.Windows.Forms.Label lblElementOptions; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4; + private System.Windows.Forms.Button btnElementMoveUp; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel20; + private System.Windows.Forms.Button btnElementMoveDown; + private System.Windows.Forms.Button btnElementDuplicate; + private System.Windows.Forms.Button btnElementEditSettings; + private System.Windows.Forms.Button btnElementApplySettings; + private System.Windows.Forms.Button btnElementDelete; } } diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index c3ac04e..e9a25cd 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -10,6 +10,7 @@ namespace MovementScriptGenerator { public partial class Main : Form { + //Move Controls CircleControl circleControl = new CircleControl(); SpiralControl spiralControl = new SpiralControl(); @@ -39,7 +40,7 @@ public Main() InitializeComponent(); InitializeComboBoxes(); UpdateDescription(); - UpdateContent(); + OnMoveTypeChanged(); UpdateChainWindow(); } @@ -54,7 +55,7 @@ private void UpdateDescription() lblMoveDescription.Text = moveDescriptions[cbType.SelectedIndex]; } - private void UpdateContent() + private void OnMoveTypeChanged() { tlContent.Controls.Clear(); switch (cbType.SelectedIndex) @@ -68,12 +69,26 @@ private void UpdateContent() } } + private void ResetContent() + { + txtMoveName.Text = string.Empty; + switch (tlContent.Controls[0]) + { + case CircleControl _: + circleControl = new CircleControl(); + break; + case SpiralControl _: + spiralControl = new SpiralControl(); + break; + } + } + private void UpdateChainWindow() { foreach(ChainElement el in chain.Elements) { - tvChain.BeginUpdate(); tvChain.Nodes.Clear(); + tvChain.BeginUpdate(); tvChain.Nodes.Add(el.Name); tvChain.EndUpdate(); } @@ -145,16 +160,17 @@ private bool AddToMovementScriptFile(MovementScript script, string filePath) private void cbType_SelectedIndexChanged(object sender, EventArgs e) { UpdateDescription(); - UpdateContent(); + OnMoveTypeChanged(); } private void btnAddMoveToChain_Click(object sender, EventArgs e) { string moveName = txtMoveName.Text; - if (moveName.Replace(" ", String.Empty) == "") + if (!MoveNameValid(moveName)) { moveName = null; } + switch (cbType.SelectedIndex) { case 0: @@ -165,6 +181,9 @@ private void btnAddMoveToChain_Click(object sender, EventArgs e) Spiral spiral = spiralControl.CreateMove(moveName); chain.Elements.Add(spiral); break; + default: + MessageBox.Show("can't add move to chain."); + return; } tvChain.Nodes.Add(chain.Elements.Last().Name); @@ -239,5 +258,110 @@ private void btnGenerateScript_Click(object sender, EventArgs e) }; } } + + private void btnResetMoveControl_Click(object sender, EventArgs e) + { + ResetContent(); + OnMoveTypeChanged(); + } + + private void btnApplySettingsToSelected_Click(object sender, EventArgs e) + { + string newMoveName = txtMoveName.Text; + if (!MoveNameValid(newMoveName)) + { + newMoveName = null; + } + try + { + TreeNode selectedNode = tvChain.SelectedNode; + if(selectedNode == null) + { + MessageBox.Show("Couldn't apply settings. Make sure that you have selected an element of the chain."); + return; + } + ChainElement selectedElement = chain.Elements[selectedNode.Index]; + + switch (cbType.SelectedIndex) + { + case 0: + if(selectedElement is Circle) + { + Circle circle = circleControl.CreateMove(newMoveName); + chain.Elements[selectedNode.Index] = circle; + selectedElement = circle; + } + else + { + MessageBox.Show("Can't apply these settings to the currently selected chain element because the element is not a circle move."); + return; + } + break; + case 1: + if(selectedElement is Spiral) + { + Spiral spiral = spiralControl.CreateMove(newMoveName); + selectedElement = spiral; + } + else + { + MessageBox.Show("Can't apply these settings to the currently selected chain element because the element is not a spiral move."); + return; + } + break; + + default: + MessageBox.Show("Can't apply these settings to the currently selected chain element."); + return; + } + + UpdateChainWindow(); + } + catch + { + MessageBox.Show("Couldn't apply settings. Make sure that you have selected an element of the chain that is the same type of element as your settings."); + } + } + + private bool MoveNameValid(string moveName) + { + if (moveName.Replace(" ", String.Empty) == "") + { + return false; + } + + return true; + } + + private void btnElementEditSettings_Click(object sender, EventArgs e) + { + if(tvChain.SelectedNode == null) + { + MessageBox.Show("No element selected to edit.\nPlease select an element from the chain."); + return; + } + ChainElement selectedElementInChain = chain.Elements[tvChain.SelectedNode.Index]; + bool populatingOfFieldsSuccessful = true; + switch (selectedElementInChain) + { + case Circle circleElement: + populatingOfFieldsSuccessful = circleControl.Populate(circleElement); + break; + case Spiral spiralElement: + populatingOfFieldsSuccessful = spiralControl.Populate(spiralElement); + break; + default: + MessageBox.Show("Can't get the settings of the selected element."); + return; + } + if (!populatingOfFieldsSuccessful) + { + MessageBox.Show("Couldn't edit the selected element."); + } + else + { + txtMoveName.Text = selectedElementInChain.Name; + } + } } } diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index 167a161..44d9a53 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -120,6 +120,9 @@ 17, 17 + + 17, 17 + On -> the script will pause, while the song is paused and start playing when the song starts. diff --git a/MovementScriptGenerator/Modules/Moves/Circle.cs b/MovementScriptGenerator/Modules/Moves/Circle.cs index 145ab3b..d3ff149 100644 --- a/MovementScriptGenerator/Modules/Moves/Circle.cs +++ b/MovementScriptGenerator/Modules/Moves/Circle.cs @@ -6,13 +6,13 @@ namespace MovementScriptGenerator { public class Circle : Move { - private float rotX; - private float rotZ; - private float distance; - private float startingPointDegree; - private float sectorDegrees; - private int iterations; - private bool rotateClockwise; + public float RotX { get; } + public float RotZ { get; } + public float Distance { get; } + public float StartingPointDegree { get; } + public float SectorDegrees { get; } + public int Iterations { get; } + public bool RotateClockwise { get; } public Circle( string name, int fov, @@ -30,43 +30,44 @@ public Circle( Fov = fov; Duration = duration; Height = height; - this.rotX = rotX; - this.rotZ = rotZ; - this.distance = distance; - this.startingPointDegree = startingPointDegree; - this.sectorDegrees = sectorDegrees; - this.iterations = iterations; - this.rotateClockwise = rotateClockwise; + RotX = rotX; + RotZ = rotZ; + Distance = distance; + StartingPointDegree = startingPointDegree; + SectorDegrees = sectorDegrees; + Iterations = iterations; + RotateClockwise = rotateClockwise; } + public override List GenerateFrames() { List frames = new List(); float initialDegree = 0; - float maxDegrees = sectorDegrees - 1; + float maxDegrees = SectorDegrees - 1; float initialDegreeAddend = 1; - if (!rotateClockwise) { + if (!RotateClockwise) { initialDegree *= -1; maxDegrees *= -1; initialDegreeAddend *= -1; } - for (float i = initialDegree; (rotateClockwise && i <= maxDegrees) || (!rotateClockwise && i >= maxDegrees); i += (float)initialDegreeAddend / iterations) + for (float i = initialDegree; (RotateClockwise && i <= maxDegrees) || (!RotateClockwise && i >= maxDegrees); i += (float)initialDegreeAddend / Iterations) { - float usedDegree = i + startingPointDegree; + float usedDegree = i + StartingPointDegree; double radiant = usedDegree * Math.PI / 180; Frame frame = new Frame(); frame.Position = new Position(); frame.Rotation = new Rotation(); - frame.Position.X = (float)Math.Sin(radiant) * distance; + frame.Position.X = (float)Math.Sin(radiant) * Distance; frame.Position.Y = Height; - frame.Position.Z = (float)Math.Cos(radiant) * distance; + frame.Position.Z = (float)Math.Cos(radiant) * Distance; - frame.Rotation.Z = rotZ; - frame.Rotation.X = rotX; + frame.Rotation.Z = RotZ; + frame.Rotation.X = RotX; frame.Rotation.Y = usedDegree -180; if (usedDegree == 0 || usedDegree == 180 || usedDegree == 360) @@ -79,7 +80,7 @@ public override List GenerateFrames() } - frame.Duration = Duration / Math.Abs(maxDegrees) / iterations; + frame.Duration = Duration / Math.Abs(maxDegrees) / Iterations; if(Fov > 0) { diff --git a/MovementScriptGenerator/Modules/Moves/Spiral.cs b/MovementScriptGenerator/Modules/Moves/Spiral.cs index 007d83a..ef0930a 100644 --- a/MovementScriptGenerator/Modules/Moves/Spiral.cs +++ b/MovementScriptGenerator/Modules/Moves/Spiral.cs @@ -6,15 +6,15 @@ namespace MovementScriptGenerator { public class Spiral : Move { - private float startDistance; - private float endDistance; - private float horizontalRot; - private float verticalRot; - private float spiralAmmount; - private bool spiralClockwise; - private float startHold; - private float endHold; - private bool ease; + public float StartDistance { get; } + public float EndDistance { get; } + public float HorizontalRot { get; } + public float VerticalRot { get; } + public float SpiralAmmount { get; } + public bool SpiralClockwise { get; } + public float StartHold { get; } + public float EndHold { get; } + public bool Ease { get; } public Spiral( string name, int fov, @@ -34,34 +34,34 @@ public Spiral( Fov = fov; Duration = duration; Height = height; - this.startDistance = startDistance; - this.endDistance = endDistance; - this.horizontalRot = horizontalRot; - this.verticalRot = verticalRot; - this.spiralAmmount = spiralAmmount; - this.spiralClockwise = spiralClockwise; - this.startHold = startHold; - this.endHold = endHold; - this.ease = ease; + StartDistance = startDistance; + EndDistance = endDistance; + HorizontalRot = horizontalRot; + VerticalRot = verticalRot; + SpiralAmmount = spiralAmmount; + SpiralClockwise = spiralClockwise; + StartHold = startHold; + EndHold = endHold; + Ease = ease; } public override List GenerateFrames() { List frames = new List(); - double horizontalRadiant = horizontalRot * Math.PI / 180; + double horizontalRadiant = HorizontalRot * Math.PI / 180; float xHorizontal = (float)Math.Sin(horizontalRadiant); float zHorizontal = (float)Math.Cos(horizontalRadiant); - double verticalRadiant = verticalRot * Math.PI / 180; + double verticalRadiant = VerticalRot * Math.PI / 180; float yVertical = (float)Math.Sin(verticalRadiant); float zVertical = (float)Math.Cos(verticalRadiant); - float pathLength = startDistance - endDistance; - float spiralLength = pathLength / spiralAmmount; + float pathLength = StartDistance - EndDistance; + float spiralLength = pathLength / SpiralAmmount; - switch (horizontalRot) + switch (HorizontalRot) { case 0: zHorizontal = 1; @@ -80,7 +80,7 @@ public override List GenerateFrames() break; } - switch (verticalRot) + switch (VerticalRot) { case 0: yVertical = 0; @@ -97,29 +97,29 @@ public override List GenerateFrames() { Position = new Position() { - X = xHorizontal * zVertical * startDistance, - Y = yVertical * startDistance + Height, - Z = zHorizontal * zVertical * startDistance + X = xHorizontal * zVertical * StartDistance, + Y = yVertical * StartDistance + Height, + Z = zHorizontal * zVertical * StartDistance }, Rotation = new Rotation() { - X = verticalRot, - Y = horizontalRot - 180, + X = VerticalRot, + Y = HorizontalRot - 180, Z = 0 }, - HoldTime = startHold, + HoldTime = StartHold, Fov = Fov }; frames.Add(startFrame); - for(int i = 0; i < spiralAmmount; i++) + for(int i = 0; i < SpiralAmmount; i++) { List spiralFrames = new List(); - float SpiralStartDistance = startDistance - (i*spiralLength); + float SpiralStartDistance = StartDistance - (i*spiralLength); float spiralHalfwayDistance = SpiralStartDistance - (spiralLength / 2); float spiralEndDistance = spiralHalfwayDistance - (spiralLength / 2); @@ -138,12 +138,12 @@ public override List GenerateFrames() Rotation = new Rotation() { - X = verticalRot, - Y = horizontalRot - 180, - Z = spiralClockwise ? -rotation : rotation + X = VerticalRot, + Y = HorizontalRot - 180, + Z = SpiralClockwise ? -rotation : rotation }, - Duration = Duration / spiralAmmount / 360, + Duration = Duration / SpiralAmmount / 360, Fov = Fov }; @@ -158,23 +158,23 @@ public override List GenerateFrames() { Position = new Position() { - X = xHorizontal * zVertical * endDistance, - Y = yVertical * endDistance + Height, - Z = zHorizontal * zVertical * endDistance + X = xHorizontal * zVertical * EndDistance, + Y = yVertical * EndDistance + Height, + Z = zHorizontal * zVertical * EndDistance }, Rotation = new Rotation() { - X = verticalRot, - Y = horizontalRot - 180, - Z = spiralAmmount > 0 ? (spiralClockwise ? -360 : 360) : 0 + X = VerticalRot, + Y = HorizontalRot - 180, + Z = SpiralAmmount > 0 ? (SpiralClockwise ? -360 : 360) : 0 }, - HoldTime = endHold, + HoldTime = EndHold, - Transition = ease && spiralAmmount <= 0 ? "Eased" : "Linear", + Transition = Ease && SpiralAmmount <= 0 ? "Eased" : "Linear", - Duration = spiralAmmount > 0 ? (Duration / spiralAmmount / 360) : Duration, + Duration = SpiralAmmount > 0 ? (Duration / SpiralAmmount / 360) : Duration, Fov = Fov }; diff --git a/MovementScriptGenerator/SpiralControl.cs b/MovementScriptGenerator/SpiralControl.cs index 14aec92..cd94fbf 100644 --- a/MovementScriptGenerator/SpiralControl.cs +++ b/MovementScriptGenerator/SpiralControl.cs @@ -25,6 +25,31 @@ private void initializeComboBoxes() cbSpiralRotation.SelectedIndex = 0; } + public bool Populate(Spiral original) + { + try + { + numFOV.Value = original.Fov; + numDuration.Value = (decimal)original.Duration; + numHeight.Value = (decimal)original.Height; + numStartDistance.Value = (decimal)original.StartDistance; + numEndDistance.Value = (decimal)original.EndDistance; + numHorizontalRot.Value = (decimal)original.HorizontalRot; + numVerticalRot.Value = (decimal)original.VerticalRot; + numSpiralAmmount.Value = (decimal)original.SpiralAmmount; + cbSpiralRotation.SelectedIndex = original.SpiralClockwise ? 0 : 1; + numStartHoldTime.Value = (decimal)original.StartHold; + numEndHoldTime.Value = (decimal)original.EndHold; + checkEase.Checked = original.Ease; + } + catch + { + return false; + } + + return true; + } + private void numSpiralAmmount_ValueChanged(object sender, EventArgs e) { if (numSpiralAmmount.Value > 0) From 012f29726f2e0c73776b311458655585174bdd2c Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Wed, 14 Dec 2022 23:49:51 +0100 Subject: [PATCH 03/21] - Added functionality to Element Move Up / Down Buttons --- MovementScriptGenerator/Form1.Designer.cs | 18 +++--- MovementScriptGenerator/Form1.cs | 75 ++++++++++++++++++++++- 2 files changed, 83 insertions(+), 10 deletions(-) diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index 45b3c79..344d508 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -469,6 +469,7 @@ private void InitializeComponent() this.tvChain.Name = "tvChain"; this.tvChain.Size = new System.Drawing.Size(478, 591); this.tvChain.TabIndex = 7; + this.tvChain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvChain_AfterSelect); // // tableLayoutPanel19 // @@ -530,7 +531,7 @@ private void InitializeComponent() this.tableLayoutPanel20.RowCount = 1; this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); - this.tableLayoutPanel20.Size = new System.Drawing.Size(121, 40); + this.tableLayoutPanel20.Size = new System.Drawing.Size(121, 32); this.tableLayoutPanel20.TabIndex = 2; // // btnElementMoveDown @@ -540,10 +541,11 @@ private void InitializeComponent() this.btnElementMoveDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnElementMoveDown.Location = new System.Drawing.Point(63, 3); this.btnElementMoveDown.Name = "btnElementMoveDown"; - this.btnElementMoveDown.Size = new System.Drawing.Size(55, 34); + this.btnElementMoveDown.Size = new System.Drawing.Size(55, 26); this.btnElementMoveDown.TabIndex = 1; this.btnElementMoveDown.Text = "↓"; this.btnElementMoveDown.UseVisualStyleBackColor = true; + this.btnElementMoveDown.Click += new System.EventHandler(this.btnElementMoveDown_Click); // // btnElementMoveUp // @@ -552,17 +554,18 @@ private void InitializeComponent() this.btnElementMoveUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnElementMoveUp.Location = new System.Drawing.Point(3, 3); this.btnElementMoveUp.Name = "btnElementMoveUp"; - this.btnElementMoveUp.Size = new System.Drawing.Size(54, 34); + this.btnElementMoveUp.Size = new System.Drawing.Size(54, 26); this.btnElementMoveUp.TabIndex = 0; this.btnElementMoveUp.Text = "↑"; this.btnElementMoveUp.UseVisualStyleBackColor = true; + this.btnElementMoveUp.Click += new System.EventHandler(this.btnElementMoveUp_Click); // // btnElementDuplicate // this.btnElementDuplicate.Dock = System.Windows.Forms.DockStyle.Fill; this.btnElementDuplicate.Enabled = false; this.btnElementDuplicate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementDuplicate.Location = new System.Drawing.Point(3, 43); + this.btnElementDuplicate.Location = new System.Drawing.Point(3, 35); this.btnElementDuplicate.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementDuplicate.Name = "btnElementDuplicate"; this.btnElementDuplicate.Size = new System.Drawing.Size(115, 23); @@ -575,7 +578,7 @@ private void InitializeComponent() this.btnElementEditSettings.Dock = System.Windows.Forms.DockStyle.Fill; this.btnElementEditSettings.Enabled = false; this.btnElementEditSettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementEditSettings.Location = new System.Drawing.Point(3, 72); + this.btnElementEditSettings.Location = new System.Drawing.Point(3, 64); this.btnElementEditSettings.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementEditSettings.Name = "btnElementEditSettings"; this.btnElementEditSettings.Size = new System.Drawing.Size(115, 23); @@ -589,20 +592,21 @@ private void InitializeComponent() this.btnElementApplySettings.Dock = System.Windows.Forms.DockStyle.Fill; this.btnElementApplySettings.Enabled = false; this.btnElementApplySettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementApplySettings.Location = new System.Drawing.Point(3, 101); + this.btnElementApplySettings.Location = new System.Drawing.Point(3, 93); this.btnElementApplySettings.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementApplySettings.Name = "btnElementApplySettings"; this.btnElementApplySettings.Size = new System.Drawing.Size(115, 23); this.btnElementApplySettings.TabIndex = 6; this.btnElementApplySettings.Text = "Apply Settings"; this.btnElementApplySettings.UseVisualStyleBackColor = true; + this.btnElementApplySettings.Click += new System.EventHandler(this.btnElementApplySettings_Click); // // btnElementDelete // this.btnElementDelete.Dock = System.Windows.Forms.DockStyle.Fill; this.btnElementDelete.Enabled = false; this.btnElementDelete.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementDelete.Location = new System.Drawing.Point(3, 130); + this.btnElementDelete.Location = new System.Drawing.Point(3, 122); this.btnElementDelete.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementDelete.Name = "btnElementDelete"; this.btnElementDelete.Size = new System.Drawing.Size(115, 23); diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index e9a25cd..03db1c3 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -85,9 +85,9 @@ private void ResetContent() private void UpdateChainWindow() { - foreach(ChainElement el in chain.Elements) + tvChain.Nodes.Clear(); + foreach (ChainElement el in chain.Elements) { - tvChain.Nodes.Clear(); tvChain.BeginUpdate(); tvChain.Nodes.Add(el.Name); tvChain.EndUpdate(); @@ -265,7 +265,7 @@ private void btnResetMoveControl_Click(object sender, EventArgs e) OnMoveTypeChanged(); } - private void btnApplySettingsToSelected_Click(object sender, EventArgs e) + private void btnElementApplySettings_Click(object sender, EventArgs e) { string newMoveName = txtMoveName.Text; if (!MoveNameValid(newMoveName)) @@ -363,5 +363,74 @@ private void btnElementEditSettings_Click(object sender, EventArgs e) txtMoveName.Text = selectedElementInChain.Name; } } + + private void tvChain_AfterSelect(object sender, TreeViewEventArgs e) + { + ChainElement selectedElementInChain = chain.Elements[tvChain.SelectedNode.Index]; + + if (typeof(Move).IsInstanceOfType(selectedElementInChain)) + { + EnableElementOptionsMoveType(); + return; + } + + DisableElementOptionsAll(); + } + + private void EnableElementOptionsMoveType() + { + btnElementMoveUp.Enabled = true; + btnElementMoveDown.Enabled = true; + btnElementEditSettings.Enabled = true; + btnElementApplySettings.Enabled = true; + btnElementDuplicate.Enabled = true; + btnElementDelete.Enabled = true; + } + + private void DisableElementOptionsAll() + { + btnElementMoveUp.Enabled = false; + btnElementMoveDown.Enabled = false; + btnElementEditSettings.Enabled = false; + btnElementApplySettings.Enabled = false; + btnElementDuplicate.Enabled = false; + btnElementDelete.Enabled = false; + } + + private void btnElementMoveUp_Click(object sender, EventArgs e) + { + if(tvChain.SelectedNode.Index != 0) + { + TreeNode selectedTreeElement = tvChain.SelectedNode; + ChainElement selectedChainElement = chain.Elements[selectedTreeElement.Index]; + + chain.Elements.Remove(selectedChainElement); + chain.Elements.Insert(selectedTreeElement.Index - 1, selectedChainElement); + + tvChain.BeginUpdate(); + tvChain.Nodes.Remove(selectedTreeElement); + tvChain.Nodes.Insert(selectedTreeElement.Index - 1, selectedTreeElement); + tvChain.SelectedNode = selectedTreeElement; + tvChain.EndUpdate(); + } + } + + private void btnElementMoveDown_Click(object sender, EventArgs e) + { + if (tvChain.SelectedNode.Index != tvChain.Nodes.Count -1) + { + TreeNode selectedTreeElement = tvChain.SelectedNode; + ChainElement selectedChainElement = chain.Elements[selectedTreeElement.Index]; + + chain.Elements.Remove(selectedChainElement); + chain.Elements.Insert(selectedTreeElement.Index + 1, selectedChainElement); + + tvChain.BeginUpdate(); + tvChain.Nodes.Remove(selectedTreeElement); + tvChain.Nodes.Insert(selectedTreeElement.Index + 1, selectedTreeElement); + tvChain.SelectedNode = selectedTreeElement; + tvChain.EndUpdate(); + } + } } } From 6997fac9d28357eff33b5b23729111ef9dd8b3b0 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Sun, 18 Dec 2022 01:06:36 +0100 Subject: [PATCH 04/21] - improved functionality of "Element Get Settings" and "Element Apply Settings" - Added functionality for Duplicate Element - Duplicate now creates a new element instead of referencing the original - Added icons for chain elements - Added enum for chain elements - tweaked ui - Added functionality to edit the save path via ui --- MovementScriptGenerator/ChainElementsEnum.cs | 11 + MovementScriptGenerator/Form1.Designer.cs | 166 ++++++----- MovementScriptGenerator/Form1.cs | 272 +++++++++++++----- MovementScriptGenerator/Form1.resx | 7 + .../Icons/0_Circle_Icon.png | Bin 0 -> 1807 bytes .../Icons/1_Spiral_Icon.png | Bin 0 -> 1956 bytes .../Icons/2_JTurn_Icon.png | Bin 0 -> 1718 bytes .../Modules/ChainElement.cs | 14 +- MovementScriptGenerator/Modules/Move.cs | 1 - .../Modules/Moves/Spiral.cs | 2 +- .../MovementScriptGenerator.csproj | 1 + 11 files changed, 310 insertions(+), 164 deletions(-) create mode 100644 MovementScriptGenerator/ChainElementsEnum.cs create mode 100644 MovementScriptGenerator/Icons/0_Circle_Icon.png create mode 100644 MovementScriptGenerator/Icons/1_Spiral_Icon.png create mode 100644 MovementScriptGenerator/Icons/2_JTurn_Icon.png diff --git a/MovementScriptGenerator/ChainElementsEnum.cs b/MovementScriptGenerator/ChainElementsEnum.cs new file mode 100644 index 0000000..96fc53c --- /dev/null +++ b/MovementScriptGenerator/ChainElementsEnum.cs @@ -0,0 +1,11 @@ + +namespace MovementScriptGenerator +{ + enum ChainElementsEnum + { + Circle, + Spiral, + JTurn, + Group + } +} diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index 344d508..9d0329e 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -36,8 +36,6 @@ private void InitializeComponent() this.tableLayoutPanel13 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel14 = new System.Windows.Forms.TableLayoutPanel(); this.label2 = new System.Windows.Forms.Label(); - this.tableLayoutPanel15 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel11 = new System.Windows.Forms.TableLayoutPanel(); this.txtPath = new System.Windows.Forms.TextBox(); this.lblPath = new System.Windows.Forms.Label(); this.btnGenerateScript = new System.Windows.Forms.Button(); @@ -63,7 +61,7 @@ private void InitializeComponent() this.btnElementMoveDown = new System.Windows.Forms.Button(); this.btnElementMoveUp = new System.Windows.Forms.Button(); this.btnElementDuplicate = new System.Windows.Forms.Button(); - this.btnElementEditSettings = new System.Windows.Forms.Button(); + this.btnElementGetSettings = new System.Windows.Forms.Button(); this.btnElementApplySettings = new System.Windows.Forms.Button(); this.btnElementDelete = new System.Windows.Forms.Button(); this.tableLayoutPanel16 = new System.Windows.Forms.TableLayoutPanel(); @@ -90,11 +88,11 @@ private void InitializeComponent() this.txtMoveName = new System.Windows.Forms.TextBox(); this.lblMoveName = new System.Windows.Forms.Label(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); + this.tableLayoutPanel21 = new System.Windows.Forms.TableLayoutPanel(); + this.btnEditPath = new System.Windows.Forms.Button(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel13.SuspendLayout(); this.tableLayoutPanel14.SuspendLayout(); - this.tableLayoutPanel15.SuspendLayout(); - this.tableLayoutPanel11.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel10.SuspendLayout(); @@ -114,6 +112,7 @@ private void InitializeComponent() this.flowLayoutPanel2.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); this.tableLayoutPanel17.SuspendLayout(); + this.tableLayoutPanel21.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -131,7 +130,7 @@ private void InitializeComponent() this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 7.5F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 87.5F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(954, 811); + this.tableLayoutPanel1.Size = new System.Drawing.Size(894, 811); this.tableLayoutPanel1.TabIndex = 2; // // lblTitle @@ -141,7 +140,7 @@ private void InitializeComponent() this.lblTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblTitle.Location = new System.Drawing.Point(23, 0); this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(908, 60); + this.lblTitle.Size = new System.Drawing.Size(848, 60); this.lblTitle.TabIndex = 0; this.lblTitle.Text = "MovementScriptGenerator"; this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -158,7 +157,7 @@ private void InitializeComponent() this.tableLayoutPanel13.Name = "tableLayoutPanel13"; this.tableLayoutPanel13.RowCount = 1; this.tableLayoutPanel13.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel13.Size = new System.Drawing.Size(908, 703); + this.tableLayoutPanel13.Size = new System.Drawing.Size(848, 703); this.tableLayoutPanel13.TabIndex = 7; // // tableLayoutPanel14 @@ -166,9 +165,9 @@ private void InitializeComponent() this.tableLayoutPanel14.ColumnCount = 1; this.tableLayoutPanel14.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel14.Controls.Add(this.label2, 0, 0); - this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel15, 0, 3); this.tableLayoutPanel14.Controls.Add(this.flowLayoutPanel1, 0, 1); this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel18, 0, 2); + this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel21, 0, 3); this.tableLayoutPanel14.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel14.Location = new System.Drawing.Point(303, 0); this.tableLayoutPanel14.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); @@ -178,7 +177,7 @@ private void InitializeComponent() this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F)); this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel14.Size = new System.Drawing.Size(605, 703); + this.tableLayoutPanel14.Size = new System.Drawing.Size(545, 703); this.tableLayoutPanel14.TabIndex = 4; // // label2 @@ -188,53 +187,19 @@ private void InitializeComponent() this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(3, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(599, 35); + this.label2.Size = new System.Drawing.Size(539, 35); this.label2.TabIndex = 5; this.label2.Text = "Move Chain"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // tableLayoutPanel15 - // - this.tableLayoutPanel15.ColumnCount = 2; - this.tableLayoutPanel15.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); - this.tableLayoutPanel15.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); - this.tableLayoutPanel15.Controls.Add(this.tableLayoutPanel11, 0, 0); - this.tableLayoutPanel15.Controls.Add(this.btnGenerateScript, 1, 0); - this.tableLayoutPanel15.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel15.Location = new System.Drawing.Point(0, 667); - this.tableLayoutPanel15.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel15.MinimumSize = new System.Drawing.Size(0, 30); - this.tableLayoutPanel15.Name = "tableLayoutPanel15"; - this.tableLayoutPanel15.RowCount = 1; - this.tableLayoutPanel15.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel15.Size = new System.Drawing.Size(605, 36); - this.tableLayoutPanel15.TabIndex = 0; - // - // tableLayoutPanel11 - // - this.tableLayoutPanel11.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel11.ColumnCount = 2; - this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); - this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel11.Controls.Add(this.txtPath, 1, 0); - this.tableLayoutPanel11.Controls.Add(this.lblPath, 0, 0); - this.tableLayoutPanel11.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel11.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel11.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel11.Name = "tableLayoutPanel11"; - this.tableLayoutPanel11.RowCount = 1; - this.tableLayoutPanel11.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel11.Size = new System.Drawing.Size(484, 36); - this.tableLayoutPanel11.TabIndex = 6; - // // txtPath // - this.txtPath.Dock = System.Windows.Forms.DockStyle.Bottom; - this.txtPath.Location = new System.Drawing.Point(43, 13); + this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPath.Location = new System.Drawing.Point(164, 3); this.txtPath.Name = "txtPath"; - this.txtPath.Size = new System.Drawing.Size(438, 20); + this.txtPath.Size = new System.Drawing.Size(257, 20); this.txtPath.TabIndex = 1; - this.txtPath.Text = "D:\\SteamLibrary\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScripts\\"; + this.txtPath.Text = "D:\\SteamLibrary\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScripts"; // // lblPath // @@ -245,15 +210,15 @@ private void InitializeComponent() this.lblPath.Size = new System.Drawing.Size(34, 36); this.lblPath.TabIndex = 0; this.lblPath.Text = "Path:"; - this.lblPath.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - this.ToolTip.SetToolTip(this.lblPath, "Only edit this if you want to change the directory/path where the file will be sa" + - "ved"); + this.lblPath.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.ToolTip.SetToolTip(this.lblPath, resources.GetString("lblPath.ToolTip")); // // btnGenerateScript // - this.btnGenerateScript.Location = new System.Drawing.Point(487, 3); + this.btnGenerateScript.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnGenerateScript.Location = new System.Drawing.Point(427, 3); this.btnGenerateScript.Name = "btnGenerateScript"; - this.btnGenerateScript.Size = new System.Drawing.Size(97, 30); + this.btnGenerateScript.Size = new System.Drawing.Size(115, 30); this.btnGenerateScript.TabIndex = 1; this.btnGenerateScript.Text = "Generate Script"; this.btnGenerateScript.UseVisualStyleBackColor = true; @@ -270,7 +235,7 @@ private void InitializeComponent() this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(0, 30); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(605, 35); + this.flowLayoutPanel1.Size = new System.Drawing.Size(545, 35); this.flowLayoutPanel1.TabIndex = 6; // // tableLayoutPanel2 @@ -448,8 +413,8 @@ private void InitializeComponent() // tableLayoutPanel18 // this.tableLayoutPanel18.ColumnCount = 2; - this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); - this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); this.tableLayoutPanel18.Controls.Add(this.tvChain, 0, 0); this.tableLayoutPanel18.Controls.Add(this.tableLayoutPanel19, 1, 0); this.tableLayoutPanel18.Dock = System.Windows.Forms.DockStyle.Fill; @@ -458,16 +423,17 @@ private void InitializeComponent() this.tableLayoutPanel18.Name = "tableLayoutPanel18"; this.tableLayoutPanel18.RowCount = 1; this.tableLayoutPanel18.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel18.Size = new System.Drawing.Size(605, 597); + this.tableLayoutPanel18.Size = new System.Drawing.Size(545, 597); this.tableLayoutPanel18.TabIndex = 7; // // tvChain // this.tvChain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tvChain.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tvChain.HideSelection = false; this.tvChain.Location = new System.Drawing.Point(3, 3); this.tvChain.Name = "tvChain"; - this.tvChain.Size = new System.Drawing.Size(478, 591); + this.tvChain.Size = new System.Drawing.Size(418, 591); this.tvChain.TabIndex = 7; this.tvChain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvChain_AfterSelect); // @@ -479,7 +445,7 @@ private void InitializeComponent() this.tableLayoutPanel19.Controls.Add(this.lblElementOptions, 0, 0); this.tableLayoutPanel19.Controls.Add(this.flowLayoutPanel4, 0, 1); this.tableLayoutPanel19.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel19.Location = new System.Drawing.Point(484, 0); + this.tableLayoutPanel19.Location = new System.Drawing.Point(424, 0); this.tableLayoutPanel19.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel19.Name = "tableLayoutPanel19"; this.tableLayoutPanel19.RowCount = 2; @@ -506,7 +472,7 @@ private void InitializeComponent() this.flowLayoutPanel4.AutoScroll = true; this.flowLayoutPanel4.Controls.Add(this.tableLayoutPanel20); this.flowLayoutPanel4.Controls.Add(this.btnElementDuplicate); - this.flowLayoutPanel4.Controls.Add(this.btnElementEditSettings); + this.flowLayoutPanel4.Controls.Add(this.btnElementGetSettings); this.flowLayoutPanel4.Controls.Add(this.btnElementApplySettings); this.flowLayoutPanel4.Controls.Add(this.btnElementDelete); this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; @@ -530,7 +496,7 @@ private void InitializeComponent() this.tableLayoutPanel20.Name = "tableLayoutPanel20"; this.tableLayoutPanel20.RowCount = 1; this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); this.tableLayoutPanel20.Size = new System.Drawing.Size(121, 32); this.tableLayoutPanel20.TabIndex = 2; // @@ -572,20 +538,21 @@ private void InitializeComponent() this.btnElementDuplicate.TabIndex = 3; this.btnElementDuplicate.Text = "Duplicate"; this.btnElementDuplicate.UseVisualStyleBackColor = true; - // - // btnElementEditSettings - // - this.btnElementEditSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnElementEditSettings.Enabled = false; - this.btnElementEditSettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementEditSettings.Location = new System.Drawing.Point(3, 64); - this.btnElementEditSettings.MinimumSize = new System.Drawing.Size(115, 0); - this.btnElementEditSettings.Name = "btnElementEditSettings"; - this.btnElementEditSettings.Size = new System.Drawing.Size(115, 23); - this.btnElementEditSettings.TabIndex = 5; - this.btnElementEditSettings.Text = "Edit Settings"; - this.btnElementEditSettings.UseVisualStyleBackColor = true; - this.btnElementEditSettings.Click += new System.EventHandler(this.btnElementEditSettings_Click); + this.btnElementDuplicate.Click += new System.EventHandler(this.btnElementDuplicate_Click); + // + // btnElementGetSettings + // + this.btnElementGetSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementGetSettings.Enabled = false; + this.btnElementGetSettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementGetSettings.Location = new System.Drawing.Point(3, 64); + this.btnElementGetSettings.MinimumSize = new System.Drawing.Size(115, 0); + this.btnElementGetSettings.Name = "btnElementGetSettings"; + this.btnElementGetSettings.Size = new System.Drawing.Size(115, 23); + this.btnElementGetSettings.TabIndex = 5; + this.btnElementGetSettings.Text = "Get Settings"; + this.btnElementGetSettings.UseVisualStyleBackColor = true; + this.btnElementGetSettings.Click += new System.EventHandler(this.btnElementEditSettings_Click); // // btnElementApplySettings // @@ -613,6 +580,7 @@ private void InitializeComponent() this.btnElementDelete.TabIndex = 4; this.btnElementDelete.Text = "Delete"; this.btnElementDelete.UseVisualStyleBackColor = true; + this.btnElementDelete.Click += new System.EventHandler(this.btnElementDelete_Click); // // tableLayoutPanel16 // @@ -945,14 +913,45 @@ private void InitializeComponent() this.ToolTip.IsBalloon = true; this.ToolTip.ReshowDelay = 100; // + // tableLayoutPanel21 + // + this.tableLayoutPanel21.ColumnCount = 4; + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); + this.tableLayoutPanel21.Controls.Add(this.btnEditPath, 1, 0); + this.tableLayoutPanel21.Controls.Add(this.txtPath, 2, 0); + this.tableLayoutPanel21.Controls.Add(this.btnGenerateScript, 3, 0); + this.tableLayoutPanel21.Controls.Add(this.lblPath, 0, 0); + this.tableLayoutPanel21.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel21.Location = new System.Drawing.Point(0, 667); + this.tableLayoutPanel21.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel21.Name = "tableLayoutPanel21"; + this.tableLayoutPanel21.RowCount = 1; + this.tableLayoutPanel21.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel21.Size = new System.Drawing.Size(545, 36); + this.tableLayoutPanel21.TabIndex = 8; + // + // btnEditPath + // + this.btnEditPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnEditPath.Location = new System.Drawing.Point(43, 3); + this.btnEditPath.Name = "btnEditPath"; + this.btnEditPath.Size = new System.Drawing.Size(115, 30); + this.btnEditPath.TabIndex = 2; + this.btnEditPath.Text = "Edit Path"; + this.btnEditPath.UseVisualStyleBackColor = true; + this.btnEditPath.Click += new System.EventHandler(this.btnEditPath_Click); + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(954, 811); + this.ClientSize = new System.Drawing.Size(894, 811); this.Controls.Add(this.tableLayoutPanel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(970, 100); + this.MinimumSize = new System.Drawing.Size(910, 100); this.Name = "Main"; this.Text = "MovementScriptGenerator"; this.tableLayoutPanel1.ResumeLayout(false); @@ -960,9 +959,6 @@ private void InitializeComponent() this.tableLayoutPanel13.ResumeLayout(false); this.tableLayoutPanel14.ResumeLayout(false); this.tableLayoutPanel14.PerformLayout(); - this.tableLayoutPanel15.ResumeLayout(false); - this.tableLayoutPanel11.ResumeLayout(false); - this.tableLayoutPanel11.PerformLayout(); this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); @@ -996,6 +992,8 @@ private void InitializeComponent() this.tableLayoutPanel4.PerformLayout(); this.tableLayoutPanel17.ResumeLayout(false); this.tableLayoutPanel17.PerformLayout(); + this.tableLayoutPanel21.ResumeLayout(false); + this.tableLayoutPanel21.PerformLayout(); this.ResumeLayout(false); } @@ -1019,7 +1017,6 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10; private System.Windows.Forms.Label lblSyncToSong; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel11; private System.Windows.Forms.CheckBox checkSyncToSong; private System.Windows.Forms.Label lblMoveDescriptionTitle; private System.Windows.Forms.Label lblMoveDescription; @@ -1035,7 +1032,6 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel13; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel14; private System.Windows.Forms.Label label2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel15; private System.Windows.Forms.Button btnAddMoveToChain; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel16; private System.Windows.Forms.Label label1; @@ -1058,9 +1054,11 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel20; private System.Windows.Forms.Button btnElementMoveDown; private System.Windows.Forms.Button btnElementDuplicate; - private System.Windows.Forms.Button btnElementEditSettings; + private System.Windows.Forms.Button btnElementGetSettings; private System.Windows.Forms.Button btnElementApplySettings; private System.Windows.Forms.Button btnElementDelete; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel21; + private System.Windows.Forms.Button btnEditPath; } } diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 03db1c3..32542b3 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -16,29 +16,27 @@ public partial class Main : Form private static readonly char[] illegalCharsForExplorer = "/<>:/\\\"|?*".ToCharArray(); + private static readonly DirectoryInfo iconsDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.Parent.GetDirectories().Where(directory => directory.Name == "Icons").FirstOrDefault(); + private static readonly string iconsDataType = ".png"; + Chain chain = new Chain() { Elements = new List() }; - List moveTypes = new List() - { - "circle", - "spiral", - "J-Turn" - }; - List moveDescriptions = new List() { "The camera will move in a circle around the player.", "The camera will move from the starting distance to the end distance while spinning around its axis, creating a spiralling shot.", - "The camera will move from the given direction towards the player. Then at a surtain point, it will do a 180 degree turn, making the move into something that resembles a J.\nCurrently not implemented!" + "The camera will move from the given direction towards the player. Then at a surtain point, it will do a 180 degree turn, making the move into something that resembles a J.\nCurrently not implemented!", + "Groups multiple moves together.\nCurrently not implemented!" }; public Main() { InitializeComponent(); InitializeComboBoxes(); + InitializeChainWindow(); UpdateDescription(); OnMoveTypeChanged(); UpdateChainWindow(); @@ -46,10 +44,22 @@ public Main() private void InitializeComboBoxes() { - cbType.DataSource = moveTypes; + cbType.DataSource = Enum.GetNames(typeof(ChainElementsEnum)); cbType.SelectedIndex = 0; } + private void InitializeChainWindow() + { + ImageList chainElementIcons = new ImageList(); + chainElementIcons.ImageSize = new System.Drawing.Size(32, 32); + FileInfo[] archives = iconsDirectory.GetFiles($"*{iconsDataType}"); + foreach(FileInfo iconInfo in archives) + { + chainElementIcons.Images.Add(System.Drawing.Image.FromFile(iconInfo.FullName)); + } + tvChain.ImageList = chainElementIcons; + } + private void UpdateDescription() { lblMoveDescription.Text = moveDescriptions[cbType.SelectedIndex]; @@ -72,6 +82,10 @@ private void OnMoveTypeChanged() private void ResetContent() { txtMoveName.Text = string.Empty; + if(tlContent.Controls.Count == 0) + { + return; + } switch (tlContent.Controls[0]) { case CircleControl _: @@ -80,81 +94,84 @@ private void ResetContent() case SpiralControl _: spiralControl = new SpiralControl(); break; + default: + break; } } private void UpdateChainWindow() { + tvChain.BeginUpdate(); tvChain.Nodes.Clear(); foreach (ChainElement el in chain.Elements) { - tvChain.BeginUpdate(); - tvChain.Nodes.Add(el.Name); - tvChain.EndUpdate(); + tvChain.Nodes.Add(string.Empty, el.Name, el.IconIndex, el.IconIndex); } + if (tvChain.Nodes.Count > 0) + { + tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1]; + } + if (tvChain.SelectedNode == null) + { + DisableElementOptionsAll(); + } + tvChain.EndUpdate(); } - private bool GenerateMovementScriptFile(MovementScript script, string filePath) + private void UpdateChainWindow(int indexOfNodeToBeSelected) { - if (File.Exists(filePath)) + //TODO Dont scroll to top on update + tvChain.BeginUpdate(); + tvChain.Nodes.Clear(); + foreach (ChainElement el in chain.Elements) { - if(MessageBox.Show("A file with the given name already exists.\nWould you like to overwrite that file?", "Overwrite existing File", MessageBoxButtons.YesNo) == DialogResult.No) - { - return false; - } + tvChain.Nodes.Add(string.Empty, el.Name, el.IconIndex, el.IconIndex); } - - try + if(indexOfNodeToBeSelected < tvChain.Nodes.Count) { - using (StreamWriter file = File.CreateText(filePath)) + tvChain.SelectedNode = tvChain.Nodes[indexOfNodeToBeSelected]; + } + else + { + if(tvChain.Nodes.Count > 0) { - JsonSerializer serializer = new JsonSerializer(); - serializer.Formatting = Formatting.Indented; - - serializer.Serialize(file, script); + tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1]; } - return true; } - catch + if(tvChain.SelectedNode == null) { - MessageBox.Show($"Something went wrong while generating the file.\nPlease make sure that the file name and file path are viable and don't contain any not allowed characters."); - return false; + DisableElementOptionsAll(); } - + tvChain.EndUpdate(); } - private bool AddToMovementScriptFile(MovementScript script, string filePath) + private bool GenerateMovementScriptFile(MovementScript script, string filePath) { - JsonSerializer serializer = new JsonSerializer(); - - if (!File.Exists(filePath)) + if (File.Exists(filePath)) { - MessageBox.Show("File doesn't exist!"); - return false; + if(MessageBox.Show("A file with the given name already exists.\nWould you like to overwrite that file?", "Overwrite existing File", MessageBoxButtons.YesNo) == DialogResult.No) + { + return false; + } } - string previousFileContent = File.ReadAllText(filePath); - try { - MovementScript previousMovementScript = JsonConvert.DeserializeObject(previousFileContent); - - script.Frames.InsertRange(0, previousMovementScript.Frames); - using (StreamWriter file = File.CreateText(filePath)) { + JsonSerializer serializer = new JsonSerializer(); serializer.Formatting = Formatting.Indented; serializer.Serialize(file, script); } - return true; } catch { - MessageBox.Show("Move could not be added.\nMake sure that the file is a correct MovementScript file."); + MessageBox.Show($"Something went wrong while generating the file.\nPlease make sure that the file name and file path are viable and don't contain any not allowed characters."); return false; - }; + } + } private void cbType_SelectedIndexChanged(object sender, EventArgs e) @@ -173,11 +190,11 @@ private void btnAddMoveToChain_Click(object sender, EventArgs e) switch (cbType.SelectedIndex) { - case 0: + case (int)ChainElementsEnum.Circle: Circle circle = circleControl.CreateMove(moveName); chain.Elements.Add(circle); break; - case 1: + case (int)ChainElementsEnum.Spiral: Spiral spiral = spiralControl.CreateMove(moveName); chain.Elements.Add(spiral); break; @@ -186,14 +203,14 @@ private void btnAddMoveToChain_Click(object sender, EventArgs e) return; } - tvChain.Nodes.Add(chain.Elements.Last().Name); + UpdateChainWindow(); } private void btnGenerateScript_Click(object sender, EventArgs e) { - string filePath = $@"{txtPath.Text}{txtFileName.Text}.Json"; + string filePath = $@"{txtPath.Text}\{txtFileName.Text}.Json"; - if (txtFileName.Text.Replace(" ", String.Empty) == "") + if (txtFileName.Text.Replace(" ", string.Empty) == "") { MessageBox.Show("Filename is missing!"); txtFileName.Focus(); @@ -259,6 +276,40 @@ private void btnGenerateScript_Click(object sender, EventArgs e) } } + private bool AddToMovementScriptFile(MovementScript script, string filePath) + { + JsonSerializer serializer = new JsonSerializer(); + + if (!File.Exists(filePath)) + { + MessageBox.Show("File doesn't exist!"); + return false; + } + + string previousFileContent = File.ReadAllText(filePath); + + try + { + MovementScript previousMovementScript = JsonConvert.DeserializeObject(previousFileContent); + + script.Frames.InsertRange(0, previousMovementScript.Frames); + + using (StreamWriter file = File.CreateText(filePath)) + { + serializer.Formatting = Formatting.Indented; + + serializer.Serialize(file, script); + } + + return true; + } + catch + { + MessageBox.Show("Move could not be added.\nMake sure that the file is a correct MovementScript file."); + return false; + }; + } + private void btnResetMoveControl_Click(object sender, EventArgs e) { ResetContent(); @@ -284,12 +335,11 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) switch (cbType.SelectedIndex) { - case 0: + case (int)ChainElementsEnum.Circle: if(selectedElement is Circle) { Circle circle = circleControl.CreateMove(newMoveName); chain.Elements[selectedNode.Index] = circle; - selectedElement = circle; } else { @@ -297,11 +347,11 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) return; } break; - case 1: + case (int)ChainElementsEnum.Spiral: if(selectedElement is Spiral) { Spiral spiral = spiralControl.CreateMove(newMoveName); - selectedElement = spiral; + chain.Elements[selectedNode.Index] = spiral; } else { @@ -315,7 +365,7 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) return; } - UpdateChainWindow(); + UpdateChainWindow(selectedNode.Index); } catch { @@ -325,7 +375,7 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) private bool MoveNameValid(string moveName) { - if (moveName.Replace(" ", String.Empty) == "") + if (moveName.Replace(" ", string.Empty) == "") { return false; } @@ -341,14 +391,16 @@ private void btnElementEditSettings_Click(object sender, EventArgs e) return; } ChainElement selectedElementInChain = chain.Elements[tvChain.SelectedNode.Index]; - bool populatingOfFieldsSuccessful = true; + bool populatingOfFieldsSuccessful; switch (selectedElementInChain) { case Circle circleElement: populatingOfFieldsSuccessful = circleControl.Populate(circleElement); + cbType.SelectedIndex = (int)ChainElementsEnum.Circle; break; case Spiral spiralElement: populatingOfFieldsSuccessful = spiralControl.Populate(spiralElement); + cbType.SelectedIndex = (int)ChainElementsEnum.Spiral; break; default: MessageBox.Show("Can't get the settings of the selected element."); @@ -381,7 +433,7 @@ private void EnableElementOptionsMoveType() { btnElementMoveUp.Enabled = true; btnElementMoveDown.Enabled = true; - btnElementEditSettings.Enabled = true; + btnElementGetSettings.Enabled = true; btnElementApplySettings.Enabled = true; btnElementDuplicate.Enabled = true; btnElementDelete.Enabled = true; @@ -391,7 +443,7 @@ private void DisableElementOptionsAll() { btnElementMoveUp.Enabled = false; btnElementMoveDown.Enabled = false; - btnElementEditSettings.Enabled = false; + btnElementGetSettings.Enabled = false; btnElementApplySettings.Enabled = false; btnElementDuplicate.Enabled = false; btnElementDelete.Enabled = false; @@ -399,37 +451,103 @@ private void DisableElementOptionsAll() private void btnElementMoveUp_Click(object sender, EventArgs e) { - if(tvChain.SelectedNode.Index != 0) + TreeNode selectedNode = tvChain.SelectedNode; + if (selectedNode == null) { - TreeNode selectedTreeElement = tvChain.SelectedNode; - ChainElement selectedChainElement = chain.Elements[selectedTreeElement.Index]; + MessageBox.Show("No element selected.\nPlease select an element from the chain."); + return; + } + if (selectedNode.Index != 0) + { + ChainElement selectedChainElement = chain.Elements[selectedNode.Index]; chain.Elements.Remove(selectedChainElement); - chain.Elements.Insert(selectedTreeElement.Index - 1, selectedChainElement); + chain.Elements.Insert(selectedNode.Index - 1, selectedChainElement); - tvChain.BeginUpdate(); - tvChain.Nodes.Remove(selectedTreeElement); - tvChain.Nodes.Insert(selectedTreeElement.Index - 1, selectedTreeElement); - tvChain.SelectedNode = selectedTreeElement; - tvChain.EndUpdate(); + UpdateChainWindow(selectedNode.Index - 1); } } private void btnElementMoveDown_Click(object sender, EventArgs e) { - if (tvChain.SelectedNode.Index != tvChain.Nodes.Count -1) + TreeNode selectedNode = tvChain.SelectedNode; + if (selectedNode == null) { - TreeNode selectedTreeElement = tvChain.SelectedNode; - ChainElement selectedChainElement = chain.Elements[selectedTreeElement.Index]; + MessageBox.Show("No element selected.\nPlease select an element from the chain."); + return; + } + if (selectedNode.Index != tvChain.Nodes.Count -1) + { + ChainElement selectedChainElement = chain.Elements[selectedNode.Index]; chain.Elements.Remove(selectedChainElement); - chain.Elements.Insert(selectedTreeElement.Index + 1, selectedChainElement); + chain.Elements.Insert(selectedNode.Index + 1, selectedChainElement); - tvChain.BeginUpdate(); - tvChain.Nodes.Remove(selectedTreeElement); - tvChain.Nodes.Insert(selectedTreeElement.Index + 1, selectedTreeElement); - tvChain.SelectedNode = selectedTreeElement; - tvChain.EndUpdate(); + UpdateChainWindow(selectedNode.Index + 1); + } + } + + private void btnElementDuplicate_Click(object sender, EventArgs e) + { + TreeNode selectedNode = tvChain.SelectedNode; + if (selectedNode == null) + { + MessageBox.Show("No element selected.\nPlease select an element from the chain."); + return; + } + ChainElement selectedChainElement = chain.Elements[selectedNode.Index]; + switch (selectedChainElement) + { + case Circle circleElement: + selectedChainElement = circleElement.Clone(); + break; + case Spiral spiralElement: + selectedChainElement = spiralElement.Clone(); + break; + default: + MessageBox.Show("Can't duplicate the selected element."); + return; + } + + if (selectedNode.Index == tvChain.Nodes.Count - 1) + { + chain.Elements.Add(selectedChainElement); + } + else + { + chain.Elements.Insert(selectedNode.Index + 1, selectedChainElement); + } + + UpdateChainWindow(selectedNode.Index); + } + + private void btnElementDelete_Click(object sender, EventArgs e) + { + TreeNode selectedNode = tvChain.SelectedNode; + if (selectedNode == null) + { + MessageBox.Show("No element selected.\nPlease select an element from the chain."); + return; + } + chain.Elements.RemoveAt(selectedNode.Index); + + if(selectedNode.Index == 0) + { + UpdateChainWindow(); + } + else + { + UpdateChainWindow(selectedNode.Index -1); + } + } + + private void btnEditPath_Click(object sender, EventArgs e) + { + FolderBrowserDialog dialog = new FolderBrowserDialog(); + DialogResult result = dialog.ShowDialog(); + if(result == DialogResult.OK) + { + txtPath.Text = dialog.SelectedPath; } } } diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index 44d9a53..a3e82e4 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -120,6 +120,13 @@ 17, 17 + + The path of the directory in which the Movement Script File will be saved. +Make sure to save the Files to the correct directory, else the camera2 mod will not be able +to get them. +The path should be something like this: +D:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts + 17, 17 diff --git a/MovementScriptGenerator/Icons/0_Circle_Icon.png b/MovementScriptGenerator/Icons/0_Circle_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f7ab849b6140003404a4efbc30312bb6c6d2e16d GIT binary patch literal 1807 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|GzJE?Yo0ESAr*{oZy)rNHRNFp zi2C?{{~f)XHa{0K9xu09uI*A$STrZjm8+)ahkFA9BNGdUfP%v)gRDT<$MUbH_T_5D z#(L+{;8Rx3&2xWPM?_~bv9z(W94KI(qHdt6z@YZ^s+xh00z;eh0-HupMn;2`>&+Sy zf%F}Qr<^`q91WheTRC~SE1GNXH!RlG$wZ(C}U*Yu=nsc_XPq1 z46J>MOt*n1f8)C?-{|DPAY#$Rks~g^aN9bko`s8%G2nrO(uUXvocT*$zW?F>!tv{W zk9w`S&kW5Q(h@EUdx!}zoV>fyjOi>B(*nsGUsxuwvN#l#ujzHz+`y2*W@g)%!pJz` zj%>E_1)ytZHTwE1L?#@TF8OZ#iEZ%{;~RU;o-Yey_P6~GiV6%|GR`d9xbHmdy>0#OTd>9M{qFPi z%^PkWUT)PG2n>Z&>n$21f%NP3MDQEWUwoC`b^l?x>^YAWpS&L2{rTdbZDV-0)i+!7 zhU6<;f+vIp7%FWyDlr{rVL4!!)ynaNlcQnJya>U@WG1Eu5?h^EKC!Sk#QCr3IAF-g zSkM!t$W+Pn{+@&Xnjg#Gui>n=c(}xE*@3m^*GoG*TewM!$sK5nV45pO3NW6|?28a> zR0bNuu~~`52pD*2@oTyc2m+01i4pCPI^0hn5hekX;p^l{vI znEx{W@Aqr&yH~9p z@bx<^hk)*?Xx8a>Sl+o{^MnBUhOznf6-^ZPs3*5+sWoR5os=MkBA z92j!mZ}=;y0Zb#1%$L99vuxe3_mURP&FL3-69nQjnJxo^WEb-*VF?idhUOn$!ZU#R z>auLW`~wRb7$lB_&pNQBfnmnGhF>gfz^tmU@6u=iOKC0BsM7eq@ucXjt`qC-0xLQO MPgg&ebxsLQ0IL}f@Bjb+ literal 0 HcmV?d00001 diff --git a/MovementScriptGenerator/Icons/1_Spiral_Icon.png b/MovementScriptGenerator/Icons/1_Spiral_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b44c9da87cf52da251456382a0c8f2256996158c GIT binary patch literal 1956 zcmeHIYfw{H5I*;EfSY818^G``SJA>~9krtd5zG|>0j337jYf?_PzH*XAyj!th};Mi z+5v)Xr5zGOI#NfmRYZCD;Gv^4YULqF1eJ&&Ac8jizr7D zELCsCt1KZsx=>z7`%ob8qbzukLonU*Vh>d$4YK{MSRK3&W$3b23&+H4ooV6}?(Nf9r-@_OXdvU0+L&d3GAyoNK9%TX(I# zZAu4%1MjdLc_hfuoL`T7Vc1&xPs8;U4Dfj>{f+C)BHojp)J5|y?2YHEItOR?-|7TM z@u99%u|t{@2{z)YJBW&;$&;vmk1e1ps{77^U49rQvm?Jkz+L%Kui$lS`9eU^ynE*I zLw1GPyg~&o$$Q-iE0ObvN97irgL)n)t@*fU9}Qy0il(>{L?iFT)eWi<9H$hyzpEPq zF|2|#{K1NGl3OVL5>J7YL*$oCr z5)WD7@hD1nr^Hz`g}A?Q$%QCeLW20c2clsoCu5Hw$p6-K?%=rAY`EXvHrUZS`(il7 z#YVYt=1pbDkNuA0u;}udok21u1fFv_l;}rl*)+Fb3{$uyxVBc4O^2g|?{o1r2QXip z6hvjB3~E7r&fs&yT&_VqV2sYVvLI)jKD;o#KWo&|AG>12fgj?s`PnXo0&#GR1BMXw zeyLHTqX_@pYM{T&fT5?#sv6X?(Hg)s&*&aSO|YK;CsI0C|rhNdNc7w>vEna6h_v%?U9i3u3A{)4 xlA8x1U3MU!PD0~zz3JYEAO3%Dw?j*2?A#J|eAXuPxQn(g2n`AsUI>&O{|7&KXTJad literal 0 HcmV?d00001 diff --git a/MovementScriptGenerator/Icons/2_JTurn_Icon.png b/MovementScriptGenerator/Icons/2_JTurn_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..19bb52bc0c94c7bcc787f8e6346212a79427bc97 GIT binary patch literal 1718 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|GzJE?T2B|pkP61PceDGh8t||M zIJ~JpeSpj3>XlEg&)mPaA*0jB}UyK!hwNDZrwGGIV>y(JWrHjQSjjV zgL_-t9&k5aw)`jl-Q)IQX$Psj(!wXi1sHxB2QW68FfvYXdw-1O6Dy0uKb{Z=1z!h- zB^P%aHr4tiZUjQmLk(+mk^9~nBL$u>-P7|Oh zz3t0On6@)9JqWu{#ncOQ^5ch^a}TU-VAvtLWu8NFBVYQQbB)sW3IDy!_aFNFnT=%k zC@^sGyJxa2V%4hQSNJt&hg1K>;+{M9Rd&m7oqexTQg~PT0PDP^EW3ancqbfU-^k6# zSkRcR+4zo$X~A!ntNst192jCAM0zdQ-N5j|&he}84gmoM@rr3eFZ2u^{%0-l`}2SK z1d_Y#$WNkKnv@S|9l%5#oyE&{;vkouRdni0nNGbkL5-E z)&_9emr)cLoP+2crgHq%WeCWUIIcm4{24h$-fcAGZl03*+q z@w@s24Fv|Fk9TJ|Y-?aRF|Xmbu!o2ML+6h?Uxnxc-x(gMKajD%cSAOgtAe?LGhMQg zlZh$ekjPhu2TL0mh!zn2x2*1q<D_T@QD@f;it`XX-~7p!bx$gr|V75)JX@tTDh{7k;U z*Z|G&Us}_5z=4s`pkPIm(uWWS z2Aip$ESZ>rfqh_MR_B3Wpmiaqo^$X3gNeC)l`5?=_-OfwREZ>PKM?QVEO?kXyyq^k PK4S26^>bP0l+XkKLMY$} literal 0 HcmV?d00001 diff --git a/MovementScriptGenerator/Modules/ChainElement.cs b/MovementScriptGenerator/Modules/ChainElement.cs index 61a1d96..fac16e4 100644 --- a/MovementScriptGenerator/Modules/ChainElement.cs +++ b/MovementScriptGenerator/Modules/ChainElement.cs @@ -1,12 +1,24 @@  +using System; + namespace MovementScriptGenerator.Modules { - public class ChainElement + public abstract class ChainElement { public ChainElement(string name) { Name = name; + IconIndex = (int)Enum.Parse(typeof(ChainElementsEnum), GetType().Name); } public string Name { get; set; } + + public int IconIndex { get; } + + public T Clone() + { + var inst = GetType().GetMethod("MemberwiseClone", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); + + return (T)inst?.Invoke(this, null); + } } } diff --git a/MovementScriptGenerator/Modules/Move.cs b/MovementScriptGenerator/Modules/Move.cs index 413ef99..1a8b552 100644 --- a/MovementScriptGenerator/Modules/Move.cs +++ b/MovementScriptGenerator/Modules/Move.cs @@ -17,6 +17,5 @@ public Move(string name, int fov, float duration, float height) : base(name) public float Height { get; set; } public abstract List GenerateFrames(); - } } diff --git a/MovementScriptGenerator/Modules/Moves/Spiral.cs b/MovementScriptGenerator/Modules/Moves/Spiral.cs index ef0930a..1bfd2f8 100644 --- a/MovementScriptGenerator/Modules/Moves/Spiral.cs +++ b/MovementScriptGenerator/Modules/Moves/Spiral.cs @@ -10,7 +10,7 @@ public class Spiral : Move public float EndDistance { get; } public float HorizontalRot { get; } public float VerticalRot { get; } - public float SpiralAmmount { get; } + public int SpiralAmmount { get; } public bool SpiralClockwise { get; } public float StartHold { get; } public float EndHold { get; } diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 38132bc..385c30d 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -53,6 +53,7 @@ + Form From d524237d0e5dec2c0218e6ec6140068676680d1f Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Sun, 18 Dec 2022 01:14:42 +0100 Subject: [PATCH 05/21] - replaced FolderBrowserDialog with more intuitive CommonOpenFileDialog --- MovementScriptGenerator/Form1.cs | 10 ++++++---- MovementScriptGenerator/MovementScriptGenerator.csproj | 9 +++++++++ MovementScriptGenerator/packages.config | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 32542b3..575100f 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using MovementScriptGenerator.Modules; using Newtonsoft.Json; +using Microsoft.WindowsAPICodePack.Dialogs; namespace MovementScriptGenerator { @@ -543,11 +544,12 @@ private void btnElementDelete_Click(object sender, EventArgs e) private void btnEditPath_Click(object sender, EventArgs e) { - FolderBrowserDialog dialog = new FolderBrowserDialog(); - DialogResult result = dialog.ShowDialog(); - if(result == DialogResult.OK) + CommonOpenFileDialog dialog = new CommonOpenFileDialog(); + dialog.IsFolderPicker = true; + dialog.InitialDirectory = "C:\\Users"; + if(dialog.ShowDialog() == CommonFileDialogResult.Ok) { - txtPath.Text = dialog.SelectedPath; + txtPath.Text = dialog.FileName; } } } diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 385c30d..b9bea78 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -37,6 +37,15 @@ + + ..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.2\lib\Microsoft.WindowsAPICodePack.dll + + + ..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll + + + ..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll + ..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll diff --git a/MovementScriptGenerator/packages.config b/MovementScriptGenerator/packages.config index 4de699c..a986436 100644 --- a/MovementScriptGenerator/packages.config +++ b/MovementScriptGenerator/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file From cd84f5be1edddb50ab5edae0b2ae01d4e607f09d Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Sun, 18 Dec 2022 01:23:17 +0100 Subject: [PATCH 06/21] - added functionality for inserting chain elements after selected element --- MovementScriptGenerator/Form1.Designer.cs | 25 ++++++++++++++-- MovementScriptGenerator/Form1.cs | 36 +++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index 9d0329e..f067abd 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -90,6 +90,7 @@ private void InitializeComponent() this.ToolTip = new System.Windows.Forms.ToolTip(this.components); this.tableLayoutPanel21 = new System.Windows.Forms.TableLayoutPanel(); this.btnEditPath = new System.Windows.Forms.Button(); + this.btnInsert = new System.Windows.Forms.Button(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel13.SuspendLayout(); this.tableLayoutPanel14.SuspendLayout(); @@ -605,6 +606,7 @@ private void InitializeComponent() // flowLayoutPanel3 // this.flowLayoutPanel3.Controls.Add(this.btnAddMoveToChain); + this.flowLayoutPanel3.Controls.Add(this.btnInsert); this.flowLayoutPanel3.Controls.Add(this.btnResetMoveSettings); this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 667); @@ -632,9 +634,8 @@ private void InitializeComponent() // // btnResetMoveSettings // - this.btnResetMoveSettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.btnResetMoveSettings.Location = new System.Drawing.Point(88, 3); + this.btnResetMoveSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnResetMoveSettings.Location = new System.Drawing.Point(134, 3); this.btnResetMoveSettings.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); this.btnResetMoveSettings.MinimumSize = new System.Drawing.Size(0, 26); this.btnResetMoveSettings.Name = "btnResetMoveSettings"; @@ -944,6 +945,23 @@ private void InitializeComponent() this.btnEditPath.UseVisualStyleBackColor = true; this.btnEditPath.Click += new System.EventHandler(this.btnEditPath_Click); // + // btnInsert + // + this.btnInsert.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.btnInsert.AutoSize = true; + this.btnInsert.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnInsert.Enabled = false; + this.btnInsert.Location = new System.Drawing.Point(85, 3); + this.btnInsert.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); + this.btnInsert.MinimumSize = new System.Drawing.Size(0, 26); + this.btnInsert.Name = "btnInsert"; + this.btnInsert.Size = new System.Drawing.Size(43, 26); + this.btnInsert.TabIndex = 4; + this.btnInsert.Text = "Insert"; + this.btnInsert.UseVisualStyleBackColor = true; + this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click); + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1059,6 +1077,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnElementDelete; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel21; private System.Windows.Forms.Button btnEditPath; + private System.Windows.Forms.Button btnInsert; } } diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 575100f..c0f8738 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -438,6 +438,7 @@ private void EnableElementOptionsMoveType() btnElementApplySettings.Enabled = true; btnElementDuplicate.Enabled = true; btnElementDelete.Enabled = true; + btnInsert.Enabled = true; } private void DisableElementOptionsAll() @@ -448,6 +449,7 @@ private void DisableElementOptionsAll() btnElementApplySettings.Enabled = false; btnElementDuplicate.Enabled = false; btnElementDelete.Enabled = false; + btnInsert.Enabled = false; } private void btnElementMoveUp_Click(object sender, EventArgs e) @@ -552,5 +554,39 @@ private void btnEditPath_Click(object sender, EventArgs e) txtPath.Text = dialog.FileName; } } + + private void btnInsert_Click(object sender, EventArgs e) + { + TreeNode selectedNode = tvChain.SelectedNode; + int insertIndex = selectedNode.Index + 1; + if (selectedNode == null) + { + MessageBox.Show("No element selected.\nPlease select an element from the chain."); + return; + } + + string moveName = txtMoveName.Text; + if (!MoveNameValid(moveName)) + { + moveName = null; + } + + switch (cbType.SelectedIndex) + { + case (int)ChainElementsEnum.Circle: + Circle circle = circleControl.CreateMove(moveName); + chain.Elements.Insert(insertIndex, circle); + break; + case (int)ChainElementsEnum.Spiral: + Spiral spiral = spiralControl.CreateMove(moveName); + chain.Elements.Insert(insertIndex, spiral); + break; + default: + MessageBox.Show("can't add move to chain."); + return; + } + + UpdateChainWindow(insertIndex); + } } } From 6971595881a9fdf2027f76b365c81114e0178d46 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 23 Dec 2022 17:43:50 +0100 Subject: [PATCH 07/21] - applied not yet merged changes from chaining branch --- MovementScriptGenerator/ChainElementsEnum.cs | 2 +- MovementScriptGenerator/Form1.Designer.cs | 179 +++++++------- MovementScriptGenerator/Form1.cs | 221 +++++++++++++++--- MovementScriptGenerator/Form1.resx | 7 + .../MovementScriptGenerator.csproj | 14 +- .../SpiralControl.Designer.cs | 1 + MovementScriptGenerator/SpiralControl.cs | 2 +- 7 files changed, 302 insertions(+), 124 deletions(-) diff --git a/MovementScriptGenerator/ChainElementsEnum.cs b/MovementScriptGenerator/ChainElementsEnum.cs index 96fc53c..a5d4bbd 100644 --- a/MovementScriptGenerator/ChainElementsEnum.cs +++ b/MovementScriptGenerator/ChainElementsEnum.cs @@ -6,6 +6,6 @@ enum ChainElementsEnum Circle, Spiral, JTurn, - Group + Repeat } } diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index f067abd..def4bf9 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -36,9 +36,6 @@ private void InitializeComponent() this.tableLayoutPanel13 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel14 = new System.Windows.Forms.TableLayoutPanel(); this.label2 = new System.Windows.Forms.Label(); - this.txtPath = new System.Windows.Forms.TextBox(); - this.lblPath = new System.Windows.Forms.Label(); - this.btnGenerateScript = new System.Windows.Forms.Button(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.txtFileName = new System.Windows.Forms.TextBox(); @@ -64,9 +61,15 @@ private void InitializeComponent() this.btnElementGetSettings = new System.Windows.Forms.Button(); this.btnElementApplySettings = new System.Windows.Forms.Button(); this.btnElementDelete = new System.Windows.Forms.Button(); + this.tableLayoutPanel21 = new System.Windows.Forms.TableLayoutPanel(); + this.btnEditPath = new System.Windows.Forms.Button(); + this.txtPath = new System.Windows.Forms.TextBox(); + this.btnGenerateScript = new System.Windows.Forms.Button(); + this.lblPath = new System.Windows.Forms.Label(); this.tableLayoutPanel16 = new System.Windows.Forms.TableLayoutPanel(); this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.btnAddMoveToChain = new System.Windows.Forms.Button(); + this.btnInsert = new System.Windows.Forms.Button(); this.btnResetMoveSettings = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.flpContent = new System.Windows.Forms.FlowLayoutPanel(); @@ -88,9 +91,6 @@ private void InitializeComponent() this.txtMoveName = new System.Windows.Forms.TextBox(); this.lblMoveName = new System.Windows.Forms.Label(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.tableLayoutPanel21 = new System.Windows.Forms.TableLayoutPanel(); - this.btnEditPath = new System.Windows.Forms.Button(); - this.btnInsert = new System.Windows.Forms.Button(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel13.SuspendLayout(); this.tableLayoutPanel14.SuspendLayout(); @@ -103,6 +103,7 @@ private void InitializeComponent() this.tableLayoutPanel19.SuspendLayout(); this.flowLayoutPanel4.SuspendLayout(); this.tableLayoutPanel20.SuspendLayout(); + this.tableLayoutPanel21.SuspendLayout(); this.tableLayoutPanel16.SuspendLayout(); this.flowLayoutPanel3.SuspendLayout(); this.flpContent.SuspendLayout(); @@ -113,7 +114,6 @@ private void InitializeComponent() this.flowLayoutPanel2.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); this.tableLayoutPanel17.SuspendLayout(); - this.tableLayoutPanel21.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -193,38 +193,6 @@ private void InitializeComponent() this.label2.Text = "Move Chain"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // txtPath - // - this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtPath.Location = new System.Drawing.Point(164, 3); - this.txtPath.Name = "txtPath"; - this.txtPath.Size = new System.Drawing.Size(257, 20); - this.txtPath.TabIndex = 1; - this.txtPath.Text = "D:\\SteamLibrary\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScripts"; - // - // lblPath - // - this.lblPath.AutoSize = true; - this.lblPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblPath.Location = new System.Drawing.Point(3, 0); - this.lblPath.Name = "lblPath"; - this.lblPath.Size = new System.Drawing.Size(34, 36); - this.lblPath.TabIndex = 0; - this.lblPath.Text = "Path:"; - this.lblPath.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.ToolTip.SetToolTip(this.lblPath, resources.GetString("lblPath.ToolTip")); - // - // btnGenerateScript - // - this.btnGenerateScript.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnGenerateScript.Location = new System.Drawing.Point(427, 3); - this.btnGenerateScript.Name = "btnGenerateScript"; - this.btnGenerateScript.Size = new System.Drawing.Size(115, 30); - this.btnGenerateScript.TabIndex = 1; - this.btnGenerateScript.Text = "Generate Script"; - this.btnGenerateScript.UseVisualStyleBackColor = true; - this.btnGenerateScript.Click += new System.EventHandler(this.btnGenerateScript_Click); - // // flowLayoutPanel1 // this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel2); @@ -583,6 +551,70 @@ private void InitializeComponent() this.btnElementDelete.UseVisualStyleBackColor = true; this.btnElementDelete.Click += new System.EventHandler(this.btnElementDelete_Click); // + // tableLayoutPanel21 + // + this.tableLayoutPanel21.ColumnCount = 4; + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); + this.tableLayoutPanel21.Controls.Add(this.btnEditPath, 1, 0); + this.tableLayoutPanel21.Controls.Add(this.txtPath, 2, 0); + this.tableLayoutPanel21.Controls.Add(this.btnGenerateScript, 3, 0); + this.tableLayoutPanel21.Controls.Add(this.lblPath, 0, 0); + this.tableLayoutPanel21.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel21.Location = new System.Drawing.Point(0, 667); + this.tableLayoutPanel21.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel21.Name = "tableLayoutPanel21"; + this.tableLayoutPanel21.RowCount = 1; + this.tableLayoutPanel21.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel21.Size = new System.Drawing.Size(545, 36); + this.tableLayoutPanel21.TabIndex = 8; + // + // btnEditPath + // + this.btnEditPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnEditPath.Location = new System.Drawing.Point(43, 3); + this.btnEditPath.Name = "btnEditPath"; + this.btnEditPath.Size = new System.Drawing.Size(115, 30); + this.btnEditPath.TabIndex = 2; + this.btnEditPath.Text = "Edit Path"; + this.btnEditPath.UseVisualStyleBackColor = true; + this.btnEditPath.Click += new System.EventHandler(this.btnEditPath_Click); + // + // txtPath + // + this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtPath.Location = new System.Drawing.Point(164, 3); + this.txtPath.Name = "txtPath"; + this.txtPath.Size = new System.Drawing.Size(257, 20); + this.txtPath.TabIndex = 1; + this.txtPath.Text = "C:\\Program Files\\Steam\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScrip" + + "ts"; + // + // btnGenerateScript + // + this.btnGenerateScript.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnGenerateScript.Location = new System.Drawing.Point(427, 3); + this.btnGenerateScript.Name = "btnGenerateScript"; + this.btnGenerateScript.Size = new System.Drawing.Size(115, 30); + this.btnGenerateScript.TabIndex = 1; + this.btnGenerateScript.Text = "Generate Script"; + this.btnGenerateScript.UseVisualStyleBackColor = true; + this.btnGenerateScript.Click += new System.EventHandler(this.btnGenerateScript_Click); + // + // lblPath + // + this.lblPath.AutoSize = true; + this.lblPath.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblPath.Location = new System.Drawing.Point(3, 0); + this.lblPath.Name = "lblPath"; + this.lblPath.Size = new System.Drawing.Size(34, 36); + this.lblPath.TabIndex = 0; + this.lblPath.Text = "Path:"; + this.lblPath.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.ToolTip.SetToolTip(this.lblPath, resources.GetString("lblPath.ToolTip")); + // // tableLayoutPanel16 // this.tableLayoutPanel16.ColumnCount = 1; @@ -632,6 +664,23 @@ private void InitializeComponent() this.btnAddMoveToChain.UseVisualStyleBackColor = true; this.btnAddMoveToChain.Click += new System.EventHandler(this.btnAddMoveToChain_Click); // + // btnInsert + // + this.btnInsert.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.btnInsert.AutoSize = true; + this.btnInsert.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnInsert.Enabled = false; + this.btnInsert.Location = new System.Drawing.Point(85, 3); + this.btnInsert.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); + this.btnInsert.MinimumSize = new System.Drawing.Size(0, 26); + this.btnInsert.Name = "btnInsert"; + this.btnInsert.Size = new System.Drawing.Size(43, 26); + this.btnInsert.TabIndex = 4; + this.btnInsert.Text = "Insert"; + this.btnInsert.UseVisualStyleBackColor = true; + this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click); + // // btnResetMoveSettings // this.btnResetMoveSettings.Dock = System.Windows.Forms.DockStyle.Fill; @@ -914,54 +963,6 @@ private void InitializeComponent() this.ToolTip.IsBalloon = true; this.ToolTip.ReshowDelay = 100; // - // tableLayoutPanel21 - // - this.tableLayoutPanel21.ColumnCount = 4; - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); - this.tableLayoutPanel21.Controls.Add(this.btnEditPath, 1, 0); - this.tableLayoutPanel21.Controls.Add(this.txtPath, 2, 0); - this.tableLayoutPanel21.Controls.Add(this.btnGenerateScript, 3, 0); - this.tableLayoutPanel21.Controls.Add(this.lblPath, 0, 0); - this.tableLayoutPanel21.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel21.Location = new System.Drawing.Point(0, 667); - this.tableLayoutPanel21.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel21.Name = "tableLayoutPanel21"; - this.tableLayoutPanel21.RowCount = 1; - this.tableLayoutPanel21.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel21.Size = new System.Drawing.Size(545, 36); - this.tableLayoutPanel21.TabIndex = 8; - // - // btnEditPath - // - this.btnEditPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnEditPath.Location = new System.Drawing.Point(43, 3); - this.btnEditPath.Name = "btnEditPath"; - this.btnEditPath.Size = new System.Drawing.Size(115, 30); - this.btnEditPath.TabIndex = 2; - this.btnEditPath.Text = "Edit Path"; - this.btnEditPath.UseVisualStyleBackColor = true; - this.btnEditPath.Click += new System.EventHandler(this.btnEditPath_Click); - // - // btnInsert - // - this.btnInsert.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.btnInsert.AutoSize = true; - this.btnInsert.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnInsert.Enabled = false; - this.btnInsert.Location = new System.Drawing.Point(85, 3); - this.btnInsert.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); - this.btnInsert.MinimumSize = new System.Drawing.Size(0, 26); - this.btnInsert.Name = "btnInsert"; - this.btnInsert.Size = new System.Drawing.Size(43, 26); - this.btnInsert.TabIndex = 4; - this.btnInsert.Text = "Insert"; - this.btnInsert.UseVisualStyleBackColor = true; - this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click); - // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -992,6 +993,8 @@ private void InitializeComponent() this.tableLayoutPanel19.PerformLayout(); this.flowLayoutPanel4.ResumeLayout(false); this.tableLayoutPanel20.ResumeLayout(false); + this.tableLayoutPanel21.ResumeLayout(false); + this.tableLayoutPanel21.PerformLayout(); this.tableLayoutPanel16.ResumeLayout(false); this.tableLayoutPanel16.PerformLayout(); this.flowLayoutPanel3.ResumeLayout(false); @@ -1010,8 +1013,6 @@ private void InitializeComponent() this.tableLayoutPanel4.PerformLayout(); this.tableLayoutPanel17.ResumeLayout(false); this.tableLayoutPanel17.PerformLayout(); - this.tableLayoutPanel21.ResumeLayout(false); - this.tableLayoutPanel21.PerformLayout(); this.ResumeLayout(false); } diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index c0f8738..9193910 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -4,9 +4,11 @@ using System.Linq; using System.Windows.Forms; using MovementScriptGenerator.Modules; +using MovementScriptGenerator.Modules.OtherChainElements; using Newtonsoft.Json; using Microsoft.WindowsAPICodePack.Dialogs; + namespace MovementScriptGenerator { public partial class Main : Form @@ -15,11 +17,16 @@ public partial class Main : Form CircleControl circleControl = new CircleControl(); SpiralControl spiralControl = new SpiralControl(); + //Other Chain Elements Controls + RepeatControl repeatControl = new RepeatControl(); + private static readonly char[] illegalCharsForExplorer = "/<>:/\\\"|?*".ToCharArray(); private static readonly DirectoryInfo iconsDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.Parent.GetDirectories().Where(directory => directory.Name == "Icons").FirstOrDefault(); private static readonly string iconsDataType = ".png"; + private static readonly int maxStackDepth = 64; + Chain chain = new Chain() { Elements = new List() @@ -30,7 +37,7 @@ public partial class Main : Form "The camera will move in a circle around the player.", "The camera will move from the starting distance to the end distance while spinning around its axis, creating a spiralling shot.", "The camera will move from the given direction towards the player. Then at a surtain point, it will do a 180 degree turn, making the move into something that resembles a J.\nCurrently not implemented!", - "Groups multiple moves together.\nCurrently not implemented!" + "Repeats the Moves that are in the given range. The moves at the start position and end position are included." }; public Main() @@ -77,6 +84,9 @@ private void OnMoveTypeChanged() case 1: tlContent.Controls.Add(spiralControl); break; + case 3: + tlContent.Controls.Add(repeatControl); + break; } } @@ -95,6 +105,9 @@ private void ResetContent() case SpiralControl _: spiralControl = new SpiralControl(); break; + case RepeatControl _: + repeatControl = new RepeatControl(); + break; default: break; } @@ -104,10 +117,15 @@ private void UpdateChainWindow() { tvChain.BeginUpdate(); tvChain.Nodes.Clear(); - foreach (ChainElement el in chain.Elements) + for (int i = 0; i < chain.Elements.Count; i++) { - tvChain.Nodes.Add(string.Empty, el.Name, el.IconIndex, el.IconIndex); + ChainElement currentElement = chain.Elements[i]; + tvChain.Nodes.Add(string.Empty, $"{i + 1}. {currentElement.Name}", currentElement.IconIndex, currentElement.IconIndex); } + /*foreach (ChainElement el in chain.Elements) + { + tvChain.Nodes.Add(string.Empty, $"{el.}{el.Name}", el.IconIndex, el.IconIndex); + }*/ if (tvChain.Nodes.Count > 0) { tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1]; @@ -124,10 +142,15 @@ private void UpdateChainWindow(int indexOfNodeToBeSelected) //TODO Dont scroll to top on update tvChain.BeginUpdate(); tvChain.Nodes.Clear(); - foreach (ChainElement el in chain.Elements) + for(int i = 0; i < chain.Elements.Count; i++) { - tvChain.Nodes.Add(string.Empty, el.Name, el.IconIndex, el.IconIndex); + ChainElement currentElement = chain.Elements[i]; + tvChain.Nodes.Add(string.Empty, $"{i + 1}. {currentElement.Name}", currentElement.IconIndex, currentElement.IconIndex); } + /*foreach (ChainElement el in chain.Elements) + { + tvChain.Nodes.Add(string.Empty, $"{el.}{el.Name}", el.IconIndex, el.IconIndex); + }*/ if(indexOfNodeToBeSelected < tvChain.Nodes.Count) { tvChain.SelectedNode = tvChain.Nodes[indexOfNodeToBeSelected]; @@ -199,6 +222,17 @@ private void btnAddMoveToChain_Click(object sender, EventArgs e) Spiral spiral = spiralControl.CreateMove(moveName); chain.Elements.Add(spiral); break; + case (int)ChainElementsEnum.Repeat: + if (repeatControl.ValidateInputs()) + { + Repeat repeat = repeatControl.CreateElement(moveName); + chain.Elements.Add(repeat); + } + else + { + MessageBox.Show("Start element can't be further in the chain than end element."); + } + break; default: MessageBox.Show("can't add move to chain."); return; @@ -242,24 +276,19 @@ private void btnGenerateScript_Click(object sender, EventArgs e) return; } - List scriptFrames = new List(); - - foreach (ChainElement chainEl in chain.Elements) - { - if (chainEl is Move moveEl) - { - List moveFrames = moveEl.GenerateFrames(); - scriptFrames.AddRange(moveFrames); - } - } - MovementScript movementScript = new MovementScript() { - Frames = scriptFrames, + Frames = AddFramesToScript(chain), SyncToSong = checkSyncToSong.Checked, Loop = checkLoop.Checked }; + if(movementScript.Frames == null) + { + MessageBox.Show("Can't create movement script. Make sure that repeat elements don't create an endless loop."); + return; + } + if (checkAddToScript.Checked) { @@ -277,6 +306,95 @@ private void btnGenerateScript_Click(object sender, EventArgs e) } } + /// + /// Tries to create frames from the given chain elements. + /// + /// + /// A List of Frames. If the script fails, it will return null + public List AddFramesToScript(Chain chainOfElements) + { + List frames = new List(); + foreach(ChainElement chainEl in chainOfElements.Elements) + { + switch (chainEl) + { + case Move moveEl: + List moveFrames = moveEl.GenerateFrames(); + frames.AddRange(moveFrames); + break; + case Repeat repeatEl: + Chain repeatedPart = new Chain() {Elements = new List()}; + int ammountOfElementsToRepeat = repeatEl.EndElement + 1 - repeatEl.StartElement; + List toRepeat = chain.Elements.GetRange(repeatEl.StartElement - 1, ammountOfElementsToRepeat); + repeatedPart.Elements.AddRange(toRepeat); + List framesOfRepeatedPart = AddFramesToScript(repeatedPart, 1); + if (framesOfRepeatedPart != null) + { + frames.AddRange(framesOfRepeatedPart); + } + else + { + return null; + } + break; + default: + break; + } + } + + return frames; + } + + /// + /// Only meant to be used in recursive part of the original function. + /// The is used to check how far down in the recursion the program is, + /// so that endless loops can be handled without throwing a stack overflow. + /// + /// + /// + /// A List of Frames. If the script fails, it will return null + public List AddFramesToScript(Chain chainOfElements, int stackDepth) + { + List frames = new List(); + foreach (ChainElement chainEl in chainOfElements.Elements) + { + switch (chainEl) + { + case Move moveEl: + List moveFrames = moveEl.GenerateFrames(); + frames.AddRange(moveFrames); + break; + case Repeat repeatEl: + Chain repeatedPart = new Chain() { Elements = new List() }; + int ammountOfElementsToRepeat = repeatEl.EndElement + 1 - repeatEl.StartElement; + List toRepeat = chain.Elements.GetRange(repeatEl.StartElement - 1, ammountOfElementsToRepeat); + repeatedPart.Elements.AddRange(toRepeat); + + if(stackDepth <= maxStackDepth) + { + List framesOfRepeatedPart = AddFramesToScript(repeatedPart, stackDepth + 1); + if(framesOfRepeatedPart != null) + { + frames.AddRange(framesOfRepeatedPart); + } + else + { + return null; + } + } + else + { + return null; + } + break; + default: + break; + } + } + + return frames; + } + private bool AddToMovementScriptFile(MovementScript script, string filePath) { JsonSerializer serializer = new JsonSerializer(); @@ -360,6 +478,25 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) return; } break; + case (int)ChainElementsEnum.Repeat: + if(selectedElement is Repeat) + { + if (repeatControl.ValidateInputs()) + { + Repeat repeat = repeatControl.CreateElement(newMoveName); + chain.Elements[selectedNode.Index] = repeat; + } + else + { + MessageBox.Show("Start element can't be further in the chain than end element."); + } + } + else + { + MessageBox.Show("Can't apply these settings to the currently selected chain element because the element is not a repeat element."); + return; + } + break; default: MessageBox.Show("Can't apply these settings to the currently selected chain element."); @@ -403,6 +540,10 @@ private void btnElementEditSettings_Click(object sender, EventArgs e) populatingOfFieldsSuccessful = spiralControl.Populate(spiralElement); cbType.SelectedIndex = (int)ChainElementsEnum.Spiral; break; + case Repeat repeatElement: + populatingOfFieldsSuccessful = repeatControl.Populate(repeatElement); + cbType.SelectedIndex = (int)ChainElementsEnum.Repeat; + break; default: MessageBox.Show("Can't get the settings of the selected element."); return; @@ -426,8 +567,10 @@ private void tvChain_AfterSelect(object sender, TreeViewEventArgs e) EnableElementOptionsMoveType(); return; } - - DisableElementOptionsAll(); + else + { + EnableElementOptionsOtherType(); + } } private void EnableElementOptionsMoveType() @@ -441,6 +584,17 @@ private void EnableElementOptionsMoveType() btnInsert.Enabled = true; } + private void EnableElementOptionsOtherType() + { + btnElementMoveUp.Enabled = true; + btnElementMoveDown.Enabled = true; + btnElementGetSettings.Enabled = true; + btnElementApplySettings.Enabled = true; + btnElementDuplicate.Enabled = true; + btnElementDelete.Enabled = true; + btnInsert.Enabled = true; + } + private void DisableElementOptionsAll() { btnElementMoveUp.Enabled = false; @@ -507,6 +661,9 @@ private void btnElementDuplicate_Click(object sender, EventArgs e) case Spiral spiralElement: selectedChainElement = spiralElement.Clone(); break; + case Repeat repeatElement: + selectedChainElement = repeatElement.Clone(); + break; default: MessageBox.Show("Can't duplicate the selected element."); return; @@ -544,17 +701,6 @@ private void btnElementDelete_Click(object sender, EventArgs e) } } - private void btnEditPath_Click(object sender, EventArgs e) - { - CommonOpenFileDialog dialog = new CommonOpenFileDialog(); - dialog.IsFolderPicker = true; - dialog.InitialDirectory = "C:\\Users"; - if(dialog.ShowDialog() == CommonFileDialogResult.Ok) - { - txtPath.Text = dialog.FileName; - } - } - private void btnInsert_Click(object sender, EventArgs e) { TreeNode selectedNode = tvChain.SelectedNode; @@ -581,6 +727,10 @@ private void btnInsert_Click(object sender, EventArgs e) Spiral spiral = spiralControl.CreateMove(moveName); chain.Elements.Insert(insertIndex, spiral); break; + case (int)ChainElementsEnum.Repeat: + Repeat repeat = repeatControl.CreateElement(moveName); + chain.Elements.Insert(insertIndex, repeat); + break; default: MessageBox.Show("can't add move to chain."); return; @@ -588,5 +738,16 @@ private void btnInsert_Click(object sender, EventArgs e) UpdateChainWindow(insertIndex); } + + private void btnEditPath_Click(object sender, EventArgs e) + { + CommonOpenFileDialog dialog = new CommonOpenFileDialog(); + dialog.IsFolderPicker = true; + dialog.InitialDirectory = "C:\\Users"; + if(dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + txtPath.Text = dialog.FileName; + } + } } } diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index a3e82e4..a4470d5 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -143,6 +143,13 @@ Will overwrite the "Sync To Song" and "Loop" options of the existing file! Off -> A new movement script file will be created for the move. If a file with the same name exists, that file will be overwritten! + + + The path of the directory in which the Movement Script File will be saved. +Make sure to save the Files to the correct directory, else the camera2 mod will not be able +to get them. +The path should be something like this: +D:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index b9bea78..985e91a 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -75,6 +75,7 @@ + @@ -86,6 +87,12 @@ CircleControl.cs + + UserControl + + + RepeatControl.cs + UserControl @@ -107,6 +114,9 @@ True Resources.resx + + RepeatControl.cs + SpiralControl.cs @@ -127,8 +137,6 @@ - - - + \ No newline at end of file diff --git a/MovementScriptGenerator/SpiralControl.Designer.cs b/MovementScriptGenerator/SpiralControl.Designer.cs index f8f7b0f..4391fac 100644 --- a/MovementScriptGenerator/SpiralControl.Designer.cs +++ b/MovementScriptGenerator/SpiralControl.Designer.cs @@ -109,6 +109,7 @@ private void InitializeComponent() this.lfSpiralControl.Controls.Add(this.tableLayoutPanel5); this.lfSpiralControl.Controls.Add(this.tableLayoutPanel7); this.lfSpiralControl.Controls.Add(this.tableLayoutPanel12); + this.lfSpiralControl.Dock = System.Windows.Forms.DockStyle.Fill; this.lfSpiralControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.lfSpiralControl.Location = new System.Drawing.Point(0, 0); this.lfSpiralControl.Margin = new System.Windows.Forms.Padding(0); diff --git a/MovementScriptGenerator/SpiralControl.cs b/MovementScriptGenerator/SpiralControl.cs index cd94fbf..d009217 100644 --- a/MovementScriptGenerator/SpiralControl.cs +++ b/MovementScriptGenerator/SpiralControl.cs @@ -36,7 +36,7 @@ public bool Populate(Spiral original) numEndDistance.Value = (decimal)original.EndDistance; numHorizontalRot.Value = (decimal)original.HorizontalRot; numVerticalRot.Value = (decimal)original.VerticalRot; - numSpiralAmmount.Value = (decimal)original.SpiralAmmount; + numSpiralAmmount.Value = original.SpiralAmmount; cbSpiralRotation.SelectedIndex = original.SpiralClockwise ? 0 : 1; numStartHoldTime.Value = (decimal)original.StartHold; numEndHoldTime.Value = (decimal)original.EndHold; From cc4abd3e49d774f1e5e96a8fad1155cca0e28391 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 23 Dec 2022 17:45:29 +0100 Subject: [PATCH 08/21] - applied not yet merged changes from chaining branch --- MovementScriptGenerator/Form1.resx | 10 - .../Icons/3_Repeat_Icon.png | Bin 0 -> 2150 bytes .../Modules/OtherChainElements/Repeat.cs | 17 ++ .../RepeatControl.Designer.cs | 189 ++++++++++++++++++ MovementScriptGenerator/RepeatControl.cs | 56 ++++++ MovementScriptGenerator/RepeatControl.resx | 120 +++++++++++ 6 files changed, 382 insertions(+), 10 deletions(-) create mode 100644 MovementScriptGenerator/Icons/3_Repeat_Icon.png create mode 100644 MovementScriptGenerator/Modules/OtherChainElements/Repeat.cs create mode 100644 MovementScriptGenerator/RepeatControl.Designer.cs create mode 100644 MovementScriptGenerator/RepeatControl.cs create mode 100644 MovementScriptGenerator/RepeatControl.resx diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index a4470d5..f82e972 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -120,16 +120,6 @@ 17, 17 - - The path of the directory in which the Movement Script File will be saved. -Make sure to save the Files to the correct directory, else the camera2 mod will not be able -to get them. -The path should be something like this: -D:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts - - - 17, 17 - On -> the script will pause, while the song is paused and start playing when the song starts. diff --git a/MovementScriptGenerator/Icons/3_Repeat_Icon.png b/MovementScriptGenerator/Icons/3_Repeat_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..44dc901a149afb595bc3c034f8eb04e95fb26b8c GIT binary patch literal 2150 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|GzJC^T~8OskP61PcMkU5H4|Vt zU~%IA|4qdwLKO^G_gH34>+i3L^4oerU_tEvuhZ*UI0O_N8W+8Qg`7e9N*39C-e)joiFLDTEhy^g5J)q~Gu&IG*#+<&*g2V`X==)~-;rji{`^7D) zS-*eauJ>oq|4=jaz;#xU1J{L1>X`IdL=JG<#H)TNWn}&Em1XYy1KdCc)A?}Dnpg+M z8e7Nb>K~jO8223b9Lf|g{(-M_{)3m_|HPl~xc^VidfQ>)1BO-hGY(WTvKH7et1A@v zI55gA{@%EHrjN@tPd=Y}|I_Vx4AX4HI8(Sa z8s60Sx+iEZAd-LQL*K8r)lZ~*CcQ8EsekD!%Z39RT@-*mSfZX|#{~2eaeRe`vfID! zd0C$Mz9#&>{XB-Me7$gWgD3~ap1$J`IlgddG{nUdC-8uKKYPK~>RT7f&&#%V@B44V zc&AW!_M`)g8<;9mJ}Nd^1H(nul70dQTK@AZ{CdAu{%Y+El@Bj}Ul(?`v^GPG$(4~c zfMxSshe-`g9$uGqSh|?F7I36lH>xnQPMESRl0$@5#6j>(8Ivaymx8A6W&sUg7%0tn z%QA^Y#35)_nqq)R0E4T+ZB7+VjfN#AXPp*kEMVwL*e2{D6u{t_Ijhwn(1B6pV2=6( zl?4owE}3vQE^1)XXu9dA;OW4qvNUr<61-M)GoMwUAV-4s3q1B-)T z%lpa#3JVyRoJ^P+=L1u~{8K;W8W|W_1q2oea{LK#VEhwu?mGtyhekt#K(E7tp9%lp6=(kDSUwGxKJa|a}(xm_{pIIO#MXh8>Q>`6Q)0W`@XaM^Zb48 zWzTOv-5qUjd;eX{+Sl_KqAFwO9LNC%n6>YP2CEq73 zKVSdr`TI|Azsc9u`ZFwkTxh|x7nl*QU%$%P11xrl7PvR@+pm9}tLN99|EHc7^OxuQ z2e0(a&o~p9Q)W5p3iDOk70rfjQRluH@!Qe|zQj + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lfSpiralControl = new System.Windows.Forms.FlowLayoutPanel(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.numStartElement = new System.Windows.Forms.NumericUpDown(); + this.lblStartElement = new System.Windows.Forms.Label(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.numEndElement = new System.Windows.Forms.NumericUpDown(); + this.lblEndDistance = new System.Windows.Forms.Label(); + this.lfSpiralControl.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numStartElement)).BeginInit(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numEndElement)).BeginInit(); + this.SuspendLayout(); + // + // lfSpiralControl + // + this.lfSpiralControl.AutoSize = true; + this.lfSpiralControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.lfSpiralControl.Controls.Add(this.tableLayoutPanel1); + this.lfSpiralControl.Controls.Add(this.tableLayoutPanel2); + this.lfSpiralControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.lfSpiralControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.lfSpiralControl.Location = new System.Drawing.Point(0, 0); + this.lfSpiralControl.Margin = new System.Windows.Forms.Padding(0); + this.lfSpiralControl.MaximumSize = new System.Drawing.Size(290, 0); + this.lfSpiralControl.Name = "lfSpiralControl"; + this.lfSpiralControl.Size = new System.Drawing.Size(258, 70); + this.lfSpiralControl.TabIndex = 2; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.AutoSize = true; + this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Controls.Add(this.numStartElement, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.lblStartElement, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel1.MinimumSize = new System.Drawing.Size(0, 32); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 1; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(252, 32); + this.tableLayoutPanel1.TabIndex = 0; + // + // numStartElement + // + this.numStartElement.Location = new System.Drawing.Point(129, 3); + this.numStartElement.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numStartElement.Name = "numStartElement"; + this.numStartElement.Size = new System.Drawing.Size(120, 20); + this.numStartElement.TabIndex = 1; + this.numStartElement.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // lblStartElement + // + this.lblStartElement.AccessibleDescription = ""; + this.lblStartElement.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblStartElement.AutoSize = true; + this.lblStartElement.Location = new System.Drawing.Point(3, 0); + this.lblStartElement.Name = "lblStartElement"; + this.lblStartElement.Size = new System.Drawing.Size(70, 32); + this.lblStartElement.TabIndex = 2; + this.lblStartElement.Text = "Start Element"; + this.lblStartElement.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.AutoSize = true; + this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel2.ColumnCount = 2; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel2.Controls.Add(this.numEndElement, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.lblEndDistance, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 41); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(252, 26); + this.tableLayoutPanel2.TabIndex = 1; + // + // numEndElement + // + this.numEndElement.Location = new System.Drawing.Point(129, 3); + this.numEndElement.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numEndElement.Name = "numEndElement"; + this.numEndElement.Size = new System.Drawing.Size(120, 20); + this.numEndElement.TabIndex = 1; + this.numEndElement.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // lblEndDistance + // + this.lblEndDistance.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblEndDistance.AutoSize = true; + this.lblEndDistance.Location = new System.Drawing.Point(3, 0); + this.lblEndDistance.Name = "lblEndDistance"; + this.lblEndDistance.Size = new System.Drawing.Size(67, 26); + this.lblEndDistance.TabIndex = 2; + this.lblEndDistance.Text = "End Element"; + this.lblEndDistance.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // RepeatControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.Controls.Add(this.lfSpiralControl); + this.Name = "RepeatControl"; + this.Size = new System.Drawing.Size(258, 70); + this.lfSpiralControl.ResumeLayout(false); + this.lfSpiralControl.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numStartElement)).EndInit(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numEndElement)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.FlowLayoutPanel lfSpiralControl; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.NumericUpDown numStartElement; + private System.Windows.Forms.Label lblStartElement; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.NumericUpDown numEndElement; + private System.Windows.Forms.Label lblEndDistance; + } +} diff --git a/MovementScriptGenerator/RepeatControl.cs b/MovementScriptGenerator/RepeatControl.cs new file mode 100644 index 0000000..2054fcf --- /dev/null +++ b/MovementScriptGenerator/RepeatControl.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using MovementScriptGenerator.Modules.OtherChainElements; + +namespace MovementScriptGenerator +{ + public partial class RepeatControl : UserControl + { + public RepeatControl() + { + InitializeComponent(); + } + + public bool Populate(Repeat original) + { + try + { + numStartElement.Value = original.StartElement; + numEndElement.Value = original.EndElement; + } + catch + { + return false; + } + + return true; + } + + public bool ValidateInputs() + { + if(numStartElement.Value <= numEndElement.Value) + { + return true; + } + return false; + } + + public Repeat CreateElement(string elementName) + { + Repeat repeat = new Repeat( + elementName, + (int)numStartElement.Value, + (int)numEndElement.Value + ); + + return repeat; + } + } +} diff --git a/MovementScriptGenerator/RepeatControl.resx b/MovementScriptGenerator/RepeatControl.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MovementScriptGenerator/RepeatControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file From 61a0ca38d2b052bd61fd84b2d461dc6568e7dd93 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 23 Dec 2022 18:39:10 +0100 Subject: [PATCH 09/21] - fixed an error of the repeat element - updated icon of spiral move --- MovementScriptGenerator/Form1.cs | 6 +++++- .../Icons/1_Spiral_Icon.png | Bin 1956 -> 2318 bytes 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 9193910..7c3e9b8 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -285,7 +285,7 @@ private void btnGenerateScript_Click(object sender, EventArgs e) if(movementScript.Frames == null) { - MessageBox.Show("Can't create movement script. Make sure that repeat elements don't create an endless loop."); + MessageBox.Show("Can't create movement script.\nPossible reasons:\n- a repeat element creates an endless loop\n- a repeat element points to elements that don't exist"); return; } @@ -325,6 +325,10 @@ public List AddFramesToScript(Chain chainOfElements) case Repeat repeatEl: Chain repeatedPart = new Chain() {Elements = new List()}; int ammountOfElementsToRepeat = repeatEl.EndElement + 1 - repeatEl.StartElement; + if(repeatEl.StartElement > chain.Elements.Count || repeatEl.EndElement > chain.Elements.Count) + { + return null; + } List toRepeat = chain.Elements.GetRange(repeatEl.StartElement - 1, ammountOfElementsToRepeat); repeatedPart.Elements.AddRange(toRepeat); List framesOfRepeatedPart = AddFramesToScript(repeatedPart, 1); diff --git a/MovementScriptGenerator/Icons/1_Spiral_Icon.png b/MovementScriptGenerator/Icons/1_Spiral_Icon.png index b44c9da87cf52da251456382a0c8f2256996158c..53a8a61d030ca071467c55b3d31326090332bcaa 100644 GIT binary patch literal 2318 zcmd6pZA?>F9LCSR+>RC$3Is%kp+mMhKp}$!SQV~X1)V`uu!I*OLj^>kSY~BXdh6z3 zAR==t4k|G51rz}tFO>?tx(#$n3(AWkj0y@mX$uPSQrhk;ntfPeQos4>oIJ@n_dL(} z{r~rT9}*n6(9FRM0I+aF5PK^C2%I8-`T-oG_E+o%fZDx*y*l(Dq8hkf;OMh}(ouh# z&nzpxG2XrUQ_QrUbL3I6O$c^nj|roxC^wOQuxWpgm1VQ6DQDHHloY)c11A82VpRJ3 zFexBYI!%v`n$6EDWC1)wRy@Zrp-Os|G$xbjcgzWA^*g>cNC$KRKJt=A_vPR~{E)?B z)-Gp&2HJ958HFI+WX+hEY#_k>PwIe(N5ROe&A;-{hbS6b+<{_p+XO-DY)->i$*@c* z&PbOFt|vTqNbifE^AmQ(@Ik@xR5Xu*;lm@YdAJJ$IDa&ZIha$4*7h(5Q4kK;Yg%dE zc65+ee9;>%AVBuFM{N?^#{-A^{Lj`sb<|QuXG*uWZOa{-8&{~rEFvoAqRldRyp4@* zBh<%cRHKF3sc6mJ!sz~fLX#UX=TGGBljtrZI_W;%uG1{SZKMC%vPuFZ^o8%Tk~lL! z^|ILoqH`!(mKayKPMJdh$?3;lSP}f-xx6qtksFFCbAC|J6I?y@endshLix}6nHI6V zgIcVIBViHs`CHIS(Dw6JuE)p-98?L8S|`9`M>KL$u^yP6D(*)-2|+rVnsb)cLjOrl z514cb{0z?fi7$^^%L~H~(o}HA4cEjUNSr{p3OoD!IzA|Ypzm>0# zCfvUB=f#jqNCC@>=IFry$5MVlsr`%SU|My@g?o(vzAZ=07~B{f^f!8)ASYmWGj^^7 zDS&tl$~U2H<_9g5kL-5KES0^y4VY7Ira#63voq#Ld)r_8S)cWW(unZii{*sR?o)Ckkkr6#Z8 zVgLspP9o-vAavSdW=A*(7GAE<+0Xqt04oV;JtTQ;f$U8WU>Kho|DS zEm{X|ZX$S}cLuOXF1ciL-S?C%*sJv#!42i@+mpXsIDhMt%R*0SF zfh~s|#9mH1N3vQrO{=Qm^54)zC3;k0j-q-3glp|T?tmE9CD#m5t6)lfZOcRu!?Ldq z*#^eK^m_c))9UQTrC{|TVTQITW4rU`=PiB`=Jw=|aGXZBN!O~up6NC<^$au`x+B-7 z0A-TG7DV;_of^PbXTH&pv@(R~8tm$u>Cp4RooOVp5RVR_rPWq(5fi3*E!39fA zlHL#;3p@FkS#y zz7Ih{qyYy48DTguRuD}n5Vk6jE6Z4O?+gERO5vB=A2=&OyD5C~9krtd5zG|>0j337jYf?_PzH*XAyj!th};Mi z+5v)Xr5zGOI#NfmRYZCD;Gv^4YULqF1eJ&&Ac8jizr7D zELCsCt1KZsx=>z7`%ob8qbzukLonU*Vh>d$4YK{MSRK3&W$3b23&+H4ooV6}?(Nf9r-@_OXdvU0+L&d3GAyoNK9%TX(I# zZAu4%1MjdLc_hfuoL`T7Vc1&xPs8;U4Dfj>{f+C)BHojp)J5|y?2YHEItOR?-|7TM z@u99%u|t{@2{z)YJBW&;$&;vmk1e1ps{77^U49rQvm?Jkz+L%Kui$lS`9eU^ynE*I zLw1GPyg~&o$$Q-iE0ObvN97irgL)n)t@*fU9}Qy0il(>{L?iFT)eWi<9H$hyzpEPq zF|2|#{K1NGl3OVL5>J7YL*$oCr z5)WD7@hD1nr^Hz`g}A?Q$%QCeLW20c2clsoCu5Hw$p6-K?%=rAY`EXvHrUZS`(il7 z#YVYt=1pbDkNuA0u;}udok21u1fFv_l;}rl*)+Fb3{$uyxVBc4O^2g|?{o1r2QXip z6hvjB3~E7r&fs&yT&_VqV2sYVvLI)jKD;o#KWo&|AG>12fgj?s`PnXo0&#GR1BMXw zeyLHTqX_@pYM{T&fT5?#sv6X?(Hg)s&*&aSO|YK;CsI0C|rhNdNc7w>vEna6h_v%?U9i3u3A{)4 xlA8x1U3MU!PD0~zz3JYEAO3%Dw?j*2?A#J|eAXuPxQn(g2n`AsUI>&O{|7&KXTJad From a2c6ab169a8c2266338eb2f1df642ddb65d2e7f0 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 23 Dec 2022 19:28:05 +0100 Subject: [PATCH 10/21] - added possibility to get element settings by double clicking - updated path textfield - moved btnElementApplySettings from Element Options to buttons below Move Settings --- MovementScriptGenerator/Form1.Designer.cs | 62 ++++++++++++++--------- MovementScriptGenerator/Form1.cs | 7 ++- MovementScriptGenerator/Form1.resx | 20 +++++--- 3 files changed, 56 insertions(+), 33 deletions(-) diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index def4bf9..9799002 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -405,6 +405,7 @@ private void InitializeComponent() this.tvChain.Size = new System.Drawing.Size(418, 591); this.tvChain.TabIndex = 7; this.tvChain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvChain_AfterSelect); + this.tvChain.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvChain_NodeMouseDoubleClick); // // tableLayoutPanel19 // @@ -442,7 +443,6 @@ private void InitializeComponent() this.flowLayoutPanel4.Controls.Add(this.tableLayoutPanel20); this.flowLayoutPanel4.Controls.Add(this.btnElementDuplicate); this.flowLayoutPanel4.Controls.Add(this.btnElementGetSettings); - this.flowLayoutPanel4.Controls.Add(this.btnElementApplySettings); this.flowLayoutPanel4.Controls.Add(this.btnElementDelete); this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel4.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; @@ -521,19 +521,22 @@ private void InitializeComponent() this.btnElementGetSettings.TabIndex = 5; this.btnElementGetSettings.Text = "Get Settings"; this.btnElementGetSettings.UseVisualStyleBackColor = true; - this.btnElementGetSettings.Click += new System.EventHandler(this.btnElementEditSettings_Click); + this.btnElementGetSettings.Click += new System.EventHandler(this.btnElementGetSettings_Click); // // btnElementApplySettings // + this.btnElementApplySettings.AutoSize = true; + this.btnElementApplySettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnElementApplySettings.Dock = System.Windows.Forms.DockStyle.Fill; this.btnElementApplySettings.Enabled = false; this.btnElementApplySettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementApplySettings.Location = new System.Drawing.Point(3, 93); - this.btnElementApplySettings.MinimumSize = new System.Drawing.Size(115, 0); + this.btnElementApplySettings.Location = new System.Drawing.Point(45, 3); + this.btnElementApplySettings.MinimumSize = new System.Drawing.Size(0, 26); this.btnElementApplySettings.Name = "btnElementApplySettings"; - this.btnElementApplySettings.Size = new System.Drawing.Size(115, 23); + this.btnElementApplySettings.Size = new System.Drawing.Size(43, 26); this.btnElementApplySettings.TabIndex = 6; - this.btnElementApplySettings.Text = "Apply Settings"; + this.btnElementApplySettings.Text = "Apply"; + this.ToolTip.SetToolTip(this.btnElementApplySettings, "Applies the current settings to the selected element."); this.btnElementApplySettings.UseVisualStyleBackColor = true; this.btnElementApplySettings.Click += new System.EventHandler(this.btnElementApplySettings_Click); // @@ -542,7 +545,7 @@ private void InitializeComponent() this.btnElementDelete.Dock = System.Windows.Forms.DockStyle.Fill; this.btnElementDelete.Enabled = false; this.btnElementDelete.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementDelete.Location = new System.Drawing.Point(3, 122); + this.btnElementDelete.Location = new System.Drawing.Point(3, 93); this.btnElementDelete.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementDelete.Name = "btnElementDelete"; this.btnElementDelete.Size = new System.Drawing.Size(115, 23); @@ -555,13 +558,13 @@ private void InitializeComponent() // this.tableLayoutPanel21.ColumnCount = 4; this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 64F)); this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); - this.tableLayoutPanel21.Controls.Add(this.btnEditPath, 1, 0); - this.tableLayoutPanel21.Controls.Add(this.txtPath, 2, 0); this.tableLayoutPanel21.Controls.Add(this.btnGenerateScript, 3, 0); + this.tableLayoutPanel21.Controls.Add(this.txtPath, 1, 0); this.tableLayoutPanel21.Controls.Add(this.lblPath, 0, 0); + this.tableLayoutPanel21.Controls.Add(this.btnEditPath, 2, 0); this.tableLayoutPanel21.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel21.Location = new System.Drawing.Point(0, 667); this.tableLayoutPanel21.Margin = new System.Windows.Forms.Padding(0); @@ -573,10 +576,12 @@ private void InitializeComponent() // // btnEditPath // + this.btnEditPath.AutoSize = true; + this.btnEditPath.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnEditPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnEditPath.Location = new System.Drawing.Point(43, 3); + this.btnEditPath.Location = new System.Drawing.Point(363, 3); this.btnEditPath.Name = "btnEditPath"; - this.btnEditPath.Size = new System.Drawing.Size(115, 30); + this.btnEditPath.Size = new System.Drawing.Size(58, 30); this.btnEditPath.TabIndex = 2; this.btnEditPath.Text = "Edit Path"; this.btnEditPath.UseVisualStyleBackColor = true; @@ -585,12 +590,17 @@ private void InitializeComponent() // txtPath // this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtPath.Location = new System.Drawing.Point(164, 3); + this.txtPath.Location = new System.Drawing.Point(40, 0); + this.txtPath.Margin = new System.Windows.Forms.Padding(0); + this.txtPath.Multiline = true; this.txtPath.Name = "txtPath"; - this.txtPath.Size = new System.Drawing.Size(257, 20); + this.txtPath.ReadOnly = true; + this.txtPath.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; + this.txtPath.Size = new System.Drawing.Size(320, 36); this.txtPath.TabIndex = 1; this.txtPath.Text = "C:\\Program Files\\Steam\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScrip" + "ts"; + this.txtPath.WordWrap = false; // // btnGenerateScript // @@ -612,7 +622,7 @@ private void InitializeComponent() this.lblPath.Size = new System.Drawing.Size(34, 36); this.lblPath.TabIndex = 0; this.lblPath.Text = "Path:"; - this.lblPath.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.lblPath.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.ToolTip.SetToolTip(this.lblPath, resources.GetString("lblPath.ToolTip")); // // tableLayoutPanel16 @@ -638,6 +648,7 @@ private void InitializeComponent() // flowLayoutPanel3 // this.flowLayoutPanel3.Controls.Add(this.btnAddMoveToChain); + this.flowLayoutPanel3.Controls.Add(this.btnElementApplySettings); this.flowLayoutPanel3.Controls.Add(this.btnInsert); this.flowLayoutPanel3.Controls.Add(this.btnResetMoveSettings); this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; @@ -654,13 +665,13 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left))); this.btnAddMoveToChain.AutoSize = true; this.btnAddMoveToChain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnAddMoveToChain.Location = new System.Drawing.Point(0, 3); - this.btnAddMoveToChain.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); + this.btnAddMoveToChain.Location = new System.Drawing.Point(3, 3); this.btnAddMoveToChain.MinimumSize = new System.Drawing.Size(0, 26); this.btnAddMoveToChain.Name = "btnAddMoveToChain"; - this.btnAddMoveToChain.Size = new System.Drawing.Size(82, 26); + this.btnAddMoveToChain.Size = new System.Drawing.Size(36, 26); this.btnAddMoveToChain.TabIndex = 2; - this.btnAddMoveToChain.Text = "Add To Chain"; + this.btnAddMoveToChain.Text = "Add"; + this.ToolTip.SetToolTip(this.btnAddMoveToChain, "Adds a new element to the chain with the current settings."); this.btnAddMoveToChain.UseVisualStyleBackColor = true; this.btnAddMoveToChain.Click += new System.EventHandler(this.btnAddMoveToChain_Click); // @@ -671,26 +682,27 @@ private void InitializeComponent() this.btnInsert.AutoSize = true; this.btnInsert.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnInsert.Enabled = false; - this.btnInsert.Location = new System.Drawing.Point(85, 3); - this.btnInsert.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); + this.btnInsert.Location = new System.Drawing.Point(94, 3); this.btnInsert.MinimumSize = new System.Drawing.Size(0, 26); this.btnInsert.Name = "btnInsert"; this.btnInsert.Size = new System.Drawing.Size(43, 26); this.btnInsert.TabIndex = 4; this.btnInsert.Text = "Insert"; + this.ToolTip.SetToolTip(this.btnInsert, "Inserts a new element into the chain after the selected element"); this.btnInsert.UseVisualStyleBackColor = true; this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click); // // btnResetMoveSettings // + this.btnResetMoveSettings.AutoSize = true; + this.btnResetMoveSettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.btnResetMoveSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnResetMoveSettings.Location = new System.Drawing.Point(134, 3); - this.btnResetMoveSettings.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); + this.btnResetMoveSettings.Location = new System.Drawing.Point(143, 3); this.btnResetMoveSettings.MinimumSize = new System.Drawing.Size(0, 26); this.btnResetMoveSettings.Name = "btnResetMoveSettings"; - this.btnResetMoveSettings.Size = new System.Drawing.Size(103, 26); + this.btnResetMoveSettings.Size = new System.Drawing.Size(45, 26); this.btnResetMoveSettings.TabIndex = 3; - this.btnResetMoveSettings.Text = "Reset To Defaults"; + this.btnResetMoveSettings.Text = "Reset"; this.ToolTip.SetToolTip(this.btnResetMoveSettings, "Resets the currently selected move settings to their default values."); this.btnResetMoveSettings.UseVisualStyleBackColor = true; this.btnResetMoveSettings.Click += new System.EventHandler(this.btnResetMoveControl_Click); diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 7c3e9b8..73bbad3 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -525,7 +525,7 @@ private bool MoveNameValid(string moveName) return true; } - private void btnElementEditSettings_Click(object sender, EventArgs e) + private void btnElementGetSettings_Click(object sender, EventArgs e) { if(tvChain.SelectedNode == null) { @@ -753,5 +753,10 @@ private void btnEditPath_Click(object sender, EventArgs e) txtPath.Text = dialog.FileName; } } + + private void tvChain_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) + { + btnElementGetSettings_Click(sender, e); + } } } diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index f82e972..bda2b85 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -120,6 +120,16 @@ 17, 17 + + The path of the directory in which the Movement Script File will be saved. +Make sure to save the Files to the correct directory, else the camera2 mod will not be able +to get them. +The path should be something like this: +D:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts + + + 17, 17 + On -> the script will pause, while the song is paused and start playing when the song starts. @@ -134,13 +144,9 @@ Will overwrite the "Sync To Song" and "Loop" options of the existing file! Off -> A new movement script file will be created for the move. If a file with the same name exists, that file will be overwritten! - - The path of the directory in which the Movement Script File will be saved. -Make sure to save the Files to the correct directory, else the camera2 mod will not be able -to get them. -The path should be something like this: -D:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts - + + 17, 17 + From 9bc6915131508e69d603e277b469b4bcdf05d73b Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 23 Dec 2022 19:34:38 +0100 Subject: [PATCH 11/21] - Added functionality that after some Error-Messageboxes, the needed element will be focused --- MovementScriptGenerator/Form1.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 73bbad3..4b83506 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -255,24 +255,28 @@ private void btnGenerateScript_Click(object sender, EventArgs e) if (txtFileName.Text.IndexOfAny(illegalCharsForExplorer) != -1) { MessageBox.Show($"Couldn't generate the file because there are not allowed special characters in the filename.\nPlease make sure to not use any of these characters:\n{new string(illegalCharsForExplorer)}"); + txtFileName.Focus(); return; } if (filePath.IndexOfAny(Path.GetInvalidPathChars()) != -1) { MessageBox.Show($"Couldn't generate the file because the file path is invalid.\nPlease check that the file path is correct and pointing to the right folder."); + btnEditPath.Focus(); return; } if (!Directory.Exists(txtPath.Text)) { MessageBox.Show("Couldn't find a directory at the given path.\nPlease make sure that the path points to an existsing directory on your device."); + btnEditPath.Focus(); return; } if(chain.Elements.Count <= 0) { MessageBox.Show("Can't create a movement script without any moves.\nPlease add moves to the chain before trying to generate a movement script."); + cbType.Focus(); return; } From bdd507a54440ae4fe60db4e2e4ca99c38bb98542 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 23 Dec 2022 19:36:05 +0100 Subject: [PATCH 12/21] - removed unused code --- MovementScriptGenerator/Form1.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 4b83506..6de78fc 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -122,10 +122,6 @@ private void UpdateChainWindow() ChainElement currentElement = chain.Elements[i]; tvChain.Nodes.Add(string.Empty, $"{i + 1}. {currentElement.Name}", currentElement.IconIndex, currentElement.IconIndex); } - /*foreach (ChainElement el in chain.Elements) - { - tvChain.Nodes.Add(string.Empty, $"{el.}{el.Name}", el.IconIndex, el.IconIndex); - }*/ if (tvChain.Nodes.Count > 0) { tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1]; @@ -147,10 +143,6 @@ private void UpdateChainWindow(int indexOfNodeToBeSelected) ChainElement currentElement = chain.Elements[i]; tvChain.Nodes.Add(string.Empty, $"{i + 1}. {currentElement.Name}", currentElement.IconIndex, currentElement.IconIndex); } - /*foreach (ChainElement el in chain.Elements) - { - tvChain.Nodes.Add(string.Empty, $"{el.}{el.Name}", el.IconIndex, el.IconIndex); - }*/ if(indexOfNodeToBeSelected < tvChain.Nodes.Count) { tvChain.SelectedNode = tvChain.Nodes[indexOfNodeToBeSelected]; From 2ef9428b49d3d2b211c336202588439e710ea83f Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 30 Dec 2022 03:08:24 +0100 Subject: [PATCH 13/21] - created user settings for easier use when closing and reopening the program - changed UI so that menu strip looks more like a standard implementation - removed title because it just took screenspace and didn't add anything to the experience - Improved window-resize-handling so that buttons will still be visible at all sizes - Added meaningful names to all elements in Main form - Unlinked Script from Chain, so that the difference is easier to understand - fixed tab indexes of Main Form and Circle Form - Implemented file "save" - Implemented file "save as" - Implemented file "open" - Implemented file "new" --- MovementScriptGenerator/App.config | 24 + .../CircleControl.Designer.cs | 6 +- MovementScriptGenerator/CompareObject.cs | 65 + MovementScriptGenerator/Form1.Designer.cs | 1489 ++++++++--------- MovementScriptGenerator/Form1.cs | 451 ++++- MovementScriptGenerator/Form1.resx | 33 +- MovementScriptGenerator/Modules/Chain.cs | 3 + .../MovementScriptGenerator.csproj | 1 + .../Properties/Settings.Designer.cs | 81 +- .../Properties/Settings.settings | 26 +- 10 files changed, 1256 insertions(+), 923 deletions(-) create mode 100644 MovementScriptGenerator/CompareObject.cs diff --git a/MovementScriptGenerator/App.config b/MovementScriptGenerator/App.config index 193aecc..31ba27e 100644 --- a/MovementScriptGenerator/App.config +++ b/MovementScriptGenerator/App.config @@ -1,6 +1,30 @@  + + +
+ + + + + + + + + + + + + + + 0, 0 + + + 923, 754 + + + \ No newline at end of file diff --git a/MovementScriptGenerator/CircleControl.Designer.cs b/MovementScriptGenerator/CircleControl.Designer.cs index 75ddc60..a2f027d 100644 --- a/MovementScriptGenerator/CircleControl.Designer.cs +++ b/MovementScriptGenerator/CircleControl.Designer.cs @@ -463,7 +463,7 @@ private void InitializeComponent() this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); this.tableLayoutPanel10.Size = new System.Drawing.Size(254, 26); - this.tableLayoutPanel10.TabIndex = 9; + this.tableLayoutPanel10.TabIndex = 7; // // numSector // @@ -512,7 +512,7 @@ private void InitializeComponent() this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); this.tableLayoutPanel8.Size = new System.Drawing.Size(254, 27); - this.tableLayoutPanel8.TabIndex = 7; + this.tableLayoutPanel8.TabIndex = 8; // // cbRotation // @@ -555,7 +555,7 @@ private void InitializeComponent() this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); this.tableLayoutPanel9.Size = new System.Drawing.Size(254, 26); - this.tableLayoutPanel9.TabIndex = 8; + this.tableLayoutPanel9.TabIndex = 9; // // numDuration // diff --git a/MovementScriptGenerator/CompareObject.cs b/MovementScriptGenerator/CompareObject.cs new file mode 100644 index 0000000..0a2c3fd --- /dev/null +++ b/MovementScriptGenerator/CompareObject.cs @@ -0,0 +1,65 @@ +using System.Reflection; + +namespace MovementScriptGenerator +{ + /// + /// Compares two objects by the values of their properties instead of their instances. + /// Code from this article: https://www.c-sharpcorner.com/article/comparing-objects-in-c-sharp/ + /// + public static class CompareObject + { + //TODO Refactor this code as it deletes lists of e2! + public static bool Compare(T e1, T e2) + { + bool flag = true; + bool match = false; + int countFirst, countSecond; + foreach (PropertyInfo propObj1 in e1.GetType().GetProperties()) + { + var propObj2 = e2.GetType().GetProperty(propObj1.Name); + if (propObj1.PropertyType.Name.Equals("List`1")) + { + dynamic objList1 = propObj1.GetValue(e1, null); + dynamic objList2 = propObj2.GetValue(e2, null); + countFirst = objList1.Count; + countSecond = objList2.Count; + if (countFirst == countSecond) + { + countFirst = objList1.Count - 1; + while (countFirst > -1) + { + match = false; + countSecond = objList2.Count - 1; + while (countSecond > -1) + { + match = Compare(objList1[countFirst], objList2[countSecond]); + if (match) + { + objList2.Remove(objList2[countSecond]); + countSecond = -1; + match = true; + } + if (match == false && countSecond == 0) + { + return false; + } + countSecond--; + } + countFirst--; + } + } + else + { + return false; + } + } + else if (!(propObj1.GetValue(e1, null).Equals(propObj2.GetValue(e2, null)))) + { + flag = false; + return flag; + } + } + return flag; + } + } +} diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs index 9799002..397765b 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -31,253 +31,202 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.lblTitle = new System.Windows.Forms.Label(); - this.tableLayoutPanel13 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel14 = new System.Windows.Forms.TableLayoutPanel(); - this.label2 = new System.Windows.Forms.Label(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.txtFileName = new System.Windows.Forms.TextBox(); - this.lblFileName = new System.Windows.Forms.Label(); - this.tableLayoutPanel10 = new System.Windows.Forms.TableLayoutPanel(); - this.lblSyncToSong = new System.Windows.Forms.Label(); + this.tlpContentAndMargin = new System.Windows.Forms.TableLayoutPanel(); + this.tlpElementSettingsAndChainSettings = new System.Windows.Forms.TableLayoutPanel(); + this.tlpChain = new System.Windows.Forms.TableLayoutPanel(); + this.flpScriptOptions = new System.Windows.Forms.FlowLayoutPanel(); + this.btnGenerateScript = new System.Windows.Forms.Button(); + this.btnEditScriptPath = new System.Windows.Forms.Button(); + this.txtScriptName = new System.Windows.Forms.TextBox(); + this.lblScriptName = new System.Windows.Forms.Label(); this.checkSyncToSong = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); - this.lblLoop = new System.Windows.Forms.Label(); - this.checkLoop = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel12 = new System.Windows.Forms.TableLayoutPanel(); - this.lblAddToScript = new System.Windows.Forms.Label(); + this.lblSyncToSong = new System.Windows.Forms.Label(); this.checkAddToScript = new System.Windows.Forms.CheckBox(); - this.tableLayoutPanel18 = new System.Windows.Forms.TableLayoutPanel(); + this.lblAddToScript = new System.Windows.Forms.Label(); + this.checkLoop = new System.Windows.Forms.CheckBox(); + this.lblLoop = new System.Windows.Forms.Label(); + this.lblChainTitle = new System.Windows.Forms.Label(); + this.flpChainSettings = new System.Windows.Forms.FlowLayoutPanel(); + this.lblChainName = new System.Windows.Forms.Label(); + this.txtChainName = new System.Windows.Forms.TextBox(); + this.tlpChainTreeAndElementOptions = new System.Windows.Forms.TableLayoutPanel(); this.tvChain = new System.Windows.Forms.TreeView(); - this.tableLayoutPanel19 = new System.Windows.Forms.TableLayoutPanel(); - this.lblElementOptions = new System.Windows.Forms.Label(); - this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); - this.tableLayoutPanel20 = new System.Windows.Forms.TableLayoutPanel(); + this.tlpElementSelectedOptions = new System.Windows.Forms.TableLayoutPanel(); + this.lblElementSelectedOptions = new System.Windows.Forms.Label(); + this.flpElementSelectedOptions = new System.Windows.Forms.FlowLayoutPanel(); + this.tlpElementSelectedOptionMoveUpAndDown = new System.Windows.Forms.TableLayoutPanel(); this.btnElementMoveDown = new System.Windows.Forms.Button(); this.btnElementMoveUp = new System.Windows.Forms.Button(); this.btnElementDuplicate = new System.Windows.Forms.Button(); this.btnElementGetSettings = new System.Windows.Forms.Button(); - this.btnElementApplySettings = new System.Windows.Forms.Button(); this.btnElementDelete = new System.Windows.Forms.Button(); - this.tableLayoutPanel21 = new System.Windows.Forms.TableLayoutPanel(); - this.btnEditPath = new System.Windows.Forms.Button(); - this.txtPath = new System.Windows.Forms.TextBox(); - this.btnGenerateScript = new System.Windows.Forms.Button(); - this.lblPath = new System.Windows.Forms.Label(); - this.tableLayoutPanel16 = new System.Windows.Forms.TableLayoutPanel(); - this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); + this.tlpElementSettings = new System.Windows.Forms.TableLayoutPanel(); + this.flpElementOptions = new System.Windows.Forms.FlowLayoutPanel(); this.btnAddMoveToChain = new System.Windows.Forms.Button(); + this.btnElementApplySettings = new System.Windows.Forms.Button(); this.btnInsert = new System.Windows.Forms.Button(); this.btnResetMoveSettings = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); + this.lblElementTitle = new System.Windows.Forms.Label(); this.flpContent = new System.Windows.Forms.FlowLayoutPanel(); - this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.lblMoveDescriptionTitle = new System.Windows.Forms.Label(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); - this.lblMoveDescription = new System.Windows.Forms.Label(); - this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); - this.lblSettingsTitle = new System.Windows.Forms.Label(); - this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel(); - this.lblDescription = new System.Windows.Forms.Label(); - this.tlContent = new System.Windows.Forms.TableLayoutPanel(); - this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.cbType = new System.Windows.Forms.ComboBox(); + this.lblElementDescriptionTitle = new System.Windows.Forms.Label(); + this.lblElementDescription = new System.Windows.Forms.Label(); + this.lblElementSettingsTitle = new System.Windows.Forms.Label(); + this.lblElementDescriptionHint = new System.Windows.Forms.Label(); + this.tlpContent = new System.Windows.Forms.TableLayoutPanel(); + this.flpElementGeneralSettings = new System.Windows.Forms.FlowLayoutPanel(); + this.tlpElementSettingType = new System.Windows.Forms.TableLayoutPanel(); + this.cbElementType = new System.Windows.Forms.ComboBox(); this.lblType = new System.Windows.Forms.Label(); - this.tableLayoutPanel17 = new System.Windows.Forms.TableLayoutPanel(); - this.txtMoveName = new System.Windows.Forms.TextBox(); + this.tlpElementSettingName = new System.Windows.Forms.TableLayoutPanel(); + this.txtElementName = new System.Windows.Forms.TextBox(); this.lblMoveName = new System.Windows.Forms.Label(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.toolStripFileOptions = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.tableLayoutPanel1.SuspendLayout(); - this.tableLayoutPanel13.SuspendLayout(); - this.tableLayoutPanel14.SuspendLayout(); - this.flowLayoutPanel1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel10.SuspendLayout(); - this.tableLayoutPanel9.SuspendLayout(); - this.tableLayoutPanel12.SuspendLayout(); - this.tableLayoutPanel18.SuspendLayout(); - this.tableLayoutPanel19.SuspendLayout(); - this.flowLayoutPanel4.SuspendLayout(); - this.tableLayoutPanel20.SuspendLayout(); - this.tableLayoutPanel21.SuspendLayout(); - this.tableLayoutPanel16.SuspendLayout(); - this.flowLayoutPanel3.SuspendLayout(); + this.tlpMenuAndContent = new System.Windows.Forms.TableLayoutPanel(); + this.tlpContentAndMargin.SuspendLayout(); + this.tlpElementSettingsAndChainSettings.SuspendLayout(); + this.tlpChain.SuspendLayout(); + this.flpScriptOptions.SuspendLayout(); + this.flpChainSettings.SuspendLayout(); + this.tlpChainTreeAndElementOptions.SuspendLayout(); + this.tlpElementSelectedOptions.SuspendLayout(); + this.flpElementSelectedOptions.SuspendLayout(); + this.tlpElementSelectedOptionMoveUpAndDown.SuspendLayout(); + this.tlpElementSettings.SuspendLayout(); + this.flpElementOptions.SuspendLayout(); this.flpContent.SuspendLayout(); - this.tableLayoutPanel5.SuspendLayout(); - this.tableLayoutPanel7.SuspendLayout(); - this.tableLayoutPanel6.SuspendLayout(); - this.tableLayoutPanel8.SuspendLayout(); - this.flowLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); - this.tableLayoutPanel17.SuspendLayout(); + this.flpElementGeneralSettings.SuspendLayout(); + this.tlpElementSettingType.SuspendLayout(); + this.tlpElementSettingName.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.tlpMenuAndContent.SuspendLayout(); this.SuspendLayout(); // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 3; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel1.Controls.Add(this.lblTitle, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel13, 1, 1); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 7.5F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 87.5F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(894, 811); - this.tableLayoutPanel1.TabIndex = 2; - // - // lblTitle - // - this.lblTitle.AutoSize = true; - this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.Location = new System.Drawing.Point(23, 0); - this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(848, 60); - this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "MovementScriptGenerator"; - this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tableLayoutPanel13 - // - this.tableLayoutPanel13.ColumnCount = 2; - this.tableLayoutPanel13.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 300F)); - this.tableLayoutPanel13.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel13.Controls.Add(this.tableLayoutPanel14, 1, 0); - this.tableLayoutPanel13.Controls.Add(this.tableLayoutPanel16, 0, 0); - this.tableLayoutPanel13.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel13.Location = new System.Drawing.Point(23, 63); - this.tableLayoutPanel13.Name = "tableLayoutPanel13"; - this.tableLayoutPanel13.RowCount = 1; - this.tableLayoutPanel13.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel13.Size = new System.Drawing.Size(848, 703); - this.tableLayoutPanel13.TabIndex = 7; - // - // tableLayoutPanel14 - // - this.tableLayoutPanel14.ColumnCount = 1; - this.tableLayoutPanel14.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel14.Controls.Add(this.label2, 0, 0); - this.tableLayoutPanel14.Controls.Add(this.flowLayoutPanel1, 0, 1); - this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel18, 0, 2); - this.tableLayoutPanel14.Controls.Add(this.tableLayoutPanel21, 0, 3); - this.tableLayoutPanel14.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel14.Location = new System.Drawing.Point(303, 0); - this.tableLayoutPanel14.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); - this.tableLayoutPanel14.Name = "tableLayoutPanel14"; - this.tableLayoutPanel14.RowCount = 4; - this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F)); - this.tableLayoutPanel14.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel14.Size = new System.Drawing.Size(545, 703); - this.tableLayoutPanel14.TabIndex = 4; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Dock = System.Windows.Forms.DockStyle.Fill; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(3, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(539, 35); - this.label2.TabIndex = 5; - this.label2.Text = "Move Chain"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel2); - this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel10); - this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel9); - this.flowLayoutPanel1.Controls.Add(this.tableLayoutPanel12); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 35); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); - this.flowLayoutPanel1.MinimumSize = new System.Drawing.Size(0, 30); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(545, 35); - this.flowLayoutPanel1.TabIndex = 6; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.AutoSize = true; - this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel2.Controls.Add(this.txtFileName, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.lblFileName, 0, 0); - this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel2.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 1; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(221, 26); - this.tableLayoutPanel2.TabIndex = 2; - // - // txtFileName - // - this.txtFileName.Location = new System.Drawing.Point(69, 3); - this.txtFileName.Name = "txtFileName"; - this.txtFileName.Size = new System.Drawing.Size(149, 20); - this.txtFileName.TabIndex = 1; - // - // lblFileName - // - this.lblFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.lblFileName.AutoSize = true; - this.lblFileName.Location = new System.Drawing.Point(3, 0); - this.lblFileName.Name = "lblFileName"; - this.lblFileName.Size = new System.Drawing.Size(54, 26); - this.lblFileName.TabIndex = 0; - this.lblFileName.Text = "File Name"; - this.lblFileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblFileName, "defines the name of movement script file that will be generated / added to.\r\nAdd " + - "this name to the script list in your camera script to make the camera use this s" + - "cript.\r\n"); + // tlpContentAndMargin + // + this.tlpContentAndMargin.ColumnCount = 3; + this.tlpContentAndMargin.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpContentAndMargin.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpContentAndMargin.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpContentAndMargin.Controls.Add(this.tlpElementSettingsAndChainSettings, 1, 0); + this.tlpContentAndMargin.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpContentAndMargin.Location = new System.Drawing.Point(3, 23); + this.tlpContentAndMargin.Name = "tlpContentAndMargin"; + this.tlpContentAndMargin.RowCount = 2; + this.tlpContentAndMargin.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 95F)); + this.tlpContentAndMargin.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); + this.tlpContentAndMargin.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpContentAndMargin.Size = new System.Drawing.Size(1099, 689); + this.tlpContentAndMargin.TabIndex = 1; + // + // tlpElementSettingsAndChainSettings + // + this.tlpElementSettingsAndChainSettings.ColumnCount = 2; + this.tlpElementSettingsAndChainSettings.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 310F)); + this.tlpElementSettingsAndChainSettings.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSettingsAndChainSettings.Controls.Add(this.tlpChain, 1, 0); + this.tlpElementSettingsAndChainSettings.Controls.Add(this.tlpElementSettings, 0, 0); + this.tlpElementSettingsAndChainSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpElementSettingsAndChainSettings.Location = new System.Drawing.Point(23, 3); + this.tlpElementSettingsAndChainSettings.Name = "tlpElementSettingsAndChainSettings"; + this.tlpElementSettingsAndChainSettings.RowCount = 1; + this.tlpElementSettingsAndChainSettings.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSettingsAndChainSettings.Size = new System.Drawing.Size(1053, 648); + this.tlpElementSettingsAndChainSettings.TabIndex = 1; + // + // tlpChain + // + this.tlpChain.ColumnCount = 1; + this.tlpChain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpChain.Controls.Add(this.flpScriptOptions, 0, 3); + this.tlpChain.Controls.Add(this.lblChainTitle, 0, 0); + this.tlpChain.Controls.Add(this.flpChainSettings, 0, 1); + this.tlpChain.Controls.Add(this.tlpChainTreeAndElementOptions, 0, 2); + this.tlpChain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpChain.Location = new System.Drawing.Point(313, 0); + this.tlpChain.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); + this.tlpChain.Name = "tlpChain"; + this.tlpChain.RowCount = 4; + this.tlpChain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpChain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpChain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpChain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpChain.Size = new System.Drawing.Size(740, 648); + this.tlpChain.TabIndex = 2; + // + // flpScriptOptions + // + this.flpScriptOptions.Controls.Add(this.btnGenerateScript); + this.flpScriptOptions.Controls.Add(this.btnEditScriptPath); + this.flpScriptOptions.Controls.Add(this.txtScriptName); + this.flpScriptOptions.Controls.Add(this.lblScriptName); + this.flpScriptOptions.Controls.Add(this.checkSyncToSong); + this.flpScriptOptions.Controls.Add(this.lblSyncToSong); + this.flpScriptOptions.Controls.Add(this.checkAddToScript); + this.flpScriptOptions.Controls.Add(this.lblAddToScript); + this.flpScriptOptions.Controls.Add(this.checkLoop); + this.flpScriptOptions.Controls.Add(this.lblLoop); + this.flpScriptOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpScriptOptions.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; + this.flpScriptOptions.Location = new System.Drawing.Point(0, 617); + this.flpScriptOptions.Margin = new System.Windows.Forms.Padding(0); + this.flpScriptOptions.MinimumSize = new System.Drawing.Size(0, 30); + this.flpScriptOptions.Name = "flpScriptOptions"; + this.flpScriptOptions.Size = new System.Drawing.Size(740, 31); + this.flpScriptOptions.TabIndex = 4; // - // tableLayoutPanel10 - // - this.tableLayoutPanel10.AutoSize = true; - this.tableLayoutPanel10.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel10.ColumnCount = 2; - this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel10.Controls.Add(this.lblSyncToSong, 0, 0); - this.tableLayoutPanel10.Controls.Add(this.checkSyncToSong, 1, 0); - this.tableLayoutPanel10.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel10.Location = new System.Drawing.Point(230, 3); - this.tableLayoutPanel10.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel10.Name = "tableLayoutPanel10"; - this.tableLayoutPanel10.RowCount = 1; - this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel10.Size = new System.Drawing.Size(102, 26); - this.tableLayoutPanel10.TabIndex = 4; + // btnGenerateScript // - // lblSyncToSong + this.btnGenerateScript.AutoSize = true; + this.btnGenerateScript.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnGenerateScript.Location = new System.Drawing.Point(622, 3); + this.btnGenerateScript.MinimumSize = new System.Drawing.Size(115, 0); + this.btnGenerateScript.Name = "btnGenerateScript"; + this.btnGenerateScript.Size = new System.Drawing.Size(115, 23); + this.btnGenerateScript.TabIndex = 10; + this.btnGenerateScript.Text = "Generate Script"; + this.btnGenerateScript.UseVisualStyleBackColor = true; + this.btnGenerateScript.Click += new System.EventHandler(this.btnGenerateScript_Click); // - this.lblSyncToSong.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // btnEditScriptPath + // + this.btnEditScriptPath.AutoSize = true; + this.btnEditScriptPath.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnEditScriptPath.Location = new System.Drawing.Point(526, 3); + this.btnEditScriptPath.Name = "btnEditScriptPath"; + this.btnEditScriptPath.Size = new System.Drawing.Size(90, 23); + this.btnEditScriptPath.TabIndex = 9; + this.btnEditScriptPath.Text = "Edit Script Path"; + this.ToolTip.SetToolTip(this.btnEditScriptPath, resources.GetString("btnEditScriptPath.ToolTip")); + this.btnEditScriptPath.UseVisualStyleBackColor = true; + this.btnEditScriptPath.Click += new System.EventHandler(this.btnEditScriptPath_Click); + // + // txtScriptName + // + this.txtScriptName.Location = new System.Drawing.Point(371, 3); + this.txtScriptName.Name = "txtScriptName"; + this.txtScriptName.Size = new System.Drawing.Size(149, 20); + this.txtScriptName.TabIndex = 8; + // + // lblScriptName + // + this.lblScriptName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.lblSyncToSong.AutoSize = true; - this.lblSyncToSong.Location = new System.Drawing.Point(3, 0); - this.lblSyncToSong.Name = "lblSyncToSong"; - this.lblSyncToSong.Size = new System.Drawing.Size(75, 26); - this.lblSyncToSong.TabIndex = 1; - this.lblSyncToSong.Text = "Sync To Song"; - this.lblSyncToSong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblSyncToSong, resources.GetString("lblSyncToSong.ToolTip")); + this.lblScriptName.AutoSize = true; + this.lblScriptName.Location = new System.Drawing.Point(300, 0); + this.lblScriptName.Name = "lblScriptName"; + this.lblScriptName.Size = new System.Drawing.Size(65, 29); + this.lblScriptName.TabIndex = 7; + this.lblScriptName.Text = "Script Name"; + this.lblScriptName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblScriptName, "defines the name of the movement script file that will be generated / added to.\r\n" + + "Add this name to the script list in your camera\'s Json file to make the camera u" + + "se this script.\r\n"); // // checkSyncToSong // @@ -286,43 +235,48 @@ private void InitializeComponent() this.checkSyncToSong.AutoSize = true; this.checkSyncToSong.Checked = true; this.checkSyncToSong.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkSyncToSong.Location = new System.Drawing.Point(84, 3); + this.checkSyncToSong.Location = new System.Drawing.Point(279, 3); this.checkSyncToSong.Name = "checkSyncToSong"; - this.checkSyncToSong.Size = new System.Drawing.Size(15, 20); - this.checkSyncToSong.TabIndex = 1; + this.checkSyncToSong.Size = new System.Drawing.Size(15, 23); + this.checkSyncToSong.TabIndex = 6; this.checkSyncToSong.UseVisualStyleBackColor = true; // - // tableLayoutPanel9 - // - this.tableLayoutPanel9.AutoSize = true; - this.tableLayoutPanel9.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel9.ColumnCount = 2; - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.Controls.Add(this.lblLoop, 0, 0); - this.tableLayoutPanel9.Controls.Add(this.checkLoop, 1, 0); - this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel9.Location = new System.Drawing.Point(338, 3); - this.tableLayoutPanel9.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel9.Name = "tableLayoutPanel9"; - this.tableLayoutPanel9.RowCount = 1; - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel9.Size = new System.Drawing.Size(58, 26); - this.tableLayoutPanel9.TabIndex = 6; + // lblSyncToSong // - // lblLoop + this.lblSyncToSong.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblSyncToSong.AutoSize = true; + this.lblSyncToSong.Location = new System.Drawing.Point(198, 0); + this.lblSyncToSong.Name = "lblSyncToSong"; + this.lblSyncToSong.Size = new System.Drawing.Size(75, 29); + this.lblSyncToSong.TabIndex = 5; + this.lblSyncToSong.Text = "Sync To Song"; + this.lblSyncToSong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblSyncToSong, resources.GetString("lblSyncToSong.ToolTip")); // - this.lblLoop.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // checkAddToScript + // + this.checkAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.lblLoop.AutoSize = true; - this.lblLoop.Location = new System.Drawing.Point(3, 0); - this.lblLoop.Name = "lblLoop"; - this.lblLoop.Size = new System.Drawing.Size(31, 26); - this.lblLoop.TabIndex = 1; - this.lblLoop.Text = "Loop"; - this.lblLoop.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblLoop, "On -> The movement script will repeat from the start, if the last move is finishe" + - "d.\r\nOff -> The camera will stay on the end position of the last move."); + this.checkAddToScript.AutoSize = true; + this.checkAddToScript.Location = new System.Drawing.Point(177, 3); + this.checkAddToScript.Name = "checkAddToScript"; + this.checkAddToScript.Size = new System.Drawing.Size(15, 23); + this.checkAddToScript.TabIndex = 4; + this.checkAddToScript.UseVisualStyleBackColor = true; + // + // lblAddToScript + // + this.lblAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.lblAddToScript.AutoSize = true; + this.lblAddToScript.Location = new System.Drawing.Point(61, 0); + this.lblAddToScript.Name = "lblAddToScript"; + this.lblAddToScript.Size = new System.Drawing.Size(110, 29); + this.lblAddToScript.TabIndex = 3; + this.lblAddToScript.Text = "Add To existing Script"; + this.lblAddToScript.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblAddToScript, resources.GetString("lblAddToScript.ToolTip")); // // checkLoop // @@ -333,67 +287,86 @@ private void InitializeComponent() this.checkLoop.CheckState = System.Windows.Forms.CheckState.Checked; this.checkLoop.Location = new System.Drawing.Point(40, 3); this.checkLoop.Name = "checkLoop"; - this.checkLoop.Size = new System.Drawing.Size(15, 20); - this.checkLoop.TabIndex = 1; + this.checkLoop.Size = new System.Drawing.Size(15, 23); + this.checkLoop.TabIndex = 2; this.checkLoop.UseVisualStyleBackColor = true; // - // tableLayoutPanel12 - // - this.tableLayoutPanel12.AutoSize = true; - this.tableLayoutPanel12.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel12.ColumnCount = 2; - this.tableLayoutPanel12.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel12.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel12.Controls.Add(this.lblAddToScript, 0, 0); - this.tableLayoutPanel12.Controls.Add(this.checkAddToScript, 1, 0); - this.tableLayoutPanel12.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel12.Location = new System.Drawing.Point(402, 3); - this.tableLayoutPanel12.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel12.Name = "tableLayoutPanel12"; - this.tableLayoutPanel12.RowCount = 1; - this.tableLayoutPanel12.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel12.Size = new System.Drawing.Size(137, 26); - this.tableLayoutPanel12.TabIndex = 5; - // - // lblAddToScript + // lblLoop // - this.lblAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.lblLoop.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.lblAddToScript.AutoSize = true; - this.lblAddToScript.Location = new System.Drawing.Point(3, 0); - this.lblAddToScript.Name = "lblAddToScript"; - this.lblAddToScript.Size = new System.Drawing.Size(110, 26); - this.lblAddToScript.TabIndex = 1; - this.lblAddToScript.Text = "Add To existing Script"; - this.lblAddToScript.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblAddToScript, resources.GetString("lblAddToScript.ToolTip")); - // - // checkAddToScript + this.lblLoop.AutoSize = true; + this.lblLoop.Location = new System.Drawing.Point(3, 0); + this.lblLoop.Name = "lblLoop"; + this.lblLoop.Size = new System.Drawing.Size(31, 29); + this.lblLoop.TabIndex = 1; + this.lblLoop.Text = "Loop"; + this.lblLoop.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblLoop, "On -> The movement script will repeat from the start, if the last move is finishe" + + "d.\r\nOff -> The camera will stay on the end position of the last move."); // - this.checkAddToScript.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // lblChainTitle + // + this.lblChainTitle.AutoSize = true; + this.lblChainTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblChainTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblChainTitle.Location = new System.Drawing.Point(3, 0); + this.lblChainTitle.Name = "lblChainTitle"; + this.lblChainTitle.Size = new System.Drawing.Size(734, 29); + this.lblChainTitle.TabIndex = 1; + this.lblChainTitle.Text = "Chain"; + this.lblChainTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // flpChainSettings + // + this.flpChainSettings.Controls.Add(this.lblChainName); + this.flpChainSettings.Controls.Add(this.txtChainName); + this.flpChainSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpChainSettings.Location = new System.Drawing.Point(0, 29); + this.flpChainSettings.Margin = new System.Windows.Forms.Padding(0); + this.flpChainSettings.MinimumSize = new System.Drawing.Size(0, 30); + this.flpChainSettings.Name = "flpChainSettings"; + this.flpChainSettings.Size = new System.Drawing.Size(740, 30); + this.flpChainSettings.TabIndex = 2; + // + // lblChainName + // + this.lblChainName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.checkAddToScript.AutoSize = true; - this.checkAddToScript.Location = new System.Drawing.Point(119, 3); - this.checkAddToScript.Name = "checkAddToScript"; - this.checkAddToScript.Size = new System.Drawing.Size(15, 20); - this.checkAddToScript.TabIndex = 1; - this.checkAddToScript.UseVisualStyleBackColor = true; + this.lblChainName.AutoSize = true; + this.lblChainName.Location = new System.Drawing.Point(3, 0); + this.lblChainName.Name = "lblChainName"; + this.lblChainName.Size = new System.Drawing.Size(35, 26); + this.lblChainName.TabIndex = 1; + this.lblChainName.Text = "Name"; + this.lblChainName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblChainName, "defines the name of movement script file that will be generated / added to.\r\nAdd " + + "this name to the script list in your camera script to make the camera use this s" + + "cript.\r\n"); // - // tableLayoutPanel18 - // - this.tableLayoutPanel18.ColumnCount = 2; - this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel18.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); - this.tableLayoutPanel18.Controls.Add(this.tvChain, 0, 0); - this.tableLayoutPanel18.Controls.Add(this.tableLayoutPanel19, 1, 0); - this.tableLayoutPanel18.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel18.Location = new System.Drawing.Point(0, 70); - this.tableLayoutPanel18.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel18.Name = "tableLayoutPanel18"; - this.tableLayoutPanel18.RowCount = 1; - this.tableLayoutPanel18.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel18.Size = new System.Drawing.Size(545, 597); - this.tableLayoutPanel18.TabIndex = 7; + // txtChainName + // + this.txtChainName.Location = new System.Drawing.Point(44, 3); + this.txtChainName.Name = "txtChainName"; + this.txtChainName.Size = new System.Drawing.Size(149, 20); + this.txtChainName.TabIndex = 2; + this.txtChainName.TextChanged += new System.EventHandler(this.txtChainName_TextChanged); + // + // tlpChainTreeAndElementOptions + // + this.tlpChainTreeAndElementOptions.ColumnCount = 2; + this.tlpChainTreeAndElementOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpChainTreeAndElementOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); + this.tlpChainTreeAndElementOptions.Controls.Add(this.tvChain, 0, 0); + this.tlpChainTreeAndElementOptions.Controls.Add(this.tlpElementSelectedOptions, 1, 0); + this.tlpChainTreeAndElementOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpChainTreeAndElementOptions.Location = new System.Drawing.Point(0, 59); + this.tlpChainTreeAndElementOptions.Margin = new System.Windows.Forms.Padding(0); + this.tlpChainTreeAndElementOptions.Name = "tlpChainTreeAndElementOptions"; + this.tlpChainTreeAndElementOptions.RowCount = 1; + this.tlpChainTreeAndElementOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpChainTreeAndElementOptions.Size = new System.Drawing.Size(740, 558); + this.tlpChainTreeAndElementOptions.TabIndex = 3; // // tvChain // @@ -402,72 +375,71 @@ private void InitializeComponent() this.tvChain.HideSelection = false; this.tvChain.Location = new System.Drawing.Point(3, 3); this.tvChain.Name = "tvChain"; - this.tvChain.Size = new System.Drawing.Size(418, 591); - this.tvChain.TabIndex = 7; + this.tvChain.Size = new System.Drawing.Size(613, 552); + this.tvChain.TabIndex = 1; this.tvChain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvChain_AfterSelect); this.tvChain.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvChain_NodeMouseDoubleClick); // - // tableLayoutPanel19 - // - this.tableLayoutPanel19.ColumnCount = 1; - this.tableLayoutPanel19.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel19.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel19.Controls.Add(this.lblElementOptions, 0, 0); - this.tableLayoutPanel19.Controls.Add(this.flowLayoutPanel4, 0, 1); - this.tableLayoutPanel19.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel19.Location = new System.Drawing.Point(424, 0); - this.tableLayoutPanel19.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel19.Name = "tableLayoutPanel19"; - this.tableLayoutPanel19.RowCount = 2; - this.tableLayoutPanel19.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel19.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 90F)); - this.tableLayoutPanel19.Size = new System.Drawing.Size(121, 597); - this.tableLayoutPanel19.TabIndex = 8; - // - // lblElementOptions - // - this.lblElementOptions.AutoSize = true; - this.lblElementOptions.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblElementOptions.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblElementOptions.Location = new System.Drawing.Point(3, 0); - this.lblElementOptions.MaximumSize = new System.Drawing.Size(0, 59); - this.lblElementOptions.Name = "lblElementOptions"; - this.lblElementOptions.Size = new System.Drawing.Size(115, 59); - this.lblElementOptions.TabIndex = 5; - this.lblElementOptions.Text = "Element Options"; - this.lblElementOptions.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // flowLayoutPanel4 - // - this.flowLayoutPanel4.AutoScroll = true; - this.flowLayoutPanel4.Controls.Add(this.tableLayoutPanel20); - this.flowLayoutPanel4.Controls.Add(this.btnElementDuplicate); - this.flowLayoutPanel4.Controls.Add(this.btnElementGetSettings); - this.flowLayoutPanel4.Controls.Add(this.btnElementDelete); - this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel4.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.flowLayoutPanel4.Location = new System.Drawing.Point(0, 59); - this.flowLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); - this.flowLayoutPanel4.Name = "flowLayoutPanel4"; - this.flowLayoutPanel4.Size = new System.Drawing.Size(121, 538); - this.flowLayoutPanel4.TabIndex = 6; - this.flowLayoutPanel4.WrapContents = false; - // - // tableLayoutPanel20 - // - this.tableLayoutPanel20.ColumnCount = 2; - this.tableLayoutPanel20.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel20.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel20.Controls.Add(this.btnElementMoveDown, 1, 0); - this.tableLayoutPanel20.Controls.Add(this.btnElementMoveUp, 0, 0); - this.tableLayoutPanel20.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel20.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel20.Name = "tableLayoutPanel20"; - this.tableLayoutPanel20.RowCount = 1; - this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel20.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel20.Size = new System.Drawing.Size(121, 32); - this.tableLayoutPanel20.TabIndex = 2; + // tlpElementSelectedOptions + // + this.tlpElementSelectedOptions.ColumnCount = 1; + this.tlpElementSelectedOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSelectedOptions.Controls.Add(this.lblElementSelectedOptions, 0, 0); + this.tlpElementSelectedOptions.Controls.Add(this.flpElementSelectedOptions, 0, 1); + this.tlpElementSelectedOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpElementSelectedOptions.Location = new System.Drawing.Point(619, 0); + this.tlpElementSelectedOptions.Margin = new System.Windows.Forms.Padding(0); + this.tlpElementSelectedOptions.Name = "tlpElementSelectedOptions"; + this.tlpElementSelectedOptions.RowCount = 2; + this.tlpElementSelectedOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F)); + this.tlpElementSelectedOptions.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSelectedOptions.Size = new System.Drawing.Size(121, 558); + this.tlpElementSelectedOptions.TabIndex = 2; + // + // lblElementSelectedOptions + // + this.lblElementSelectedOptions.AutoSize = true; + this.lblElementSelectedOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblElementSelectedOptions.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblElementSelectedOptions.Location = new System.Drawing.Point(3, 0); + this.lblElementSelectedOptions.MaximumSize = new System.Drawing.Size(0, 59); + this.lblElementSelectedOptions.Name = "lblElementSelectedOptions"; + this.lblElementSelectedOptions.Size = new System.Drawing.Size(115, 50); + this.lblElementSelectedOptions.TabIndex = 1; + this.lblElementSelectedOptions.Text = "Element Options"; + this.lblElementSelectedOptions.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // flpElementSelectedOptions + // + this.flpElementSelectedOptions.AutoScroll = true; + this.flpElementSelectedOptions.Controls.Add(this.tlpElementSelectedOptionMoveUpAndDown); + this.flpElementSelectedOptions.Controls.Add(this.btnElementDuplicate); + this.flpElementSelectedOptions.Controls.Add(this.btnElementGetSettings); + this.flpElementSelectedOptions.Controls.Add(this.btnElementDelete); + this.flpElementSelectedOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpElementSelectedOptions.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flpElementSelectedOptions.Location = new System.Drawing.Point(0, 50); + this.flpElementSelectedOptions.Margin = new System.Windows.Forms.Padding(0); + this.flpElementSelectedOptions.Name = "flpElementSelectedOptions"; + this.flpElementSelectedOptions.Size = new System.Drawing.Size(121, 508); + this.flpElementSelectedOptions.TabIndex = 2; + this.flpElementSelectedOptions.WrapContents = false; + // + // tlpElementSelectedOptionMoveUpAndDown + // + this.tlpElementSelectedOptionMoveUpAndDown.ColumnCount = 2; + this.tlpElementSelectedOptionMoveUpAndDown.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tlpElementSelectedOptionMoveUpAndDown.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tlpElementSelectedOptionMoveUpAndDown.Controls.Add(this.btnElementMoveDown, 1, 0); + this.tlpElementSelectedOptionMoveUpAndDown.Controls.Add(this.btnElementMoveUp, 0, 0); + this.tlpElementSelectedOptionMoveUpAndDown.Location = new System.Drawing.Point(0, 0); + this.tlpElementSelectedOptionMoveUpAndDown.Margin = new System.Windows.Forms.Padding(0); + this.tlpElementSelectedOptionMoveUpAndDown.Name = "tlpElementSelectedOptionMoveUpAndDown"; + this.tlpElementSelectedOptionMoveUpAndDown.RowCount = 1; + this.tlpElementSelectedOptionMoveUpAndDown.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSelectedOptionMoveUpAndDown.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.tlpElementSelectedOptionMoveUpAndDown.Size = new System.Drawing.Size(121, 32); + this.tlpElementSelectedOptionMoveUpAndDown.TabIndex = 1; // // btnElementMoveDown // @@ -477,7 +449,7 @@ private void InitializeComponent() this.btnElementMoveDown.Location = new System.Drawing.Point(63, 3); this.btnElementMoveDown.Name = "btnElementMoveDown"; this.btnElementMoveDown.Size = new System.Drawing.Size(55, 26); - this.btnElementMoveDown.TabIndex = 1; + this.btnElementMoveDown.TabIndex = 2; this.btnElementMoveDown.Text = "↓"; this.btnElementMoveDown.UseVisualStyleBackColor = true; this.btnElementMoveDown.Click += new System.EventHandler(this.btnElementMoveDown_Click); @@ -490,7 +462,7 @@ private void InitializeComponent() this.btnElementMoveUp.Location = new System.Drawing.Point(3, 3); this.btnElementMoveUp.Name = "btnElementMoveUp"; this.btnElementMoveUp.Size = new System.Drawing.Size(54, 26); - this.btnElementMoveUp.TabIndex = 0; + this.btnElementMoveUp.TabIndex = 1; this.btnElementMoveUp.Text = "↑"; this.btnElementMoveUp.UseVisualStyleBackColor = true; this.btnElementMoveUp.Click += new System.EventHandler(this.btnElementMoveUp_Click); @@ -504,7 +476,7 @@ private void InitializeComponent() this.btnElementDuplicate.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementDuplicate.Name = "btnElementDuplicate"; this.btnElementDuplicate.Size = new System.Drawing.Size(115, 23); - this.btnElementDuplicate.TabIndex = 3; + this.btnElementDuplicate.TabIndex = 2; this.btnElementDuplicate.Text = "Duplicate"; this.btnElementDuplicate.UseVisualStyleBackColor = true; this.btnElementDuplicate.Click += new System.EventHandler(this.btnElementDuplicate_Click); @@ -518,28 +490,11 @@ private void InitializeComponent() this.btnElementGetSettings.MinimumSize = new System.Drawing.Size(115, 0); this.btnElementGetSettings.Name = "btnElementGetSettings"; this.btnElementGetSettings.Size = new System.Drawing.Size(115, 23); - this.btnElementGetSettings.TabIndex = 5; + this.btnElementGetSettings.TabIndex = 3; this.btnElementGetSettings.Text = "Get Settings"; this.btnElementGetSettings.UseVisualStyleBackColor = true; this.btnElementGetSettings.Click += new System.EventHandler(this.btnElementGetSettings_Click); // - // btnElementApplySettings - // - this.btnElementApplySettings.AutoSize = true; - this.btnElementApplySettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnElementApplySettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnElementApplySettings.Enabled = false; - this.btnElementApplySettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnElementApplySettings.Location = new System.Drawing.Point(45, 3); - this.btnElementApplySettings.MinimumSize = new System.Drawing.Size(0, 26); - this.btnElementApplySettings.Name = "btnElementApplySettings"; - this.btnElementApplySettings.Size = new System.Drawing.Size(43, 26); - this.btnElementApplySettings.TabIndex = 6; - this.btnElementApplySettings.Text = "Apply"; - this.ToolTip.SetToolTip(this.btnElementApplySettings, "Applies the current settings to the selected element."); - this.btnElementApplySettings.UseVisualStyleBackColor = true; - this.btnElementApplySettings.Click += new System.EventHandler(this.btnElementApplySettings_Click); - // // btnElementDelete // this.btnElementDelete.Dock = System.Windows.Forms.DockStyle.Fill; @@ -554,110 +509,39 @@ private void InitializeComponent() this.btnElementDelete.UseVisualStyleBackColor = true; this.btnElementDelete.Click += new System.EventHandler(this.btnElementDelete_Click); // - // tableLayoutPanel21 - // - this.tableLayoutPanel21.ColumnCount = 4; - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 64F)); - this.tableLayoutPanel21.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 121F)); - this.tableLayoutPanel21.Controls.Add(this.btnGenerateScript, 3, 0); - this.tableLayoutPanel21.Controls.Add(this.txtPath, 1, 0); - this.tableLayoutPanel21.Controls.Add(this.lblPath, 0, 0); - this.tableLayoutPanel21.Controls.Add(this.btnEditPath, 2, 0); - this.tableLayoutPanel21.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel21.Location = new System.Drawing.Point(0, 667); - this.tableLayoutPanel21.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel21.Name = "tableLayoutPanel21"; - this.tableLayoutPanel21.RowCount = 1; - this.tableLayoutPanel21.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel21.Size = new System.Drawing.Size(545, 36); - this.tableLayoutPanel21.TabIndex = 8; - // - // btnEditPath - // - this.btnEditPath.AutoSize = true; - this.btnEditPath.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnEditPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnEditPath.Location = new System.Drawing.Point(363, 3); - this.btnEditPath.Name = "btnEditPath"; - this.btnEditPath.Size = new System.Drawing.Size(58, 30); - this.btnEditPath.TabIndex = 2; - this.btnEditPath.Text = "Edit Path"; - this.btnEditPath.UseVisualStyleBackColor = true; - this.btnEditPath.Click += new System.EventHandler(this.btnEditPath_Click); - // - // txtPath - // - this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtPath.Location = new System.Drawing.Point(40, 0); - this.txtPath.Margin = new System.Windows.Forms.Padding(0); - this.txtPath.Multiline = true; - this.txtPath.Name = "txtPath"; - this.txtPath.ReadOnly = true; - this.txtPath.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; - this.txtPath.Size = new System.Drawing.Size(320, 36); - this.txtPath.TabIndex = 1; - this.txtPath.Text = "C:\\Program Files\\Steam\\steamapps\\common\\Beat Saber\\UserData\\Camera2\\MovementScrip" + - "ts"; - this.txtPath.WordWrap = false; - // - // btnGenerateScript - // - this.btnGenerateScript.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnGenerateScript.Location = new System.Drawing.Point(427, 3); - this.btnGenerateScript.Name = "btnGenerateScript"; - this.btnGenerateScript.Size = new System.Drawing.Size(115, 30); - this.btnGenerateScript.TabIndex = 1; - this.btnGenerateScript.Text = "Generate Script"; - this.btnGenerateScript.UseVisualStyleBackColor = true; - this.btnGenerateScript.Click += new System.EventHandler(this.btnGenerateScript_Click); - // - // lblPath - // - this.lblPath.AutoSize = true; - this.lblPath.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblPath.Location = new System.Drawing.Point(3, 0); - this.lblPath.Name = "lblPath"; - this.lblPath.Size = new System.Drawing.Size(34, 36); - this.lblPath.TabIndex = 0; - this.lblPath.Text = "Path:"; - this.lblPath.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.ToolTip.SetToolTip(this.lblPath, resources.GetString("lblPath.ToolTip")); - // - // tableLayoutPanel16 - // - this.tableLayoutPanel16.ColumnCount = 1; - this.tableLayoutPanel16.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel16.Controls.Add(this.flowLayoutPanel3, 0, 3); - this.tableLayoutPanel16.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel16.Controls.Add(this.flpContent, 0, 2); - this.tableLayoutPanel16.Controls.Add(this.flowLayoutPanel2, 0, 1); - this.tableLayoutPanel16.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel16.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel16.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); - this.tableLayoutPanel16.Name = "tableLayoutPanel16"; - this.tableLayoutPanel16.RowCount = 4; - this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F)); - this.tableLayoutPanel16.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5F)); - this.tableLayoutPanel16.Size = new System.Drawing.Size(297, 703); - this.tableLayoutPanel16.TabIndex = 5; - // - // flowLayoutPanel3 - // - this.flowLayoutPanel3.Controls.Add(this.btnAddMoveToChain); - this.flowLayoutPanel3.Controls.Add(this.btnElementApplySettings); - this.flowLayoutPanel3.Controls.Add(this.btnInsert); - this.flowLayoutPanel3.Controls.Add(this.btnResetMoveSettings); - this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel3.Location = new System.Drawing.Point(0, 667); - this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); - this.flowLayoutPanel3.MinimumSize = new System.Drawing.Size(0, 30); - this.flowLayoutPanel3.Name = "flowLayoutPanel3"; - this.flowLayoutPanel3.Size = new System.Drawing.Size(297, 36); - this.flowLayoutPanel3.TabIndex = 7; + // tlpElementSettings + // + this.tlpElementSettings.ColumnCount = 1; + this.tlpElementSettings.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSettings.Controls.Add(this.flpElementOptions, 0, 3); + this.tlpElementSettings.Controls.Add(this.lblElementTitle, 0, 0); + this.tlpElementSettings.Controls.Add(this.flpContent, 0, 2); + this.tlpElementSettings.Controls.Add(this.flpElementGeneralSettings, 0, 1); + this.tlpElementSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpElementSettings.Location = new System.Drawing.Point(0, 0); + this.tlpElementSettings.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.tlpElementSettings.Name = "tlpElementSettings"; + this.tlpElementSettings.RowCount = 4; + this.tlpElementSettings.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpElementSettings.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpElementSettings.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSettings.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpElementSettings.Size = new System.Drawing.Size(307, 648); + this.tlpElementSettings.TabIndex = 1; + // + // flpElementOptions + // + this.flpElementOptions.Controls.Add(this.btnAddMoveToChain); + this.flpElementOptions.Controls.Add(this.btnElementApplySettings); + this.flpElementOptions.Controls.Add(this.btnInsert); + this.flpElementOptions.Controls.Add(this.btnResetMoveSettings); + this.flpElementOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpElementOptions.Location = new System.Drawing.Point(0, 617); + this.flpElementOptions.Margin = new System.Windows.Forms.Padding(0); + this.flpElementOptions.MinimumSize = new System.Drawing.Size(0, 30); + this.flpElementOptions.Name = "flpElementOptions"; + this.flpElementOptions.Size = new System.Drawing.Size(307, 31); + this.flpElementOptions.TabIndex = 4; // // btnAddMoveToChain // @@ -669,11 +553,28 @@ private void InitializeComponent() this.btnAddMoveToChain.MinimumSize = new System.Drawing.Size(0, 26); this.btnAddMoveToChain.Name = "btnAddMoveToChain"; this.btnAddMoveToChain.Size = new System.Drawing.Size(36, 26); - this.btnAddMoveToChain.TabIndex = 2; + this.btnAddMoveToChain.TabIndex = 1; this.btnAddMoveToChain.Text = "Add"; this.ToolTip.SetToolTip(this.btnAddMoveToChain, "Adds a new element to the chain with the current settings."); this.btnAddMoveToChain.UseVisualStyleBackColor = true; - this.btnAddMoveToChain.Click += new System.EventHandler(this.btnAddMoveToChain_Click); + this.btnAddMoveToChain.Click += new System.EventHandler(this.btnAddElementToChain_Click); + // + // btnElementApplySettings + // + this.btnElementApplySettings.AutoSize = true; + this.btnElementApplySettings.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnElementApplySettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnElementApplySettings.Enabled = false; + this.btnElementApplySettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnElementApplySettings.Location = new System.Drawing.Point(45, 3); + this.btnElementApplySettings.MinimumSize = new System.Drawing.Size(0, 26); + this.btnElementApplySettings.Name = "btnElementApplySettings"; + this.btnElementApplySettings.Size = new System.Drawing.Size(43, 26); + this.btnElementApplySettings.TabIndex = 2; + this.btnElementApplySettings.Text = "Apply"; + this.ToolTip.SetToolTip(this.btnElementApplySettings, "Applies the current settings to the selected element."); + this.btnElementApplySettings.UseVisualStyleBackColor = true; + this.btnElementApplySettings.Click += new System.EventHandler(this.btnElementApplySettings_Click); // // btnInsert // @@ -686,7 +587,7 @@ private void InitializeComponent() this.btnInsert.MinimumSize = new System.Drawing.Size(0, 26); this.btnInsert.Name = "btnInsert"; this.btnInsert.Size = new System.Drawing.Size(43, 26); - this.btnInsert.TabIndex = 4; + this.btnInsert.TabIndex = 3; this.btnInsert.Text = "Insert"; this.ToolTip.SetToolTip(this.btnInsert, "Inserts a new element into the chain after the selected element"); this.btnInsert.UseVisualStyleBackColor = true; @@ -701,226 +602,142 @@ private void InitializeComponent() this.btnResetMoveSettings.MinimumSize = new System.Drawing.Size(0, 26); this.btnResetMoveSettings.Name = "btnResetMoveSettings"; this.btnResetMoveSettings.Size = new System.Drawing.Size(45, 26); - this.btnResetMoveSettings.TabIndex = 3; + this.btnResetMoveSettings.TabIndex = 4; this.btnResetMoveSettings.Text = "Reset"; this.ToolTip.SetToolTip(this.btnResetMoveSettings, "Resets the currently selected move settings to their default values."); this.btnResetMoveSettings.UseVisualStyleBackColor = true; this.btnResetMoveSettings.Click += new System.EventHandler(this.btnResetMoveControl_Click); // - // label1 + // lblElementTitle // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(3, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(291, 35); - this.label1.TabIndex = 4; - this.label1.Text = "Move"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lblElementTitle.AutoSize = true; + this.lblElementTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblElementTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblElementTitle.Location = new System.Drawing.Point(3, 0); + this.lblElementTitle.Name = "lblElementTitle"; + this.lblElementTitle.Size = new System.Drawing.Size(301, 29); + this.lblElementTitle.TabIndex = 1; + this.lblElementTitle.Text = "Element"; + this.lblElementTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // flpContent // this.flpContent.AutoScroll = true; - this.flpContent.Controls.Add(this.tableLayoutPanel5); - this.flpContent.Controls.Add(this.tableLayoutPanel3); - this.flpContent.Controls.Add(this.tableLayoutPanel7); - this.flpContent.Controls.Add(this.tableLayoutPanel6); - this.flpContent.Controls.Add(this.tableLayoutPanel8); - this.flpContent.Controls.Add(this.tlContent); + this.flpContent.Controls.Add(this.lblElementDescriptionTitle); + this.flpContent.Controls.Add(this.lblElementDescription); + this.flpContent.Controls.Add(this.lblElementSettingsTitle); + this.flpContent.Controls.Add(this.lblElementDescriptionHint); + this.flpContent.Controls.Add(this.tlpContent); this.flpContent.Dock = System.Windows.Forms.DockStyle.Fill; this.flpContent.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.flpContent.Location = new System.Drawing.Point(0, 70); + this.flpContent.Location = new System.Drawing.Point(0, 59); this.flpContent.Margin = new System.Windows.Forms.Padding(0); this.flpContent.Name = "flpContent"; - this.flpContent.Size = new System.Drawing.Size(297, 597); + this.flpContent.Size = new System.Drawing.Size(307, 558); this.flpContent.TabIndex = 3; this.flpContent.WrapContents = false; // - // tableLayoutPanel5 - // - this.tableLayoutPanel5.ColumnCount = 2; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 45.29617F)); - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 54.70383F)); - this.tableLayoutPanel5.Controls.Add(this.lblMoveDescriptionTitle, 0, 0); - this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel5.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - this.tableLayoutPanel5.RowCount = 1; - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(284, 26); - this.tableLayoutPanel5.TabIndex = 28; - // - // lblMoveDescriptionTitle - // - this.lblMoveDescriptionTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // lblElementDescriptionTitle + // + this.lblElementDescriptionTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblMoveDescriptionTitle.AutoSize = true; - this.lblMoveDescriptionTitle.Location = new System.Drawing.Point(3, 0); - this.lblMoveDescriptionTitle.Name = "lblMoveDescriptionTitle"; - this.lblMoveDescriptionTitle.Size = new System.Drawing.Size(122, 13); - this.lblMoveDescriptionTitle.TabIndex = 24; - this.lblMoveDescriptionTitle.Text = "Move Description:"; - // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel3.AutoSize = true; - this.tableLayoutPanel3.ColumnCount = 2; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 35); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 1; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 1F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(284, 0); - this.tableLayoutPanel3.TabIndex = 13; - // - // tableLayoutPanel7 - // - this.tableLayoutPanel7.AutoSize = true; - this.tableLayoutPanel7.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel7.ColumnCount = 1; - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel7.Controls.Add(this.lblMoveDescription, 0, 0); - this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 41); - this.tableLayoutPanel7.MaximumSize = new System.Drawing.Size(285, 0); - this.tableLayoutPanel7.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel7.Name = "tableLayoutPanel7"; - this.tableLayoutPanel7.RowCount = 1; - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.Size = new System.Drawing.Size(284, 26); - this.tableLayoutPanel7.TabIndex = 31; - // - // lblMoveDescription - // - this.lblMoveDescription.AutoSize = true; - this.lblMoveDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblMoveDescription.Location = new System.Drawing.Point(3, 0); - this.lblMoveDescription.MaximumSize = new System.Drawing.Size(290, 0); - this.lblMoveDescription.Name = "lblMoveDescription"; - this.lblMoveDescription.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10); - this.lblMoveDescription.Size = new System.Drawing.Size(278, 26); - this.lblMoveDescription.TabIndex = 25; - this.lblMoveDescription.Text = "Description Placeholder"; - // - // tableLayoutPanel6 - // - this.tableLayoutPanel6.ColumnCount = 2; - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); - this.tableLayoutPanel6.Controls.Add(this.lblSettingsTitle, 0, 0); - this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 73); - this.tableLayoutPanel6.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel6.Name = "tableLayoutPanel6"; - this.tableLayoutPanel6.RowCount = 1; - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel6.Size = new System.Drawing.Size(284, 26); - this.tableLayoutPanel6.TabIndex = 29; - // - // lblSettingsTitle - // - this.lblSettingsTitle.AutoSize = true; - this.lblSettingsTitle.Location = new System.Drawing.Point(3, 0); - this.lblSettingsTitle.Name = "lblSettingsTitle"; - this.lblSettingsTitle.Size = new System.Drawing.Size(48, 13); - this.lblSettingsTitle.TabIndex = 3; - this.lblSettingsTitle.Text = "Settings:"; - // - // tableLayoutPanel8 - // - this.tableLayoutPanel8.ColumnCount = 1; - this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel8.Controls.Add(this.lblDescription, 0, 0); - this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 105); - this.tableLayoutPanel8.MaximumSize = new System.Drawing.Size(285, 0); - this.tableLayoutPanel8.MinimumSize = new System.Drawing.Size(0, 26); - this.tableLayoutPanel8.Name = "tableLayoutPanel8"; - this.tableLayoutPanel8.RowCount = 1; - this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel8.Size = new System.Drawing.Size(284, 26); - this.tableLayoutPanel8.TabIndex = 32; - // - // lblDescription - // - this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblDescription.Location = new System.Drawing.Point(3, 0); - this.lblDescription.Name = "lblDescription"; - this.lblDescription.Size = new System.Drawing.Size(278, 26); - this.lblDescription.TabIndex = 11; - this.lblDescription.Text = "Descriptions to the settings can be found when hovering over the corresponding la" + + this.lblElementDescriptionTitle.AutoSize = true; + this.lblElementDescriptionTitle.Location = new System.Drawing.Point(3, 0); + this.lblElementDescriptionTitle.Name = "lblElementDescriptionTitle"; + this.lblElementDescriptionTitle.Size = new System.Drawing.Size(284, 13); + this.lblElementDescriptionTitle.TabIndex = 1; + this.lblElementDescriptionTitle.Text = "Description:"; + // + // lblElementDescription + // + this.lblElementDescription.AutoSize = true; + this.lblElementDescription.Location = new System.Drawing.Point(3, 13); + this.lblElementDescription.MaximumSize = new System.Drawing.Size(280, 0); + this.lblElementDescription.Name = "lblElementDescription"; + this.lblElementDescription.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10); + this.lblElementDescription.Size = new System.Drawing.Size(119, 23); + this.lblElementDescription.TabIndex = 2; + this.lblElementDescription.Text = "Description Placeholder"; + // + // lblElementSettingsTitle + // + this.lblElementSettingsTitle.AutoSize = true; + this.lblElementSettingsTitle.Location = new System.Drawing.Point(3, 36); + this.lblElementSettingsTitle.Name = "lblElementSettingsTitle"; + this.lblElementSettingsTitle.Size = new System.Drawing.Size(48, 13); + this.lblElementSettingsTitle.TabIndex = 3; + this.lblElementSettingsTitle.Text = "Settings:"; + // + // lblElementDescriptionHint + // + this.lblElementDescriptionHint.Location = new System.Drawing.Point(3, 49); + this.lblElementDescriptionHint.Name = "lblElementDescriptionHint"; + this.lblElementDescriptionHint.Size = new System.Drawing.Size(280, 26); + this.lblElementDescriptionHint.TabIndex = 4; + this.lblElementDescriptionHint.Text = "Descriptions to the settings can be found when hovering over the corresponding la" + "bels.\r\n"; // - // tlContent - // - this.tlContent.AutoSize = true; - this.tlContent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tlContent.ColumnCount = 1; - this.tlContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tlContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlContent.Location = new System.Drawing.Point(0, 134); - this.tlContent.Margin = new System.Windows.Forms.Padding(0); - this.tlContent.MaximumSize = new System.Drawing.Size(295, 0); - this.tlContent.MinimumSize = new System.Drawing.Size(290, 100); - this.tlContent.Name = "tlContent"; - this.tlContent.RowCount = 1; - this.tlContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); - this.tlContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); - this.tlContent.Size = new System.Drawing.Size(290, 100); - this.tlContent.TabIndex = 3; - // - // flowLayoutPanel2 - // - this.flowLayoutPanel2.Controls.Add(this.tableLayoutPanel4); - this.flowLayoutPanel2.Controls.Add(this.tableLayoutPanel17); - this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 35); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); - this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Size = new System.Drawing.Size(297, 35); - this.flowLayoutPanel2.TabIndex = 5; - // - // tableLayoutPanel4 - // - this.tableLayoutPanel4.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel4.ColumnCount = 2; - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel4.Controls.Add(this.cbType, 1, 0); - this.tableLayoutPanel4.Controls.Add(this.lblType, 0, 0); - this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel4.MinimumSize = new System.Drawing.Size(0, 30); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 1; - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.Size = new System.Drawing.Size(135, 30); - this.tableLayoutPanel4.TabIndex = 1; - // - // cbType - // - this.cbType.Dock = System.Windows.Forms.DockStyle.Fill; - this.cbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbType.FormattingEnabled = true; - this.cbType.Items.AddRange(new object[] { + // tlpContent + // + this.tlpContent.AutoSize = true; + this.tlpContent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tlpContent.ColumnCount = 1; + this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpContent.Location = new System.Drawing.Point(0, 75); + this.tlpContent.Margin = new System.Windows.Forms.Padding(0); + this.tlpContent.MaximumSize = new System.Drawing.Size(295, 0); + this.tlpContent.MinimumSize = new System.Drawing.Size(290, 100); + this.tlpContent.Name = "tlpContent"; + this.tlpContent.RowCount = 1; + this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tlpContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tlpContent.Size = new System.Drawing.Size(290, 100); + this.tlpContent.TabIndex = 5; + // + // flpElementGeneralSettings + // + this.flpElementGeneralSettings.Controls.Add(this.tlpElementSettingType); + this.flpElementGeneralSettings.Controls.Add(this.tlpElementSettingName); + this.flpElementGeneralSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpElementGeneralSettings.Location = new System.Drawing.Point(0, 29); + this.flpElementGeneralSettings.Margin = new System.Windows.Forms.Padding(0); + this.flpElementGeneralSettings.Name = "flpElementGeneralSettings"; + this.flpElementGeneralSettings.Size = new System.Drawing.Size(307, 30); + this.flpElementGeneralSettings.TabIndex = 2; + // + // tlpElementSettingType + // + this.tlpElementSettingType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tlpElementSettingType.ColumnCount = 2; + this.tlpElementSettingType.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpElementSettingType.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpElementSettingType.Controls.Add(this.cbElementType, 1, 0); + this.tlpElementSettingType.Controls.Add(this.lblType, 0, 0); + this.tlpElementSettingType.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpElementSettingType.Location = new System.Drawing.Point(3, 3); + this.tlpElementSettingType.MinimumSize = new System.Drawing.Size(0, 30); + this.tlpElementSettingType.Name = "tlpElementSettingType"; + this.tlpElementSettingType.RowCount = 1; + this.tlpElementSettingType.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSettingType.Size = new System.Drawing.Size(135, 30); + this.tlpElementSettingType.TabIndex = 1; + // + // cbElementType + // + this.cbElementType.Dock = System.Windows.Forms.DockStyle.Fill; + this.cbElementType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbElementType.FormattingEnabled = true; + this.cbElementType.Items.AddRange(new object[] { "circle around player"}); - this.cbType.Location = new System.Drawing.Point(43, 3); - this.cbType.Name = "cbType"; - this.cbType.Size = new System.Drawing.Size(90, 21); - this.cbType.TabIndex = 1; - this.cbType.SelectedIndexChanged += new System.EventHandler(this.cbType_SelectedIndexChanged); + this.cbElementType.Location = new System.Drawing.Point(43, 3); + this.cbElementType.Name = "cbElementType"; + this.cbElementType.Size = new System.Drawing.Size(90, 21); + this.cbElementType.TabIndex = 2; + this.cbElementType.SelectedIndexChanged += new System.EventHandler(this.cbElementType_SelectedIndexChanged); // // lblType // @@ -931,31 +748,32 @@ private void InitializeComponent() this.lblType.Size = new System.Drawing.Size(34, 30); this.lblType.TabIndex = 1; this.lblType.Text = "Type:"; - this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tableLayoutPanel17 - // - this.tableLayoutPanel17.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel17.ColumnCount = 2; - this.tableLayoutPanel17.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel17.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel17.Controls.Add(this.txtMoveName, 0, 0); - this.tableLayoutPanel17.Controls.Add(this.lblMoveName, 0, 0); - this.tableLayoutPanel17.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel17.Location = new System.Drawing.Point(144, 3); - this.tableLayoutPanel17.MinimumSize = new System.Drawing.Size(0, 30); - this.tableLayoutPanel17.Name = "tableLayoutPanel17"; - this.tableLayoutPanel17.RowCount = 1; - this.tableLayoutPanel17.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel17.Size = new System.Drawing.Size(150, 30); - this.tableLayoutPanel17.TabIndex = 2; - // - // txtMoveName - // - this.txtMoveName.Location = new System.Drawing.Point(47, 3); - this.txtMoveName.Name = "txtMoveName"; - this.txtMoveName.Size = new System.Drawing.Size(102, 20); - this.txtMoveName.TabIndex = 2; + this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblType, resources.GetString("lblType.ToolTip")); + // + // tlpElementSettingName + // + this.tlpElementSettingName.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tlpElementSettingName.ColumnCount = 2; + this.tlpElementSettingName.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpElementSettingName.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpElementSettingName.Controls.Add(this.txtElementName, 0, 0); + this.tlpElementSettingName.Controls.Add(this.lblMoveName, 0, 0); + this.tlpElementSettingName.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpElementSettingName.Location = new System.Drawing.Point(144, 3); + this.tlpElementSettingName.MinimumSize = new System.Drawing.Size(0, 30); + this.tlpElementSettingName.Name = "tlpElementSettingName"; + this.tlpElementSettingName.RowCount = 1; + this.tlpElementSettingName.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpElementSettingName.Size = new System.Drawing.Size(150, 30); + this.tlpElementSettingName.TabIndex = 2; + // + // txtElementName + // + this.txtElementName.Location = new System.Drawing.Point(47, 3); + this.txtElementName.Name = "txtElementName"; + this.txtElementName.Size = new System.Drawing.Size(102, 20); + this.txtElementName.TabIndex = 2; // // lblMoveName // @@ -966,7 +784,57 @@ private void InitializeComponent() this.lblMoveName.Size = new System.Drawing.Size(38, 30); this.lblMoveName.TabIndex = 1; this.lblMoveName.Text = "Name:"; - this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // menuStrip1 + // + this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripFileOptions}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(45, 20); + this.menuStrip1.TabIndex = 8; + this.menuStrip1.Text = "menuStrip1"; + // + // toolStripFileOptions + // + this.toolStripFileOptions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem}); + this.toolStripFileOptions.Name = "toolStripFileOptions"; + this.toolStripFileOptions.Size = new System.Drawing.Size(37, 16); + this.toolStripFileOptions.Text = "File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.newToolStripMenuItem.Text = "New"; + this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.openToolStripMenuItem.Text = "Open"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.saveToolStripMenuItem.Text = "Save"; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.saveAsToolStripMenuItem.Text = "Save As"; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // ToolTip // @@ -975,122 +843,125 @@ private void InitializeComponent() this.ToolTip.IsBalloon = true; this.ToolTip.ReshowDelay = 100; // + // tlpMenuAndContent + // + this.tlpMenuAndContent.ColumnCount = 1; + this.tlpMenuAndContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpMenuAndContent.Controls.Add(this.menuStrip1, 0, 0); + this.tlpMenuAndContent.Controls.Add(this.tlpContentAndMargin, 0, 1); + this.tlpMenuAndContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpMenuAndContent.Location = new System.Drawing.Point(0, 0); + this.tlpMenuAndContent.Margin = new System.Windows.Forms.Padding(0); + this.tlpMenuAndContent.Name = "tlpMenuAndContent"; + this.tlpMenuAndContent.RowCount = 2; + this.tlpMenuAndContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpMenuAndContent.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpMenuAndContent.Size = new System.Drawing.Size(1105, 715); + this.tlpMenuAndContent.TabIndex = 1; + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(894, 811); - this.Controls.Add(this.tableLayoutPanel1); + this.ClientSize = new System.Drawing.Size(1105, 715); + this.Controls.Add(this.tlpMenuAndContent); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(910, 100); + this.MainMenuStrip = this.menuStrip1; + this.MinimumSize = new System.Drawing.Size(1121, 100); this.Name = "Main"; this.Text = "MovementScriptGenerator"; - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.tableLayoutPanel13.ResumeLayout(false); - this.tableLayoutPanel14.ResumeLayout(false); - this.tableLayoutPanel14.PerformLayout(); - this.flowLayoutPanel1.ResumeLayout(false); - this.flowLayoutPanel1.PerformLayout(); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel10.ResumeLayout(false); - this.tableLayoutPanel10.PerformLayout(); - this.tableLayoutPanel9.ResumeLayout(false); - this.tableLayoutPanel9.PerformLayout(); - this.tableLayoutPanel12.ResumeLayout(false); - this.tableLayoutPanel12.PerformLayout(); - this.tableLayoutPanel18.ResumeLayout(false); - this.tableLayoutPanel19.ResumeLayout(false); - this.tableLayoutPanel19.PerformLayout(); - this.flowLayoutPanel4.ResumeLayout(false); - this.tableLayoutPanel20.ResumeLayout(false); - this.tableLayoutPanel21.ResumeLayout(false); - this.tableLayoutPanel21.PerformLayout(); - this.tableLayoutPanel16.ResumeLayout(false); - this.tableLayoutPanel16.PerformLayout(); - this.flowLayoutPanel3.ResumeLayout(false); - this.flowLayoutPanel3.PerformLayout(); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); + this.tlpContentAndMargin.ResumeLayout(false); + this.tlpElementSettingsAndChainSettings.ResumeLayout(false); + this.tlpChain.ResumeLayout(false); + this.tlpChain.PerformLayout(); + this.flpScriptOptions.ResumeLayout(false); + this.flpScriptOptions.PerformLayout(); + this.flpChainSettings.ResumeLayout(false); + this.flpChainSettings.PerformLayout(); + this.tlpChainTreeAndElementOptions.ResumeLayout(false); + this.tlpElementSelectedOptions.ResumeLayout(false); + this.tlpElementSelectedOptions.PerformLayout(); + this.flpElementSelectedOptions.ResumeLayout(false); + this.tlpElementSelectedOptionMoveUpAndDown.ResumeLayout(false); + this.tlpElementSettings.ResumeLayout(false); + this.tlpElementSettings.PerformLayout(); + this.flpElementOptions.ResumeLayout(false); + this.flpElementOptions.PerformLayout(); this.flpContent.ResumeLayout(false); this.flpContent.PerformLayout(); - this.tableLayoutPanel5.ResumeLayout(false); - this.tableLayoutPanel5.PerformLayout(); - this.tableLayoutPanel7.ResumeLayout(false); - this.tableLayoutPanel7.PerformLayout(); - this.tableLayoutPanel6.ResumeLayout(false); - this.tableLayoutPanel6.PerformLayout(); - this.tableLayoutPanel8.ResumeLayout(false); - this.flowLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel4.ResumeLayout(false); - this.tableLayoutPanel4.PerformLayout(); - this.tableLayoutPanel17.ResumeLayout(false); - this.tableLayoutPanel17.PerformLayout(); + this.flpElementGeneralSettings.ResumeLayout(false); + this.tlpElementSettingType.ResumeLayout(false); + this.tlpElementSettingType.PerformLayout(); + this.tlpElementSettingName.ResumeLayout(false); + this.tlpElementSettingName.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.tlpMenuAndContent.ResumeLayout(false); + this.tlpMenuAndContent.PerformLayout(); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.TableLayoutPanel tlpContentAndMargin; private System.Windows.Forms.FlowLayoutPanel flpContent; private System.Windows.Forms.Label lblType; - private System.Windows.Forms.ComboBox cbType; - private System.Windows.Forms.Label lblSettingsTitle; + private System.Windows.Forms.ComboBox cbElementType; + private System.Windows.Forms.Label lblElementSettingsTitle; private System.Windows.Forms.ToolTip ToolTip; - private System.Windows.Forms.Label lblFileName; - private System.Windows.Forms.TextBox txtFileName; + private System.Windows.Forms.Label lblChainName; private System.Windows.Forms.Button btnGenerateScript; - private System.Windows.Forms.Label lblDescription; - private System.Windows.Forms.Label lblPath; - private System.Windows.Forms.TextBox txtPath; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10; - private System.Windows.Forms.Label lblSyncToSong; + private System.Windows.Forms.Label lblElementDescriptionHint; private System.Windows.Forms.CheckBox checkSyncToSong; - private System.Windows.Forms.Label lblMoveDescriptionTitle; - private System.Windows.Forms.Label lblMoveDescription; - private System.Windows.Forms.TableLayoutPanel tlContent; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel8; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel12; + private System.Windows.Forms.Label lblElementDescriptionTitle; + private System.Windows.Forms.Label lblElementDescription; + private System.Windows.Forms.TableLayoutPanel tlpContent; + private System.Windows.Forms.TableLayoutPanel tlpElementSettingType; private System.Windows.Forms.Label lblAddToScript; - private System.Windows.Forms.CheckBox checkAddToScript; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel13; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel14; - private System.Windows.Forms.Label label2; + private System.Windows.Forms.TableLayoutPanel tlpElementSettingsAndChainSettings; + private System.Windows.Forms.TableLayoutPanel tlpChain; + private System.Windows.Forms.Label lblChainTitle; private System.Windows.Forms.Button btnAddMoveToChain; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel16; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9; + private System.Windows.Forms.TableLayoutPanel tlpElementSettings; + private System.Windows.Forms.Label lblElementTitle; + private System.Windows.Forms.FlowLayoutPanel flpChainSettings; private System.Windows.Forms.Label lblLoop; - private System.Windows.Forms.CheckBox checkLoop; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel17; - private System.Windows.Forms.TextBox txtMoveName; + private System.Windows.Forms.FlowLayoutPanel flpElementGeneralSettings; + private System.Windows.Forms.TableLayoutPanel tlpElementSettingName; + private System.Windows.Forms.TextBox txtElementName; private System.Windows.Forms.Label lblMoveName; private System.Windows.Forms.TreeView tvChain; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; + private System.Windows.Forms.FlowLayoutPanel flpElementOptions; private System.Windows.Forms.Button btnResetMoveSettings; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel18; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel19; - private System.Windows.Forms.Label lblElementOptions; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4; + private System.Windows.Forms.TableLayoutPanel tlpChainTreeAndElementOptions; + private System.Windows.Forms.TableLayoutPanel tlpElementSelectedOptions; + private System.Windows.Forms.Label lblElementSelectedOptions; + private System.Windows.Forms.FlowLayoutPanel flpElementSelectedOptions; private System.Windows.Forms.Button btnElementMoveUp; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel20; + private System.Windows.Forms.TableLayoutPanel tlpElementSelectedOptionMoveUpAndDown; private System.Windows.Forms.Button btnElementMoveDown; private System.Windows.Forms.Button btnElementDuplicate; private System.Windows.Forms.Button btnElementGetSettings; private System.Windows.Forms.Button btnElementApplySettings; private System.Windows.Forms.Button btnElementDelete; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel21; - private System.Windows.Forms.Button btnEditPath; + private System.Windows.Forms.Button btnEditScriptPath; private System.Windows.Forms.Button btnInsert; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem toolStripFileOptions; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.TableLayoutPanel tlpMenuAndContent; + private System.Windows.Forms.FlowLayoutPanel flpScriptOptions; + private System.Windows.Forms.TextBox txtScriptName; + private System.Windows.Forms.Label lblScriptName; + private System.Windows.Forms.Label lblSyncToSong; + private System.Windows.Forms.CheckBox checkAddToScript; + private System.Windows.Forms.CheckBox checkLoop; + private System.Windows.Forms.TextBox txtChainName; } } diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs index 6de78fc..4de5a1c 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/Form1.cs @@ -7,24 +7,32 @@ using MovementScriptGenerator.Modules.OtherChainElements; using Newtonsoft.Json; using Microsoft.WindowsAPICodePack.Dialogs; +using MovementScriptGenerator.Properties; namespace MovementScriptGenerator { public partial class Main : Form { - //Move Controls + //Move controls CircleControl circleControl = new CircleControl(); SpiralControl spiralControl = new SpiralControl(); - //Other Chain Elements Controls + //Other chain elements controls RepeatControl repeatControl = new RepeatControl(); + //Info for file generation + private string savedChainFullName = Settings.Default.ChainFullName; + private string savedChainDirectoryPath = string.IsNullOrEmpty(Settings.Default.ChainFullName) ? string.Empty : Path.GetDirectoryName(Settings.Default.ChainFullName); + private string generateScriptPath = Settings.Default.GenerateScriptPath; private static readonly char[] illegalCharsForExplorer = "/<>:/\\\"|?*".ToCharArray(); + private static readonly string defaultInitialDirectory = "C:\\Users"; + //Info for Icons private static readonly DirectoryInfo iconsDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.Parent.GetDirectories().Where(directory => directory.Name == "Icons").FirstOrDefault(); private static readonly string iconsDataType = ".png"; + //Other Info private static readonly int maxStackDepth = 64; Chain chain = new Chain() @@ -32,28 +40,105 @@ public partial class Main : Form Elements = new List() }; - List moveDescriptions = new List() + List elementDescriptions = new List() { "The camera will move in a circle around the player.", "The camera will move from the starting distance to the end distance while spinning around its axis, creating a spiralling shot.", "The camera will move from the given direction towards the player. Then at a surtain point, it will do a 180 degree turn, making the move into something that resembles a J.\nCurrently not implemented!", - "Repeats the Moves that are in the given range. The moves at the start position and end position are included." + "Repeats the elements that are in the given range. The elements at the start position and end position will also be repeated." }; public Main() { + //TODO Create own form/implementation of MessageBox so that it can always be displayed in the middle of the parent window InitializeComponent(); + InitializeComponentView(); + PopulateComponentsWithSavedSettings(); InitializeComboBoxes(); InitializeChainWindow(); UpdateDescription(); - OnMoveTypeChanged(); + OnElementTypeChanged(); UpdateChainWindow(); } + private void InitializeComponentView() + { + if(Settings.Default.WindowLocation != new System.Drawing.Point()) + { + StartPosition = FormStartPosition.Manual; + Location = Settings.Default.WindowLocation; + } + Size = Settings.Default.WindowSize; + } + + private void PopulateComponentsWithSavedSettings() + { + if(LoadLastChain()) + { + InitializeTextBoxes(); + } + else + { + if (savedChainFullName != string.Empty) + { + MessageBox.Show("Couldn't load the last edited chain. Please open it yourself via the file tab."); + } + } + } + + private bool LoadLastChain() + { + Chain loadedChain = TryLoadChainFromFile(savedChainFullName); + if(loadedChain != null) + { + chain = loadedChain; + return true; + } + + return false; + } + + /// + /// Returns null if there can't be a chain generated with the given fullName + /// + private Chain TryLoadChainFromFile(string fullName) + { + //TODO creates a chain out of non chain files. Return null in that case + Chain loadedChain = null; + if (File.Exists(fullName)) + { + using (StreamReader file = File.OpenText(fullName)) + { + JsonSerializer serializer = new JsonSerializer(); + serializer.Formatting = Formatting.Indented; + serializer.TypeNameHandling = TypeNameHandling.All; + try + { + loadedChain = (Chain)serializer.Deserialize(file, typeof(Chain)); + } + catch + { + return null; + } + if(loadedChain.DirectoryPath == null || loadedChain.FullName == null) + { + return null; + } + } + } + + return loadedChain; + } + + private void InitializeTextBoxes() + { + txtChainName.Text = chain.Name; + } + private void InitializeComboBoxes() { - cbType.DataSource = Enum.GetNames(typeof(ChainElementsEnum)); - cbType.SelectedIndex = 0; + cbElementType.DataSource = Enum.GetNames(typeof(ChainElementsEnum)); + cbElementType.SelectedIndex = 0; } private void InitializeChainWindow() @@ -70,34 +155,34 @@ private void InitializeChainWindow() private void UpdateDescription() { - lblMoveDescription.Text = moveDescriptions[cbType.SelectedIndex]; + lblElementDescription.Text = elementDescriptions[cbElementType.SelectedIndex]; } - private void OnMoveTypeChanged() + private void OnElementTypeChanged() { - tlContent.Controls.Clear(); - switch (cbType.SelectedIndex) + tlpContent.Controls.Clear(); + switch (cbElementType.SelectedIndex) { case 0: - tlContent.Controls.Add(circleControl); + tlpContent.Controls.Add(circleControl); break; case 1: - tlContent.Controls.Add(spiralControl); + tlpContent.Controls.Add(spiralControl); break; case 3: - tlContent.Controls.Add(repeatControl); + tlpContent.Controls.Add(repeatControl); break; } } - private void ResetContent() + private void ResetDisplayedElementSettings() { - txtMoveName.Text = string.Empty; - if(tlContent.Controls.Count == 0) + txtElementName.Text = string.Empty; + if(tlpContent.Controls.Count == 0) { return; } - switch (tlContent.Controls[0]) + switch (tlpContent.Controls[0]) { case CircleControl _: circleControl = new CircleControl(); @@ -165,7 +250,7 @@ private bool GenerateMovementScriptFile(MovementScript script, string filePath) { if (File.Exists(filePath)) { - if(MessageBox.Show("A file with the given name already exists.\nWould you like to overwrite that file?", "Overwrite existing File", MessageBoxButtons.YesNo) == DialogResult.No) + if(MessageBox.Show("A script with the given name already exists.\nWould you like to overwrite that file?", "Overwrite existing File", MessageBoxButtons.YesNo) == DialogResult.No) { return false; } @@ -184,40 +269,40 @@ private bool GenerateMovementScriptFile(MovementScript script, string filePath) } catch { - MessageBox.Show($"Something went wrong while generating the file.\nPlease make sure that the file name and file path are viable and don't contain any not allowed characters."); + MessageBox.Show($"Something went wrong while generating the file.\nPlease make sure that the script name and script path are viable and don't contain any not allowed characters."); return false; } } - private void cbType_SelectedIndexChanged(object sender, EventArgs e) + private void cbElementType_SelectedIndexChanged(object sender, EventArgs e) { UpdateDescription(); - OnMoveTypeChanged(); + OnElementTypeChanged(); } - private void btnAddMoveToChain_Click(object sender, EventArgs e) + private void btnAddElementToChain_Click(object sender, EventArgs e) { - string moveName = txtMoveName.Text; - if (!MoveNameValid(moveName)) + string ElementName = txtElementName.Text; + if (!ElementNameValid(ElementName)) { - moveName = null; + ElementName = null; } - switch (cbType.SelectedIndex) + switch (cbElementType.SelectedIndex) { case (int)ChainElementsEnum.Circle: - Circle circle = circleControl.CreateMove(moveName); + Circle circle = circleControl.CreateMove(ElementName); chain.Elements.Add(circle); break; case (int)ChainElementsEnum.Spiral: - Spiral spiral = spiralControl.CreateMove(moveName); + Spiral spiral = spiralControl.CreateMove(ElementName); chain.Elements.Add(spiral); break; case (int)ChainElementsEnum.Repeat: if (repeatControl.ValidateInputs()) { - Repeat repeat = repeatControl.CreateElement(moveName); + Repeat repeat = repeatControl.CreateElement(ElementName); chain.Elements.Add(repeat); } else @@ -226,7 +311,7 @@ private void btnAddMoveToChain_Click(object sender, EventArgs e) } break; default: - MessageBox.Show("can't add move to chain."); + MessageBox.Show("can't add element to chain."); return; } @@ -235,40 +320,33 @@ private void btnAddMoveToChain_Click(object sender, EventArgs e) private void btnGenerateScript_Click(object sender, EventArgs e) { - string filePath = $@"{txtPath.Text}\{txtFileName.Text}.Json"; - - if (txtFileName.Text.Replace(" ", string.Empty) == "") + if (txtScriptName.Text.Replace(" ", string.Empty) == string.Empty) { - MessageBox.Show("Filename is missing!"); - txtFileName.Focus(); + MessageBox.Show($"Can't generate a movement script without a script name.\nPlease enter a name for the movement script."); + txtScriptName.Focus(); return; } - if (txtFileName.Text.IndexOfAny(illegalCharsForExplorer) != -1) - { - MessageBox.Show($"Couldn't generate the file because there are not allowed special characters in the filename.\nPlease make sure to not use any of these characters:\n{new string(illegalCharsForExplorer)}"); - txtFileName.Focus(); - return; - } + string scriptName = txtScriptName.Text; - if (filePath.IndexOfAny(Path.GetInvalidPathChars()) != -1) + if (scriptName.IndexOfAny(illegalCharsForExplorer) != -1) { - MessageBox.Show($"Couldn't generate the file because the file path is invalid.\nPlease check that the file path is correct and pointing to the right folder."); - btnEditPath.Focus(); + MessageBox.Show($"Couldn't generate the script because there are not allowed special characters in the script name.\nPlease make sure to not use any of these characters:\n{new string(illegalCharsForExplorer)}"); + txtScriptName.Focus(); return; } - if (!Directory.Exists(txtPath.Text)) + if (!Directory.Exists(generateScriptPath)) { - MessageBox.Show("Couldn't find a directory at the given path.\nPlease make sure that the path points to an existsing directory on your device."); - btnEditPath.Focus(); + MessageBox.Show("Couldn't find a directory at the given path.\nPlease make sure that the script path points to an existsing directory on your device."); + btnEditScriptPath.Focus(); return; } if(chain.Elements.Count <= 0) { - MessageBox.Show("Can't create a movement script without any moves.\nPlease add moves to the chain before trying to generate a movement script."); - cbType.Focus(); + MessageBox.Show("Can't create a movement script without any elements.\nPlease add elements to the chain before trying to generate a movement script."); + cbElementType.Focus(); return; } @@ -285,19 +363,27 @@ private void btnGenerateScript_Click(object sender, EventArgs e) return; } + string filePath = $@"{generateScriptPath}\{scriptName}.Json"; + + if (filePath.IndexOfAny(Path.GetInvalidPathChars()) != -1) + { + MessageBox.Show($"Couldn't generate the script because the scrpit path is invalid.\nPlease check that the script path is correct and pointing to the right directory/folder."); + btnEditScriptPath.Focus(); + return; + } if (checkAddToScript.Checked) { if (AddToMovementScriptFile(movementScript, filePath)) { - MessageBox.Show("Chain added to Movement Script"); + MessageBox.Show("Chain added to movement script"); }; } else { if (GenerateMovementScriptFile(movementScript, filePath)) { - MessageBox.Show("Movement Script generated"); + MessageBox.Show("Movement script generated"); }; } } @@ -424,23 +510,23 @@ private bool AddToMovementScriptFile(MovementScript script, string filePath) } catch { - MessageBox.Show("Move could not be added.\nMake sure that the file is a correct MovementScript file."); + MessageBox.Show("Chain could not be added.\nMake sure that the file, where the chain will be added to, is a correct MovementScript file."); return false; }; } private void btnResetMoveControl_Click(object sender, EventArgs e) { - ResetContent(); - OnMoveTypeChanged(); + ResetDisplayedElementSettings(); + OnElementTypeChanged(); } private void btnElementApplySettings_Click(object sender, EventArgs e) { - string newMoveName = txtMoveName.Text; - if (!MoveNameValid(newMoveName)) + string newElementName = txtElementName.Text; + if (!ElementNameValid(newElementName)) { - newMoveName = null; + newElementName = null; } try { @@ -452,12 +538,12 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) } ChainElement selectedElement = chain.Elements[selectedNode.Index]; - switch (cbType.SelectedIndex) + switch (cbElementType.SelectedIndex) { case (int)ChainElementsEnum.Circle: if(selectedElement is Circle) { - Circle circle = circleControl.CreateMove(newMoveName); + Circle circle = circleControl.CreateMove(newElementName); chain.Elements[selectedNode.Index] = circle; } else @@ -469,7 +555,7 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) case (int)ChainElementsEnum.Spiral: if(selectedElement is Spiral) { - Spiral spiral = spiralControl.CreateMove(newMoveName); + Spiral spiral = spiralControl.CreateMove(newElementName); chain.Elements[selectedNode.Index] = spiral; } else @@ -483,7 +569,7 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) { if (repeatControl.ValidateInputs()) { - Repeat repeat = repeatControl.CreateElement(newMoveName); + Repeat repeat = repeatControl.CreateElement(newElementName); chain.Elements[selectedNode.Index] = repeat; } else @@ -511,9 +597,9 @@ private void btnElementApplySettings_Click(object sender, EventArgs e) } } - private bool MoveNameValid(string moveName) + private bool ElementNameValid(string elementName) { - if (moveName.Replace(" ", string.Empty) == "") + if (elementName.Replace(" ", string.Empty) == "") { return false; } @@ -534,15 +620,15 @@ private void btnElementGetSettings_Click(object sender, EventArgs e) { case Circle circleElement: populatingOfFieldsSuccessful = circleControl.Populate(circleElement); - cbType.SelectedIndex = (int)ChainElementsEnum.Circle; + cbElementType.SelectedIndex = (int)ChainElementsEnum.Circle; break; case Spiral spiralElement: populatingOfFieldsSuccessful = spiralControl.Populate(spiralElement); - cbType.SelectedIndex = (int)ChainElementsEnum.Spiral; + cbElementType.SelectedIndex = (int)ChainElementsEnum.Spiral; break; case Repeat repeatElement: populatingOfFieldsSuccessful = repeatControl.Populate(repeatElement); - cbType.SelectedIndex = (int)ChainElementsEnum.Repeat; + cbElementType.SelectedIndex = (int)ChainElementsEnum.Repeat; break; default: MessageBox.Show("Can't get the settings of the selected element."); @@ -554,7 +640,7 @@ private void btnElementGetSettings_Click(object sender, EventArgs e) } else { - txtMoveName.Text = selectedElementInChain.Name; + txtElementName.Text = selectedElementInChain.Name; } } @@ -711,42 +797,42 @@ private void btnInsert_Click(object sender, EventArgs e) return; } - string moveName = txtMoveName.Text; - if (!MoveNameValid(moveName)) + string elementName = txtElementName.Text; + if (!ElementNameValid(elementName)) { - moveName = null; + elementName = null; } - switch (cbType.SelectedIndex) + switch (cbElementType.SelectedIndex) { case (int)ChainElementsEnum.Circle: - Circle circle = circleControl.CreateMove(moveName); + Circle circle = circleControl.CreateMove(elementName); chain.Elements.Insert(insertIndex, circle); break; case (int)ChainElementsEnum.Spiral: - Spiral spiral = spiralControl.CreateMove(moveName); + Spiral spiral = spiralControl.CreateMove(elementName); chain.Elements.Insert(insertIndex, spiral); break; case (int)ChainElementsEnum.Repeat: - Repeat repeat = repeatControl.CreateElement(moveName); + Repeat repeat = repeatControl.CreateElement(elementName); chain.Elements.Insert(insertIndex, repeat); break; default: - MessageBox.Show("can't add move to chain."); + MessageBox.Show("can't add element to chain."); return; } UpdateChainWindow(insertIndex); } - private void btnEditPath_Click(object sender, EventArgs e) + private void btnEditScriptPath_Click(object sender, EventArgs e) { CommonOpenFileDialog dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = true; - dialog.InitialDirectory = "C:\\Users"; + dialog.InitialDirectory = Directory.Exists(generateScriptPath) ? generateScriptPath: defaultInitialDirectory; if(dialog.ShowDialog() == CommonFileDialogResult.Ok) { - txtPath.Text = dialog.FileName; + generateScriptPath = dialog.FileName; } } @@ -754,5 +840,212 @@ private void tvChain_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEvent { btnElementGetSettings_Click(sender, e); } + + private void Main_FormClosing(object sender, FormClosingEventArgs e) + { + //TODO Save Window Format (Fullscreen or not?) + + if (CheckUnsavedChanges()) + { + DialogResult saveChanges = MessageBox.Show("Would you like to save your changes?", "Save changes", MessageBoxButtons.YesNoCancel); + if (saveChanges == DialogResult.Yes) + { + saveToolStripMenuItem_Click(sender, e); + } + if(saveChanges == DialogResult.Cancel) + { + e.Cancel = true; + } + } + + //Saving general settings + Settings.Default.WindowLocation = Location; + if (WindowState == FormWindowState.Normal) + { + Settings.Default.WindowSize = Size; + } + else + { + Settings.Default.WindowSize = RestoreBounds.Size; + } + Settings.Default.GenerateScriptPath = generateScriptPath; + + //Saving settings of current chain + Settings.Default.ChainFullName = chain.FullName; + Settings.Default.ChainDirectoryPath = chain.DirectoryPath; + + Settings.Default.Save(); + } + + private bool CheckUnsavedChanges() + { + //Checks if changes have been made to the chain + Chain savedChain = TryLoadChainFromFile(chain.FullName); + Chain currentChain = chain; + if(currentChain == null) + { + return false; + } + + if(savedChain == null) + { + if(currentChain.Elements.Count > 0 ) + { + return true; + } + + if(currentChain.Name != string.Empty && currentChain.Name != null) + { + return true; + } + + return false; + } + //Compares saved and current chains to see if changes have been made since last save + if (!CompareObject.Compare(currentChain, savedChain)) + { + return true; + } + return false; + } + + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + if(chain.FullName != string.Empty && File.Exists(chain.FullName)) + { + SaveChain(chain.FullName); + } + else + { + saveAsToolStripMenuItem_Click(sender, e); + } + } + + private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + { + CommonSaveFileDialog dialog = new CommonSaveFileDialog(); + dialog.AllowPropertyEditing = false; + dialog.AlwaysAppendDefaultExtension = true; + dialog.DefaultExtension = "Json"; + if(txtChainName.Text.Replace(" ", string.Empty) == string.Empty) + { + txtChainName.Text = "NewChain"; + } + dialog.DefaultFileName = txtChainName.Text; + dialog.InitialDirectory = GetnitialDirectoryForChainFiles(); + if(dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + chain.FullName = dialog.FileName; + chain.DirectoryPath = Path.GetDirectoryName(dialog.FileName); + SaveChain(chain.FullName); + } + } + + private bool SaveChain(string fullName) + { + try + { + using (StreamWriter file = File.CreateText(fullName)) + { + JsonSerializer serializer = new JsonSerializer(); + serializer.Formatting = Formatting.Indented; + serializer.TypeNameHandling = TypeNameHandling.All; + + serializer.Serialize(file, chain); + } + return true; + } + catch + { + MessageBox.Show($"Something went wrong while saving the chain.\nPlease make sure that the file path exists and that file path and file name dont contain any not allowed characters."); + return false; + } + } + + private void txtChainName_TextChanged(object sender, EventArgs e) + { + if (txtChainName.Text.Replace(" ", string.Empty) != string.Empty) + { + chain.Name = txtChainName.Text; + } + } + + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (CheckUnsavedChanges()) + { + DialogResult saveChanges = MessageBox.Show("Would you like to save your changes?", "Save changes", MessageBoxButtons.YesNoCancel); + if (saveChanges == DialogResult.Yes) + { + saveToolStripMenuItem_Click(sender, e); + } + if (saveChanges == DialogResult.Cancel) + { + return; + } + } + + CommonOpenFileDialog dialog = new CommonOpenFileDialog(); + dialog.InitialDirectory = GetnitialDirectoryForChainFiles(); + if (dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + Chain chainFromOpenedFile = TryLoadChainFromFile(dialog.FileName); + if(chainFromOpenedFile != null) + { + UseNewChain(chainFromOpenedFile, dialog); + } + else + { + MessageBox.Show("Couldn't open the file.\nPlease make sure that the selected file is a saved chain and not a generated movement script file or other file."); + } + } + } + + private void UseNewChain(Chain newChain, CommonOpenFileDialog dialogOfNewChain) + { + chain = newChain; + chain.FullName = dialogOfNewChain.FileName; + chain.DirectoryPath = Path.GetDirectoryName(dialogOfNewChain.FileName); + txtChainName.Text = chain.Name; + UpdateChainWindow(); + } + + private void newToolStripMenuItem_Click(object sender, EventArgs e) + { + if (CheckUnsavedChanges()) + { + DialogResult saveChanges = MessageBox.Show("Would you like to save your changes?", "Save changes", MessageBoxButtons.YesNoCancel); + if (saveChanges == DialogResult.Yes) + { + saveToolStripMenuItem_Click(sender, e); + } + if (saveChanges == DialogResult.Cancel) + { + return; + } + } + + chain = new Chain() + { + Elements = new List() + }; + txtChainName.Text = chain.Name; + UpdateChainWindow(); + } + + private string GetnitialDirectoryForChainFiles() + { + if (Directory.Exists(chain.DirectoryPath)) + { + return chain.DirectoryPath; + } + + if (Directory.Exists(savedChainDirectoryPath)) + { + return savedChainDirectoryPath; + } + + return defaultInitialDirectory; + } } } diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Form1.resx index bda2b85..00faafd 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Form1.resx @@ -120,32 +120,37 @@ 17, 17 - - The path of the directory in which the Movement Script File will be saved. -Make sure to save the Files to the correct directory, else the camera2 mod will not be able -to get them. -The path should be something like this: -D:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts + + Select the directory in which the movement script file will be generated in. +Make sure that this is the correct directory, else camera2 will not be able to use the script! +If you are using steam, the directory path should look somewhat like this: +C:\SteamLibrary\steamapps\common\Beat Saber\UserData\Camera2\MovementScripts - - 17, 17 - On -> the script will pause, while the song is paused and start playing when the song starts. Off -> the script will start playing at the start of the song and not stop in pause menu -(this has no effect on if the script will play in the normal menu / outside of songs) + +This setting has no effect on if the script will play in the normal menu / outside of songs - On -> if a movement script file with the given name exists, the moves will be added to that files moves. + On -> if a movement script file with the given name exists, the moves will be added to that file's moves. Will overwrite the "Sync To Song" and "Loop" options of the existing file! (Make sure that the file is a MovementScript File!) -Off -> A new movement script file will be created for the move. +Off -> A new movement script file will be created for the moves. If a file with the same name exists, that file will be overwritten! - - 17, 17 + + Element types are divided into two subtypes: +move +- elements that directly influence the position/rotation etc. of the camera +other elements +- elements that influence/augment moves. + These elements can't function on their own and always need corresponding move elements. + + + 109, 17 diff --git a/MovementScriptGenerator/Modules/Chain.cs b/MovementScriptGenerator/Modules/Chain.cs index 9b2cc28..fdfe4d0 100644 --- a/MovementScriptGenerator/Modules/Chain.cs +++ b/MovementScriptGenerator/Modules/Chain.cs @@ -4,6 +4,9 @@ namespace MovementScriptGenerator.Modules { public class Chain { + public string Name { get; set; } + public string FullName { get; set; } + public string DirectoryPath { get; set; } public List Elements { get; set; } } } diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 985e91a..65314d0 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -63,6 +63,7 @@ + Form diff --git a/MovementScriptGenerator/Properties/Settings.Designer.cs b/MovementScriptGenerator/Properties/Settings.Designer.cs index ef6e25c..e22c0cd 100644 --- a/MovementScriptGenerator/Properties/Settings.Designer.cs +++ b/MovementScriptGenerator/Properties/Settings.Designer.cs @@ -8,22 +8,79 @@ // //------------------------------------------------------------------------------ - -namespace MovementScriptGenerator.Properties -{ +namespace MovementScriptGenerator.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string GenerateScriptPath { + get { + return ((string)(this["GenerateScriptPath"])); + } + set { + this["GenerateScriptPath"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ChainFullName { + get { + return ((string)(this["ChainFullName"])); + } + set { + this["ChainFullName"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ChainDirectoryPath { + get { + return ((string)(this["ChainDirectoryPath"])); + } + set { + this["ChainDirectoryPath"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Point WindowLocation { + get { + return ((global::System.Drawing.Point)(this["WindowLocation"])); + } + set { + this["WindowLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("923, 754")] + public global::System.Drawing.Size WindowSize { + get { + return ((global::System.Drawing.Size)(this["WindowSize"])); + } + set { + this["WindowSize"] = value; + } + } } } diff --git a/MovementScriptGenerator/Properties/Settings.settings b/MovementScriptGenerator/Properties/Settings.settings index 3964565..e33ca16 100644 --- a/MovementScriptGenerator/Properties/Settings.settings +++ b/MovementScriptGenerator/Properties/Settings.settings @@ -1,7 +1,21 @@  - - - - - - + + + + + + + + + + + + + + 0, 0 + + + 923, 754 + + + \ No newline at end of file From aff5712f0f8c73df677ea8a3d63fd79c81a7f4e3 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 30 Dec 2022 13:51:56 +0100 Subject: [PATCH 14/21] - renamed menuStrip - renamed Form1 to Main --- .../{Form1.Designer.cs => Main.Designer.cs} | 58 +++++++++---------- MovementScriptGenerator/{Form1.cs => Main.cs} | 0 .../{Form1.resx => Main.resx} | 2 +- .../MovementScriptGenerator.csproj | 38 ++++++++++-- 4 files changed, 62 insertions(+), 36 deletions(-) rename MovementScriptGenerator/{Form1.Designer.cs => Main.Designer.cs} (98%) rename MovementScriptGenerator/{Form1.cs => Main.cs} (100%) rename MovementScriptGenerator/{Form1.resx => Main.resx} (98%) diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/Main.Designer.cs similarity index 98% rename from MovementScriptGenerator/Form1.Designer.cs rename to MovementScriptGenerator/Main.Designer.cs index 397765b..5b9e965 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/Main.Designer.cs @@ -75,12 +75,12 @@ private void InitializeComponent() this.tlpContent = new System.Windows.Forms.TableLayoutPanel(); this.flpElementGeneralSettings = new System.Windows.Forms.FlowLayoutPanel(); this.tlpElementSettingType = new System.Windows.Forms.TableLayoutPanel(); - this.cbElementType = new System.Windows.Forms.ComboBox(); this.lblType = new System.Windows.Forms.Label(); + this.cbElementType = new System.Windows.Forms.ComboBox(); this.tlpElementSettingName = new System.Windows.Forms.TableLayoutPanel(); this.txtElementName = new System.Windows.Forms.TextBox(); this.lblMoveName = new System.Windows.Forms.Label(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStripSettings = new System.Windows.Forms.MenuStrip(); this.toolStripFileOptions = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -103,7 +103,7 @@ private void InitializeComponent() this.flpElementGeneralSettings.SuspendLayout(); this.tlpElementSettingType.SuspendLayout(); this.tlpElementSettingName.SuspendLayout(); - this.menuStrip1.SuspendLayout(); + this.menuStripSettings.SuspendLayout(); this.tlpMenuAndContent.SuspendLayout(); this.SuspendLayout(); // @@ -715,8 +715,8 @@ private void InitializeComponent() this.tlpElementSettingType.ColumnCount = 2; this.tlpElementSettingType.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tlpElementSettingType.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpElementSettingType.Controls.Add(this.cbElementType, 1, 0); this.tlpElementSettingType.Controls.Add(this.lblType, 0, 0); + this.tlpElementSettingType.Controls.Add(this.cbElementType, 1, 0); this.tlpElementSettingType.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpElementSettingType.Location = new System.Drawing.Point(3, 3); this.tlpElementSettingType.MinimumSize = new System.Drawing.Size(0, 30); @@ -726,6 +726,18 @@ private void InitializeComponent() this.tlpElementSettingType.Size = new System.Drawing.Size(135, 30); this.tlpElementSettingType.TabIndex = 1; // + // lblType + // + this.lblType.AutoSize = true; + this.lblType.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblType.Location = new System.Drawing.Point(3, 0); + this.lblType.Name = "lblType"; + this.lblType.Size = new System.Drawing.Size(34, 30); + this.lblType.TabIndex = 1; + this.lblType.Text = "Type:"; + this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblType, resources.GetString("lblType.ToolTip")); + // // cbElementType // this.cbElementType.Dock = System.Windows.Forms.DockStyle.Fill; @@ -739,18 +751,6 @@ private void InitializeComponent() this.cbElementType.TabIndex = 2; this.cbElementType.SelectedIndexChanged += new System.EventHandler(this.cbElementType_SelectedIndexChanged); // - // lblType - // - this.lblType.AutoSize = true; - this.lblType.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblType.Location = new System.Drawing.Point(3, 0); - this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(34, 30); - this.lblType.TabIndex = 1; - this.lblType.Text = "Type:"; - this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblType, resources.GetString("lblType.ToolTip")); - // // tlpElementSettingName // this.tlpElementSettingName.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; @@ -786,16 +786,16 @@ private void InitializeComponent() this.lblMoveName.Text = "Name:"; this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // menuStrip1 + // menuStripSettings // - this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStripSettings.Dock = System.Windows.Forms.DockStyle.None; + this.menuStripSettings.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripFileOptions}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(45, 20); - this.menuStrip1.TabIndex = 8; - this.menuStrip1.Text = "menuStrip1"; + this.menuStripSettings.Location = new System.Drawing.Point(0, 0); + this.menuStripSettings.Name = "menuStripSettings"; + this.menuStripSettings.Size = new System.Drawing.Size(45, 20); + this.menuStripSettings.TabIndex = 8; + this.menuStripSettings.Text = "menuStrip1"; // // toolStripFileOptions // @@ -847,7 +847,7 @@ private void InitializeComponent() // this.tlpMenuAndContent.ColumnCount = 1; this.tlpMenuAndContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpMenuAndContent.Controls.Add(this.menuStrip1, 0, 0); + this.tlpMenuAndContent.Controls.Add(this.menuStripSettings, 0, 0); this.tlpMenuAndContent.Controls.Add(this.tlpContentAndMargin, 0, 1); this.tlpMenuAndContent.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpMenuAndContent.Location = new System.Drawing.Point(0, 0); @@ -866,7 +866,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(1105, 715); this.Controls.Add(this.tlpMenuAndContent); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStrip1; + this.MainMenuStrip = this.menuStripSettings; this.MinimumSize = new System.Drawing.Size(1121, 100); this.Name = "Main"; this.Text = "MovementScriptGenerator"; @@ -895,8 +895,8 @@ private void InitializeComponent() this.tlpElementSettingType.PerformLayout(); this.tlpElementSettingName.ResumeLayout(false); this.tlpElementSettingName.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); + this.menuStripSettings.ResumeLayout(false); + this.menuStripSettings.PerformLayout(); this.tlpMenuAndContent.ResumeLayout(false); this.tlpMenuAndContent.PerformLayout(); this.ResumeLayout(false); @@ -948,7 +948,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnElementDelete; private System.Windows.Forms.Button btnEditScriptPath; private System.Windows.Forms.Button btnInsert; - private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.MenuStrip menuStripSettings; private System.Windows.Forms.ToolStripMenuItem toolStripFileOptions; private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Main.cs similarity index 100% rename from MovementScriptGenerator/Form1.cs rename to MovementScriptGenerator/Main.cs diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/Main.resx similarity index 98% rename from MovementScriptGenerator/Form1.resx rename to MovementScriptGenerator/Main.resx index 00faafd..bb19e54 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/Main.resx @@ -149,7 +149,7 @@ other elements - elements that influence/augment moves. These elements can't function on their own and always need corresponding move elements. - + 109, 17 diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 65314d0..471b3ac 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -12,6 +12,21 @@ 512 true true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -65,11 +80,11 @@ - + Form - - Form1.cs + + Main.cs @@ -103,8 +118,8 @@ CircleControl.cs - - Form1.cs + + Main.cs ResXFileCodeGenerator @@ -138,6 +153,17 @@ - + + + False + Microsoft .NET Framework 4.8 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file From 21e3602ec03490f78df36d72ca04b837fff70180 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 30 Dec 2022 14:26:39 +0100 Subject: [PATCH 15/21] Revert "- renamed menuStrip" This reverts commit aff5712f0f8c73df677ea8a3d63fd79c81a7f4e3. --- .../{Main.Designer.cs => Form1.Designer.cs} | 58 +++++++++---------- MovementScriptGenerator/{Main.cs => Form1.cs} | 0 .../{Main.resx => Form1.resx} | 2 +- .../MovementScriptGenerator.csproj | 38 ++---------- 4 files changed, 36 insertions(+), 62 deletions(-) rename MovementScriptGenerator/{Main.Designer.cs => Form1.Designer.cs} (98%) rename MovementScriptGenerator/{Main.cs => Form1.cs} (100%) rename MovementScriptGenerator/{Main.resx => Form1.resx} (98%) diff --git a/MovementScriptGenerator/Main.Designer.cs b/MovementScriptGenerator/Form1.Designer.cs similarity index 98% rename from MovementScriptGenerator/Main.Designer.cs rename to MovementScriptGenerator/Form1.Designer.cs index 5b9e965..397765b 100644 --- a/MovementScriptGenerator/Main.Designer.cs +++ b/MovementScriptGenerator/Form1.Designer.cs @@ -75,12 +75,12 @@ private void InitializeComponent() this.tlpContent = new System.Windows.Forms.TableLayoutPanel(); this.flpElementGeneralSettings = new System.Windows.Forms.FlowLayoutPanel(); this.tlpElementSettingType = new System.Windows.Forms.TableLayoutPanel(); - this.lblType = new System.Windows.Forms.Label(); this.cbElementType = new System.Windows.Forms.ComboBox(); + this.lblType = new System.Windows.Forms.Label(); this.tlpElementSettingName = new System.Windows.Forms.TableLayoutPanel(); this.txtElementName = new System.Windows.Forms.TextBox(); this.lblMoveName = new System.Windows.Forms.Label(); - this.menuStripSettings = new System.Windows.Forms.MenuStrip(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.toolStripFileOptions = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -103,7 +103,7 @@ private void InitializeComponent() this.flpElementGeneralSettings.SuspendLayout(); this.tlpElementSettingType.SuspendLayout(); this.tlpElementSettingName.SuspendLayout(); - this.menuStripSettings.SuspendLayout(); + this.menuStrip1.SuspendLayout(); this.tlpMenuAndContent.SuspendLayout(); this.SuspendLayout(); // @@ -715,8 +715,8 @@ private void InitializeComponent() this.tlpElementSettingType.ColumnCount = 2; this.tlpElementSettingType.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tlpElementSettingType.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpElementSettingType.Controls.Add(this.lblType, 0, 0); this.tlpElementSettingType.Controls.Add(this.cbElementType, 1, 0); + this.tlpElementSettingType.Controls.Add(this.lblType, 0, 0); this.tlpElementSettingType.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpElementSettingType.Location = new System.Drawing.Point(3, 3); this.tlpElementSettingType.MinimumSize = new System.Drawing.Size(0, 30); @@ -726,18 +726,6 @@ private void InitializeComponent() this.tlpElementSettingType.Size = new System.Drawing.Size(135, 30); this.tlpElementSettingType.TabIndex = 1; // - // lblType - // - this.lblType.AutoSize = true; - this.lblType.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblType.Location = new System.Drawing.Point(3, 0); - this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(34, 30); - this.lblType.TabIndex = 1; - this.lblType.Text = "Type:"; - this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblType, resources.GetString("lblType.ToolTip")); - // // cbElementType // this.cbElementType.Dock = System.Windows.Forms.DockStyle.Fill; @@ -751,6 +739,18 @@ private void InitializeComponent() this.cbElementType.TabIndex = 2; this.cbElementType.SelectedIndexChanged += new System.EventHandler(this.cbElementType_SelectedIndexChanged); // + // lblType + // + this.lblType.AutoSize = true; + this.lblType.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblType.Location = new System.Drawing.Point(3, 0); + this.lblType.Name = "lblType"; + this.lblType.Size = new System.Drawing.Size(34, 30); + this.lblType.TabIndex = 1; + this.lblType.Text = "Type:"; + this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblType, resources.GetString("lblType.ToolTip")); + // // tlpElementSettingName // this.tlpElementSettingName.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; @@ -786,16 +786,16 @@ private void InitializeComponent() this.lblMoveName.Text = "Name:"; this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // menuStripSettings + // menuStrip1 // - this.menuStripSettings.Dock = System.Windows.Forms.DockStyle.None; - this.menuStripSettings.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripFileOptions}); - this.menuStripSettings.Location = new System.Drawing.Point(0, 0); - this.menuStripSettings.Name = "menuStripSettings"; - this.menuStripSettings.Size = new System.Drawing.Size(45, 20); - this.menuStripSettings.TabIndex = 8; - this.menuStripSettings.Text = "menuStrip1"; + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(45, 20); + this.menuStrip1.TabIndex = 8; + this.menuStrip1.Text = "menuStrip1"; // // toolStripFileOptions // @@ -847,7 +847,7 @@ private void InitializeComponent() // this.tlpMenuAndContent.ColumnCount = 1; this.tlpMenuAndContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpMenuAndContent.Controls.Add(this.menuStripSettings, 0, 0); + this.tlpMenuAndContent.Controls.Add(this.menuStrip1, 0, 0); this.tlpMenuAndContent.Controls.Add(this.tlpContentAndMargin, 0, 1); this.tlpMenuAndContent.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpMenuAndContent.Location = new System.Drawing.Point(0, 0); @@ -866,7 +866,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(1105, 715); this.Controls.Add(this.tlpMenuAndContent); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStripSettings; + this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(1121, 100); this.Name = "Main"; this.Text = "MovementScriptGenerator"; @@ -895,8 +895,8 @@ private void InitializeComponent() this.tlpElementSettingType.PerformLayout(); this.tlpElementSettingName.ResumeLayout(false); this.tlpElementSettingName.PerformLayout(); - this.menuStripSettings.ResumeLayout(false); - this.menuStripSettings.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.tlpMenuAndContent.ResumeLayout(false); this.tlpMenuAndContent.PerformLayout(); this.ResumeLayout(false); @@ -948,7 +948,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnElementDelete; private System.Windows.Forms.Button btnEditScriptPath; private System.Windows.Forms.Button btnInsert; - private System.Windows.Forms.MenuStrip menuStripSettings; + private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem toolStripFileOptions; private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; diff --git a/MovementScriptGenerator/Main.cs b/MovementScriptGenerator/Form1.cs similarity index 100% rename from MovementScriptGenerator/Main.cs rename to MovementScriptGenerator/Form1.cs diff --git a/MovementScriptGenerator/Main.resx b/MovementScriptGenerator/Form1.resx similarity index 98% rename from MovementScriptGenerator/Main.resx rename to MovementScriptGenerator/Form1.resx index bb19e54..00faafd 100644 --- a/MovementScriptGenerator/Main.resx +++ b/MovementScriptGenerator/Form1.resx @@ -149,7 +149,7 @@ other elements - elements that influence/augment moves. These elements can't function on their own and always need corresponding move elements. - + 109, 17 diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 471b3ac..65314d0 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -12,21 +12,6 @@ 512 true true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true AnyCPU @@ -80,11 +65,11 @@ - + Form - - Main.cs + + Form1.cs @@ -118,8 +103,8 @@ CircleControl.cs - - Main.cs + + Form1.cs ResXFileCodeGenerator @@ -153,17 +138,6 @@ - - - False - Microsoft .NET Framework 4.8 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - + \ No newline at end of file From 63e514f30596a894da774c42f7e1f2e00925ad1e Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 30 Dec 2022 15:27:19 +0100 Subject: [PATCH 16/21] - renamed menuStrip - renamed Form1 to MainForm - removed DirectoryPath variable from Chain as it can be inferred from FullName - added User Setting for WindowFormat (fullscreen or not) - fixed naming of a function --- MovementScriptGenerator/App.config | 3 ++ ...Form1.Designer.cs => MainForm.Designer.cs} | 31 ++++++++++--------- .../{Form1.cs => MainForm.cs} | 25 ++++++++------- .../{Form1.resx => MainForm.resx} | 2 +- MovementScriptGenerator/Modules/Chain.cs | 1 - .../MovementScriptGenerator.csproj | 10 +++--- .../Properties/Settings.Designer.cs | 12 +++++++ .../Properties/Settings.settings | 3 ++ 8 files changed, 54 insertions(+), 33 deletions(-) rename MovementScriptGenerator/{Form1.Designer.cs => MainForm.Designer.cs} (98%) rename MovementScriptGenerator/{Form1.cs => MainForm.cs} (97%) rename MovementScriptGenerator/{Form1.resx => MainForm.resx} (98%) diff --git a/MovementScriptGenerator/App.config b/MovementScriptGenerator/App.config index 31ba27e..6837896 100644 --- a/MovementScriptGenerator/App.config +++ b/MovementScriptGenerator/App.config @@ -25,6 +25,9 @@ 923, 754 + + 0 + \ No newline at end of file diff --git a/MovementScriptGenerator/Form1.Designer.cs b/MovementScriptGenerator/MainForm.Designer.cs similarity index 98% rename from MovementScriptGenerator/Form1.Designer.cs rename to MovementScriptGenerator/MainForm.Designer.cs index 397765b..c2d6309 100644 --- a/MovementScriptGenerator/Form1.Designer.cs +++ b/MovementScriptGenerator/MainForm.Designer.cs @@ -80,7 +80,7 @@ private void InitializeComponent() this.tlpElementSettingName = new System.Windows.Forms.TableLayoutPanel(); this.txtElementName = new System.Windows.Forms.TextBox(); this.lblMoveName = new System.Windows.Forms.Label(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuStripOptions = new System.Windows.Forms.MenuStrip(); this.toolStripFileOptions = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -103,7 +103,7 @@ private void InitializeComponent() this.flpElementGeneralSettings.SuspendLayout(); this.tlpElementSettingType.SuspendLayout(); this.tlpElementSettingName.SuspendLayout(); - this.menuStrip1.SuspendLayout(); + this.menuStripOptions.SuspendLayout(); this.tlpMenuAndContent.SuspendLayout(); this.SuspendLayout(); // @@ -786,16 +786,16 @@ private void InitializeComponent() this.lblMoveName.Text = "Name:"; this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // menuStrip1 + // menuStripOptions // - this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStripOptions.Dock = System.Windows.Forms.DockStyle.None; + this.menuStripOptions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripFileOptions}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(45, 20); - this.menuStrip1.TabIndex = 8; - this.menuStrip1.Text = "menuStrip1"; + this.menuStripOptions.Location = new System.Drawing.Point(0, 0); + this.menuStripOptions.Name = "menuStripOptions"; + this.menuStripOptions.Size = new System.Drawing.Size(45, 20); + this.menuStripOptions.TabIndex = 8; + this.menuStripOptions.Text = "menuStrip1"; // // toolStripFileOptions // @@ -847,7 +847,7 @@ private void InitializeComponent() // this.tlpMenuAndContent.ColumnCount = 1; this.tlpMenuAndContent.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpMenuAndContent.Controls.Add(this.menuStrip1, 0, 0); + this.tlpMenuAndContent.Controls.Add(this.menuStripOptions, 0, 0); this.tlpMenuAndContent.Controls.Add(this.tlpContentAndMargin, 0, 1); this.tlpMenuAndContent.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpMenuAndContent.Location = new System.Drawing.Point(0, 0); @@ -866,9 +866,10 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(1105, 715); this.Controls.Add(this.tlpMenuAndContent); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStrip1; + this.MainMenuStrip = this.menuStripOptions; this.MinimumSize = new System.Drawing.Size(1121, 100); this.Name = "Main"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "MovementScriptGenerator"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); this.tlpContentAndMargin.ResumeLayout(false); @@ -895,8 +896,8 @@ private void InitializeComponent() this.tlpElementSettingType.PerformLayout(); this.tlpElementSettingName.ResumeLayout(false); this.tlpElementSettingName.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); + this.menuStripOptions.ResumeLayout(false); + this.menuStripOptions.PerformLayout(); this.tlpMenuAndContent.ResumeLayout(false); this.tlpMenuAndContent.PerformLayout(); this.ResumeLayout(false); @@ -948,7 +949,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnElementDelete; private System.Windows.Forms.Button btnEditScriptPath; private System.Windows.Forms.Button btnInsert; - private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.MenuStrip menuStripOptions; private System.Windows.Forms.ToolStripMenuItem toolStripFileOptions; private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/MainForm.cs similarity index 97% rename from MovementScriptGenerator/Form1.cs rename to MovementScriptGenerator/MainForm.cs index 4de5a1c..fdbfd29 100644 --- a/MovementScriptGenerator/Form1.cs +++ b/MovementScriptGenerator/MainForm.cs @@ -63,6 +63,7 @@ public Main() private void InitializeComponentView() { + WindowState = (FormWindowState)Settings.Default.WindowState; if(Settings.Default.WindowLocation != new System.Drawing.Point()) { StartPosition = FormStartPosition.Manual; @@ -103,7 +104,6 @@ private bool LoadLastChain() /// private Chain TryLoadChainFromFile(string fullName) { - //TODO creates a chain out of non chain files. Return null in that case Chain loadedChain = null; if (File.Exists(fullName)) { @@ -120,7 +120,8 @@ private Chain TryLoadChainFromFile(string fullName) { return null; } - if(loadedChain.DirectoryPath == null || loadedChain.FullName == null) + //Loaded file can't be a chain without fullName property + if(loadedChain.FullName == null) { return null; } @@ -859,7 +860,11 @@ private void Main_FormClosing(object sender, FormClosingEventArgs e) } //Saving general settings - Settings.Default.WindowLocation = Location; + if(WindowState != FormWindowState.Minimized) + { + Settings.Default.WindowState = (int)WindowState; + Settings.Default.WindowLocation = Location; + } if (WindowState == FormWindowState.Normal) { Settings.Default.WindowSize = Size; @@ -872,7 +877,7 @@ private void Main_FormClosing(object sender, FormClosingEventArgs e) //Saving settings of current chain Settings.Default.ChainFullName = chain.FullName; - Settings.Default.ChainDirectoryPath = chain.DirectoryPath; + Settings.Default.ChainDirectoryPath = Path.GetDirectoryName(chain.FullName); Settings.Default.Save(); } @@ -932,11 +937,10 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) txtChainName.Text = "NewChain"; } dialog.DefaultFileName = txtChainName.Text; - dialog.InitialDirectory = GetnitialDirectoryForChainFiles(); + dialog.InitialDirectory = GetInitialDirectoryForChainFiles(); if(dialog.ShowDialog() == CommonFileDialogResult.Ok) { chain.FullName = dialog.FileName; - chain.DirectoryPath = Path.GetDirectoryName(dialog.FileName); SaveChain(chain.FullName); } } @@ -986,7 +990,7 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e) } CommonOpenFileDialog dialog = new CommonOpenFileDialog(); - dialog.InitialDirectory = GetnitialDirectoryForChainFiles(); + dialog.InitialDirectory = GetInitialDirectoryForChainFiles(); if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { Chain chainFromOpenedFile = TryLoadChainFromFile(dialog.FileName); @@ -1005,7 +1009,6 @@ private void UseNewChain(Chain newChain, CommonOpenFileDialog dialogOfNewChain) { chain = newChain; chain.FullName = dialogOfNewChain.FileName; - chain.DirectoryPath = Path.GetDirectoryName(dialogOfNewChain.FileName); txtChainName.Text = chain.Name; UpdateChainWindow(); } @@ -1033,11 +1036,11 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e) UpdateChainWindow(); } - private string GetnitialDirectoryForChainFiles() + private string GetInitialDirectoryForChainFiles() { - if (Directory.Exists(chain.DirectoryPath)) + if (Directory.Exists(Path.GetDirectoryName(chain.FullName))) { - return chain.DirectoryPath; + return Path.GetDirectoryName(chain.FullName); } if (Directory.Exists(savedChainDirectoryPath)) diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/MainForm.resx similarity index 98% rename from MovementScriptGenerator/Form1.resx rename to MovementScriptGenerator/MainForm.resx index 00faafd..cc618ee 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/MainForm.resx @@ -149,7 +149,7 @@ other elements - elements that influence/augment moves. These elements can't function on their own and always need corresponding move elements. - + 109, 17 diff --git a/MovementScriptGenerator/Modules/Chain.cs b/MovementScriptGenerator/Modules/Chain.cs index fdfe4d0..4b3bd91 100644 --- a/MovementScriptGenerator/Modules/Chain.cs +++ b/MovementScriptGenerator/Modules/Chain.cs @@ -6,7 +6,6 @@ public class Chain { public string Name { get; set; } public string FullName { get; set; } - public string DirectoryPath { get; set; } public List Elements { get; set; } } } diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 65314d0..05d2e2a 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -65,11 +65,11 @@ - + Form - - Form1.cs + + MainForm.cs @@ -103,8 +103,8 @@ CircleControl.cs - - Form1.cs + + MainForm.cs ResXFileCodeGenerator diff --git a/MovementScriptGenerator/Properties/Settings.Designer.cs b/MovementScriptGenerator/Properties/Settings.Designer.cs index e22c0cd..81b4616 100644 --- a/MovementScriptGenerator/Properties/Settings.Designer.cs +++ b/MovementScriptGenerator/Properties/Settings.Designer.cs @@ -82,5 +82,17 @@ public string ChainDirectoryPath { this["WindowSize"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int WindowState { + get { + return ((int)(this["WindowState"])); + } + set { + this["WindowState"] = value; + } + } } } diff --git a/MovementScriptGenerator/Properties/Settings.settings b/MovementScriptGenerator/Properties/Settings.settings index e33ca16..b32c246 100644 --- a/MovementScriptGenerator/Properties/Settings.settings +++ b/MovementScriptGenerator/Properties/Settings.settings @@ -17,5 +17,8 @@ 923, 754 + + 0 + \ No newline at end of file From 231d618940a8b811d4922f4e3addc8a5402de2c1 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Fri, 30 Dec 2022 15:59:13 +0100 Subject: [PATCH 17/21] - fixed some naming mistakes on ChainElementControls - comboBoxes and numericUpDowns of ChainElementControls will now not change value by scrolling --- .../CircleControl.Designer.cs | 55 +++++++++-------- MovementScriptGenerator/CircleControl.cs | 6 ++ .../MovementScriptGenerator.csproj | 1 + .../RepeatControl.Designer.cs | 41 +++++++------ MovementScriptGenerator/RepeatControl.cs | 6 ++ MovementScriptGenerator/ScrollEventDisable.cs | 31 ++++++++++ .../SpiralControl.Designer.cs | 61 ++++++++++--------- MovementScriptGenerator/SpiralControl.cs | 6 ++ 8 files changed, 130 insertions(+), 77 deletions(-) create mode 100644 MovementScriptGenerator/ScrollEventDisable.cs diff --git a/MovementScriptGenerator/CircleControl.Designer.cs b/MovementScriptGenerator/CircleControl.Designer.cs index a2f027d..6b5cfd9 100644 --- a/MovementScriptGenerator/CircleControl.Designer.cs +++ b/MovementScriptGenerator/CircleControl.Designer.cs @@ -31,7 +31,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CircleControl)); - this.lfCircleControl = new System.Windows.Forms.FlowLayoutPanel(); + this.flpCircleControl = new System.Windows.Forms.FlowLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.numDistance = new System.Windows.Forms.NumericUpDown(); this.lblDistance = new System.Windows.Forms.Label(); @@ -63,7 +63,7 @@ private void InitializeComponent() this.numDuration = new System.Windows.Forms.NumericUpDown(); this.lblDuration = new System.Windows.Forms.Label(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.lfCircleControl.SuspendLayout(); + this.flpCircleControl.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numDistance)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); @@ -85,27 +85,27 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.numDuration)).BeginInit(); this.SuspendLayout(); // - // lfCircleControl - // - this.lfCircleControl.AutoSize = true; - this.lfCircleControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.lfCircleControl.Controls.Add(this.tableLayoutPanel1); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel2); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel3); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel4); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel5); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel6); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel7); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel10); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel8); - this.lfCircleControl.Controls.Add(this.tableLayoutPanel9); - this.lfCircleControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.lfCircleControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.lfCircleControl.Location = new System.Drawing.Point(0, 0); - this.lfCircleControl.Margin = new System.Windows.Forms.Padding(0); - this.lfCircleControl.Name = "lfCircleControl"; - this.lfCircleControl.Size = new System.Drawing.Size(260, 327); - this.lfCircleControl.TabIndex = 0; + // flpCircleControl + // + this.flpCircleControl.AutoSize = true; + this.flpCircleControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flpCircleControl.Controls.Add(this.tableLayoutPanel1); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel2); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel3); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel4); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel5); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel6); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel7); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel10); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel8); + this.flpCircleControl.Controls.Add(this.tableLayoutPanel9); + this.flpCircleControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpCircleControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flpCircleControl.Location = new System.Drawing.Point(0, 0); + this.flpCircleControl.Margin = new System.Windows.Forms.Padding(0); + this.flpCircleControl.Name = "flpCircleControl"; + this.flpCircleControl.Size = new System.Drawing.Size(260, 327); + this.flpCircleControl.TabIndex = 0; // // tableLayoutPanel1 // @@ -596,11 +596,12 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.Controls.Add(this.lfCircleControl); + this.Controls.Add(this.flpCircleControl); this.Name = "CircleControl"; this.Size = new System.Drawing.Size(260, 327); - this.lfCircleControl.ResumeLayout(false); - this.lfCircleControl.PerformLayout(); + this.Load += new System.EventHandler(this.CircleControl_Load); + this.flpCircleControl.ResumeLayout(false); + this.flpCircleControl.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numDistance)).EndInit(); @@ -637,7 +638,7 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.FlowLayoutPanel lfCircleControl; + private System.Windows.Forms.FlowLayoutPanel flpCircleControl; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.ToolTip ToolTip; diff --git a/MovementScriptGenerator/CircleControl.cs b/MovementScriptGenerator/CircleControl.cs index d693ab6..c224b35 100644 --- a/MovementScriptGenerator/CircleControl.cs +++ b/MovementScriptGenerator/CircleControl.cs @@ -18,6 +18,12 @@ public CircleControl() initializeComboBoxes(); } + private void CircleControl_Load(object sender, System.EventArgs e) + { + ScrollEventDisable scrollEventDisable = new ScrollEventDisable(); + scrollEventDisable.DisableScrollForChainElementControls(sender, e, Controls[0]); + } + private void initializeComboBoxes() { cbRotation.DataSource = rotationTypes; diff --git a/MovementScriptGenerator/MovementScriptGenerator.csproj b/MovementScriptGenerator/MovementScriptGenerator.csproj index 05d2e2a..cdcfcec 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -94,6 +94,7 @@ RepeatControl.cs + UserControl diff --git a/MovementScriptGenerator/RepeatControl.Designer.cs b/MovementScriptGenerator/RepeatControl.Designer.cs index e50804f..7cb08f7 100644 --- a/MovementScriptGenerator/RepeatControl.Designer.cs +++ b/MovementScriptGenerator/RepeatControl.Designer.cs @@ -29,34 +29,34 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.lfSpiralControl = new System.Windows.Forms.FlowLayoutPanel(); + this.flpSpiralControl = new System.Windows.Forms.FlowLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.numStartElement = new System.Windows.Forms.NumericUpDown(); this.lblStartElement = new System.Windows.Forms.Label(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.numEndElement = new System.Windows.Forms.NumericUpDown(); this.lblEndDistance = new System.Windows.Forms.Label(); - this.lfSpiralControl.SuspendLayout(); + this.flpSpiralControl.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numStartElement)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numEndElement)).BeginInit(); this.SuspendLayout(); // - // lfSpiralControl - // - this.lfSpiralControl.AutoSize = true; - this.lfSpiralControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel1); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel2); - this.lfSpiralControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.lfSpiralControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.lfSpiralControl.Location = new System.Drawing.Point(0, 0); - this.lfSpiralControl.Margin = new System.Windows.Forms.Padding(0); - this.lfSpiralControl.MaximumSize = new System.Drawing.Size(290, 0); - this.lfSpiralControl.Name = "lfSpiralControl"; - this.lfSpiralControl.Size = new System.Drawing.Size(258, 70); - this.lfSpiralControl.TabIndex = 2; + // flpSpiralControl + // + this.flpSpiralControl.AutoSize = true; + this.flpSpiralControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel1); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel2); + this.flpSpiralControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpSpiralControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flpSpiralControl.Location = new System.Drawing.Point(0, 0); + this.flpSpiralControl.Margin = new System.Windows.Forms.Padding(0); + this.flpSpiralControl.MaximumSize = new System.Drawing.Size(290, 0); + this.flpSpiralControl.Name = "flpSpiralControl"; + this.flpSpiralControl.Size = new System.Drawing.Size(258, 70); + this.flpSpiralControl.TabIndex = 2; // // tableLayoutPanel1 // @@ -160,11 +160,12 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.Controls.Add(this.lfSpiralControl); + this.Controls.Add(this.flpSpiralControl); this.Name = "RepeatControl"; this.Size = new System.Drawing.Size(258, 70); - this.lfSpiralControl.ResumeLayout(false); - this.lfSpiralControl.PerformLayout(); + this.Load += new System.EventHandler(this.RepeatControl_Load); + this.flpSpiralControl.ResumeLayout(false); + this.flpSpiralControl.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numStartElement)).EndInit(); @@ -178,7 +179,7 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.FlowLayoutPanel lfSpiralControl; + private System.Windows.Forms.FlowLayoutPanel flpSpiralControl; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.NumericUpDown numStartElement; private System.Windows.Forms.Label lblStartElement; diff --git a/MovementScriptGenerator/RepeatControl.cs b/MovementScriptGenerator/RepeatControl.cs index 2054fcf..c3c93ad 100644 --- a/MovementScriptGenerator/RepeatControl.cs +++ b/MovementScriptGenerator/RepeatControl.cs @@ -18,6 +18,12 @@ public RepeatControl() InitializeComponent(); } + private void RepeatControl_Load(object sender, EventArgs e) + { + ScrollEventDisable scrollEventDisable = new ScrollEventDisable(); + scrollEventDisable.DisableScrollForChainElementControls(sender, e, Controls[0]); + } + public bool Populate(Repeat original) { try diff --git a/MovementScriptGenerator/ScrollEventDisable.cs b/MovementScriptGenerator/ScrollEventDisable.cs new file mode 100644 index 0000000..a5353cc --- /dev/null +++ b/MovementScriptGenerator/ScrollEventDisable.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MovementScriptGenerator +{ + class ScrollEventDisable + { + public void DisableScrollForChainElementControls(object sender, EventArgs e, Control mainFlpOfControl) + { + foreach (Control ctl in mainFlpOfControl.Controls) + { + foreach (Control ctlOfctl in ctl.Controls) + { + if (ctlOfctl.GetType() == typeof(NumericUpDown) || ctlOfctl.GetType() == typeof(ComboBox)) + { + ctlOfctl.MouseWheel += Ctl_MouseWheel; + } + } + } + } + + private void Ctl_MouseWheel(object sender, MouseEventArgs e) + { + ((HandledMouseEventArgs)e).Handled = true; + } + } +} diff --git a/MovementScriptGenerator/SpiralControl.Designer.cs b/MovementScriptGenerator/SpiralControl.Designer.cs index 4391fac..9c62f6c 100644 --- a/MovementScriptGenerator/SpiralControl.Designer.cs +++ b/MovementScriptGenerator/SpiralControl.Designer.cs @@ -30,7 +30,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.lfSpiralControl = new System.Windows.Forms.FlowLayoutPanel(); + this.flpSpiralControl = new System.Windows.Forms.FlowLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.numStartDistance = new System.Windows.Forms.NumericUpDown(); this.lblStartDistance = new System.Windows.Forms.Label(); @@ -68,7 +68,7 @@ private void InitializeComponent() this.checkEase = new System.Windows.Forms.CheckBox(); this.lblEase = new System.Windows.Forms.Label(); this.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.lfSpiralControl.SuspendLayout(); + this.flpSpiralControl.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numStartDistance)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); @@ -93,30 +93,30 @@ private void InitializeComponent() this.tableLayoutPanel12.SuspendLayout(); this.SuspendLayout(); // - // lfSpiralControl - // - this.lfSpiralControl.AutoSize = true; - this.lfSpiralControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel1); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel2); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel11); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel3); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel10); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel6); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel8); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel9); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel4); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel5); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel7); - this.lfSpiralControl.Controls.Add(this.tableLayoutPanel12); - this.lfSpiralControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.lfSpiralControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.lfSpiralControl.Location = new System.Drawing.Point(0, 0); - this.lfSpiralControl.Margin = new System.Windows.Forms.Padding(0); - this.lfSpiralControl.MaximumSize = new System.Drawing.Size(290, 0); - this.lfSpiralControl.Name = "lfSpiralControl"; - this.lfSpiralControl.Size = new System.Drawing.Size(260, 385); - this.lfSpiralControl.TabIndex = 1; + // flpSpiralControl + // + this.flpSpiralControl.AutoSize = true; + this.flpSpiralControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel1); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel2); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel11); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel3); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel10); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel6); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel8); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel9); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel4); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel5); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel7); + this.flpSpiralControl.Controls.Add(this.tableLayoutPanel12); + this.flpSpiralControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.flpSpiralControl.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flpSpiralControl.Location = new System.Drawing.Point(0, 0); + this.flpSpiralControl.Margin = new System.Windows.Forms.Padding(0); + this.flpSpiralControl.MaximumSize = new System.Drawing.Size(290, 0); + this.flpSpiralControl.Name = "flpSpiralControl"; + this.flpSpiralControl.Size = new System.Drawing.Size(260, 385); + this.flpSpiralControl.TabIndex = 1; // // tableLayoutPanel1 // @@ -689,12 +689,13 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.Controls.Add(this.lfSpiralControl); + this.Controls.Add(this.flpSpiralControl); this.MaximumSize = new System.Drawing.Size(290, 0); this.Name = "SpiralControl"; this.Size = new System.Drawing.Size(260, 385); - this.lfSpiralControl.ResumeLayout(false); - this.lfSpiralControl.PerformLayout(); + this.Load += new System.EventHandler(this.SpiralControl_Load); + this.flpSpiralControl.ResumeLayout(false); + this.flpSpiralControl.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numStartDistance)).EndInit(); @@ -736,7 +737,7 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.FlowLayoutPanel lfSpiralControl; + private System.Windows.Forms.FlowLayoutPanel flpSpiralControl; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.NumericUpDown numStartDistance; private System.Windows.Forms.Label lblStartDistance; diff --git a/MovementScriptGenerator/SpiralControl.cs b/MovementScriptGenerator/SpiralControl.cs index d009217..79f40cd 100644 --- a/MovementScriptGenerator/SpiralControl.cs +++ b/MovementScriptGenerator/SpiralControl.cs @@ -19,6 +19,12 @@ public SpiralControl() initializeComboBoxes(); } + private void SpiralControl_Load(object sender, EventArgs e) + { + ScrollEventDisable scrollEventDisable = new ScrollEventDisable(); + scrollEventDisable.DisableScrollForChainElementControls(sender, e, Controls[0]); + } + private void initializeComboBoxes() { cbSpiralRotation.DataSource = rotationTypes; From cd6c20b74fd999b7743cce6ef385800aadefbb82 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Tue, 3 Jan 2023 17:56:11 +0100 Subject: [PATCH 18/21] - removed finished todo --- MovementScriptGenerator/MainForm.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/MovementScriptGenerator/MainForm.cs b/MovementScriptGenerator/MainForm.cs index fdbfd29..6825748 100644 --- a/MovementScriptGenerator/MainForm.cs +++ b/MovementScriptGenerator/MainForm.cs @@ -844,8 +844,6 @@ private void tvChain_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEvent private void Main_FormClosing(object sender, FormClosingEventArgs e) { - //TODO Save Window Format (Fullscreen or not?) - if (CheckUnsavedChanges()) { DialogResult saveChanges = MessageBox.Show("Would you like to save your changes?", "Save changes", MessageBoxButtons.YesNoCancel); From 088b9e7a0046c69267f56cb03c45e3faddd6e120 Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Tue, 3 Jan 2023 20:10:31 +0100 Subject: [PATCH 19/21] Added check for debug/release mode because the location of the ChainElement-icon's directory changes for release --- MovementScriptGenerator/MainForm.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MovementScriptGenerator/MainForm.cs b/MovementScriptGenerator/MainForm.cs index 6825748..7493f50 100644 --- a/MovementScriptGenerator/MainForm.cs +++ b/MovementScriptGenerator/MainForm.cs @@ -29,7 +29,12 @@ public partial class Main : Form private static readonly string defaultInitialDirectory = "C:\\Users"; //Info for Icons + //Icon-Folder-Location changes in release version. That's why we check if we are currently in debug or release mode and change the path accordingly +#if DEBUG private static readonly DirectoryInfo iconsDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.Parent.GetDirectories().Where(directory => directory.Name == "Icons").FirstOrDefault(); +#else + private static readonly DirectoryInfo iconsDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()).GetDirectories().Where(directory => directory.Name == "Icons").FirstOrDefault(); +#endif private static readonly string iconsDataType = ".png"; //Other Info From 129084dc929053e2ae48c333fb8275d53c746dfd Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Tue, 3 Jan 2023 20:33:11 +0100 Subject: [PATCH 20/21] updated assembly version to 2.0.0.0 --- MovementScriptGenerator/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MovementScriptGenerator/Properties/AssemblyInfo.cs b/MovementScriptGenerator/Properties/AssemblyInfo.cs index 0b7df03..32463e7 100644 --- a/MovementScriptGenerator/Properties/AssemblyInfo.cs +++ b/MovementScriptGenerator/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] From 0049620cf207744fe49da13aa6706cf2bac4877b Mon Sep 17 00:00:00 2001 From: DragonirHD Date: Tue, 3 Jan 2023 23:21:58 +0100 Subject: [PATCH 21/21] - small tweaks for UI - added more Tooltips --- MovementScriptGenerator.sln | 4 ++-- MovementScriptGenerator/MainForm.Designer.cs | 21 ++++++++++++++----- MovementScriptGenerator/MainForm.cs | 2 +- .../RepeatControl.Designer.cs | 13 ++++++++++++ MovementScriptGenerator/RepeatControl.resx | 3 +++ 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/MovementScriptGenerator.sln b/MovementScriptGenerator.sln index 79833bf..4b6d412 100644 --- a/MovementScriptGenerator.sln +++ b/MovementScriptGenerator.sln @@ -13,8 +13,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {779FE5F9-F0F3-4EF3-8D9A-E8D7AEA8D29D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {779FE5F9-F0F3-4EF3-8D9A-E8D7AEA8D29D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {779FE5F9-F0F3-4EF3-8D9A-E8D7AEA8D29D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {779FE5F9-F0F3-4EF3-8D9A-E8D7AEA8D29D}.Release|Any CPU.Build.0 = Release|Any CPU + {779FE5F9-F0F3-4EF3-8D9A-E8D7AEA8D29D}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {779FE5F9-F0F3-4EF3-8D9A-E8D7AEA8D29D}.Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MovementScriptGenerator/MainForm.Designer.cs b/MovementScriptGenerator/MainForm.Designer.cs index c2d6309..68ff9b1 100644 --- a/MovementScriptGenerator/MainForm.Designer.cs +++ b/MovementScriptGenerator/MainForm.Designer.cs @@ -190,6 +190,8 @@ private void InitializeComponent() this.btnGenerateScript.Size = new System.Drawing.Size(115, 23); this.btnGenerateScript.TabIndex = 10; this.btnGenerateScript.Text = "Generate Script"; + this.ToolTip.SetToolTip(this.btnGenerateScript, "Generates a movement script file of the current chain\'s moves in the given direct" + + "ory with the given script/file name."); this.btnGenerateScript.UseVisualStyleBackColor = true; this.btnGenerateScript.Click += new System.EventHandler(this.btnGenerateScript_Click); // @@ -224,7 +226,7 @@ private void InitializeComponent() this.lblScriptName.TabIndex = 7; this.lblScriptName.Text = "Script Name"; this.lblScriptName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblScriptName, "defines the name of the movement script file that will be generated / added to.\r\n" + + this.ToolTip.SetToolTip(this.lblScriptName, "Defines the name of the movement script file that will be generated / added to.\r\n" + "Add this name to the script list in your camera\'s Json file to make the camera u" + "se this script.\r\n"); // @@ -336,17 +338,17 @@ private void InitializeComponent() this.lblChainName.AutoSize = true; this.lblChainName.Location = new System.Drawing.Point(3, 0); this.lblChainName.Name = "lblChainName"; - this.lblChainName.Size = new System.Drawing.Size(35, 26); + this.lblChainName.Size = new System.Drawing.Size(38, 26); this.lblChainName.TabIndex = 1; - this.lblChainName.Text = "Name"; + this.lblChainName.Text = "Name:"; this.lblChainName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ToolTip.SetToolTip(this.lblChainName, "defines the name of movement script file that will be generated / added to.\r\nAdd " + + this.ToolTip.SetToolTip(this.lblChainName, "Defines the name of movement script file that will be generated / added to.\r\nAdd " + "this name to the script list in your camera script to make the camera use this s" + "cript.\r\n"); // // txtChainName // - this.txtChainName.Location = new System.Drawing.Point(44, 3); + this.txtChainName.Location = new System.Drawing.Point(47, 3); this.txtChainName.Name = "txtChainName"; this.txtChainName.Size = new System.Drawing.Size(149, 20); this.txtChainName.TabIndex = 2; @@ -451,6 +453,7 @@ private void InitializeComponent() this.btnElementMoveDown.Size = new System.Drawing.Size(55, 26); this.btnElementMoveDown.TabIndex = 2; this.btnElementMoveDown.Text = "↓"; + this.ToolTip.SetToolTip(this.btnElementMoveDown, "Moves the selected element one place down in the chain."); this.btnElementMoveDown.UseVisualStyleBackColor = true; this.btnElementMoveDown.Click += new System.EventHandler(this.btnElementMoveDown_Click); // @@ -464,6 +467,7 @@ private void InitializeComponent() this.btnElementMoveUp.Size = new System.Drawing.Size(54, 26); this.btnElementMoveUp.TabIndex = 1; this.btnElementMoveUp.Text = "↑"; + this.ToolTip.SetToolTip(this.btnElementMoveUp, "Moves the selected element one place up in the chain."); this.btnElementMoveUp.UseVisualStyleBackColor = true; this.btnElementMoveUp.Click += new System.EventHandler(this.btnElementMoveUp_Click); // @@ -478,6 +482,8 @@ private void InitializeComponent() this.btnElementDuplicate.Size = new System.Drawing.Size(115, 23); this.btnElementDuplicate.TabIndex = 2; this.btnElementDuplicate.Text = "Duplicate"; + this.ToolTip.SetToolTip(this.btnElementDuplicate, "creates a copy of the selected element and adds it to the chain below the selecte" + + "d element."); this.btnElementDuplicate.UseVisualStyleBackColor = true; this.btnElementDuplicate.Click += new System.EventHandler(this.btnElementDuplicate_Click); // @@ -492,6 +498,9 @@ private void InitializeComponent() this.btnElementGetSettings.Size = new System.Drawing.Size(115, 23); this.btnElementGetSettings.TabIndex = 3; this.btnElementGetSettings.Text = "Get Settings"; + this.ToolTip.SetToolTip(this.btnElementGetSettings, "displays the settings of the selected element in the element settings tab.\r\nUsefu" + + "l for tweaking specific settings and then applying them again to the selected el" + + "ement."); this.btnElementGetSettings.UseVisualStyleBackColor = true; this.btnElementGetSettings.Click += new System.EventHandler(this.btnElementGetSettings_Click); // @@ -506,6 +515,7 @@ private void InitializeComponent() this.btnElementDelete.Size = new System.Drawing.Size(115, 23); this.btnElementDelete.TabIndex = 4; this.btnElementDelete.Text = "Delete"; + this.ToolTip.SetToolTip(this.btnElementDelete, "removes the selected element from the chain."); this.btnElementDelete.UseVisualStyleBackColor = true; this.btnElementDelete.Click += new System.EventHandler(this.btnElementDelete_Click); // @@ -785,6 +795,7 @@ private void InitializeComponent() this.lblMoveName.TabIndex = 1; this.lblMoveName.Text = "Name:"; this.lblMoveName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblMoveName, "The displayed name of the element."); // // menuStripOptions // diff --git a/MovementScriptGenerator/MainForm.cs b/MovementScriptGenerator/MainForm.cs index 7493f50..36bd692 100644 --- a/MovementScriptGenerator/MainForm.cs +++ b/MovementScriptGenerator/MainForm.cs @@ -50,7 +50,7 @@ public partial class Main : Form "The camera will move in a circle around the player.", "The camera will move from the starting distance to the end distance while spinning around its axis, creating a spiralling shot.", "The camera will move from the given direction towards the player. Then at a surtain point, it will do a 180 degree turn, making the move into something that resembles a J.\nCurrently not implemented!", - "Repeats the elements that are in the given range. The elements at the start position and end position will also be repeated." + "Repeats the elements that are in the given range. The start element and the end element will also be repeated." }; public Main() diff --git a/MovementScriptGenerator/RepeatControl.Designer.cs b/MovementScriptGenerator/RepeatControl.Designer.cs index 7cb08f7..2e7b509 100644 --- a/MovementScriptGenerator/RepeatControl.Designer.cs +++ b/MovementScriptGenerator/RepeatControl.Designer.cs @@ -29,6 +29,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.flpSpiralControl = new System.Windows.Forms.FlowLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.numStartElement = new System.Windows.Forms.NumericUpDown(); @@ -36,6 +37,7 @@ private void InitializeComponent() this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.numEndElement = new System.Windows.Forms.NumericUpDown(); this.lblEndDistance = new System.Windows.Forms.Label(); + this.ToolTip = new System.Windows.Forms.ToolTip(this.components); this.flpSpiralControl.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numStartElement)).BeginInit(); @@ -106,6 +108,7 @@ private void InitializeComponent() this.lblStartElement.TabIndex = 2; this.lblStartElement.Text = "Start Element"; this.lblStartElement.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblStartElement, "The index/number of the first element that will be repeated."); // // tableLayoutPanel2 // @@ -153,6 +156,15 @@ private void InitializeComponent() this.lblEndDistance.TabIndex = 2; this.lblEndDistance.Text = "End Element"; this.lblEndDistance.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ToolTip.SetToolTip(this.lblEndDistance, "The index/number of the last element that will be repeated.\r\nAll elements between" + + " the first and last element will also be repeated."); + // + // ToolTip + // + this.ToolTip.AutoPopDelay = 32767; + this.ToolTip.InitialDelay = 500; + this.ToolTip.IsBalloon = true; + this.ToolTip.ReshowDelay = 100; // // RepeatControl // @@ -186,5 +198,6 @@ private void InitializeComponent() private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.NumericUpDown numEndElement; private System.Windows.Forms.Label lblEndDistance; + private System.Windows.Forms.ToolTip ToolTip; } } diff --git a/MovementScriptGenerator/RepeatControl.resx b/MovementScriptGenerator/RepeatControl.resx index 1af7de1..71c2de5 100644 --- a/MovementScriptGenerator/RepeatControl.resx +++ b/MovementScriptGenerator/RepeatControl.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file