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/App.config b/MovementScriptGenerator/App.config index 193aecc..6837896 100644 --- a/MovementScriptGenerator/App.config +++ b/MovementScriptGenerator/App.config @@ -1,6 +1,33 @@  + + +
+ + + + + + + + + + + + + + + 0, 0 + + + 923, 754 + + + 0 + + + \ No newline at end of file diff --git a/MovementScriptGenerator/ChainElementsEnum.cs b/MovementScriptGenerator/ChainElementsEnum.cs new file mode 100644 index 0000000..a5d4bbd --- /dev/null +++ b/MovementScriptGenerator/ChainElementsEnum.cs @@ -0,0 +1,11 @@ + +namespace MovementScriptGenerator +{ + enum ChainElementsEnum + { + Circle, + Spiral, + JTurn, + Repeat + } +} 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.Designer.cs b/MovementScriptGenerator/CircleControl.Designer.cs index 75ddc60..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 // @@ -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 // @@ -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 dd566de..c224b35 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() { @@ -27,34 +18,58 @@ 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; cbRotation.SelectedIndex = 0; } - public MovementScript CreateMovementScript() + public bool Populate(Circle original) { - MovementScript movementScript = new MovementScript(); - bool rotateClockwise = false; - if (cbRotation.SelectedIndex == 0) + try { - rotateClockwise = true; + 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; } - movementScript.frames = circle.GenerateFrames( + catch + { + return false; + } + + return true; + } + + public Circle CreateMove(string moveName) + { + 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 + ); - return movementScript; + return circle; } } } 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 deleted file mode 100644 index fff6806..0000000 --- a/MovementScriptGenerator/Form1.Designer.cs +++ /dev/null @@ -1,575 +0,0 @@ - -namespace MovementScriptGenerator -{ - partial class Main - { - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Windows Form-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - 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.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(); - 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.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.ToolTip = new System.Windows.Forms.ToolTip(this.components); - this.tableLayoutPanel1.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.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.Controls.Add(this.lblTitle, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.flpContent, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel11, 1, 2); - 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.TabIndex = 2; - // - // lblTitle - // - this.lblTitle.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lblTitle.AutoSize = true; - 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.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(295, 29); - this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "MovementScriptGenerator"; - // - // 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.Name = "flpContent"; - this.flpContent.Size = new System.Drawing.Size(301, 642); - 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:"; - // - // 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.Controls.Add(this.lblMoveDescriptionTitle, 0, 0); - this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 35); - 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.TabIndex = 28; - // - // lblMoveDescriptionTitle - // - this.lblMoveDescriptionTitle.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(82, 26); - 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, 80); - 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.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(9, 67); - this.tableLayoutPanel7.MaximumSize = new System.Drawing.Size(300, 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.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(245, 26); - this.lblMoveDescription.TabIndex = 25; - this.lblMoveDescription.Text = "Description Text that is here if no description exists"; - // - // 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.Location = new System.Drawing.Point(3, 99); - 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.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.Location = new System.Drawing.Point(3, 131); - 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.TabIndex = 32; - // - // lblDescription - // - this.lblDescription.Location = new System.Drawing.Point(3, 0); - this.lblDescription.Name = "lblDescription"; - this.lblDescription.Size = new System.Drawing.Size(281, 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 - // - 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, 192); - 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; - // - // tableLayoutPanel10 - // - 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.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 - // - 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; - // - // txtPath - // - 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\\"; - // - // lblPath - // - 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"); - // - // ToolTip - // - this.ToolTip.AutoPopDelay = 32767; - this.ToolTip.InitialDelay = 500; - this.ToolTip.IsBalloon = true; - this.ToolTip.ReshowDelay = 100; - // - // Main - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 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.Name = "Main"; - this.Text = "MovementScriptGenerator"; - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.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); - this.tableLayoutPanel7.PerformLayout(); - 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.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label lblTitle; - 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.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 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.TableLayoutPanel tableLayoutPanel11; - 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 tableLayoutPanel9; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel12; - private System.Windows.Forms.Label lblAddToScript; - private System.Windows.Forms.CheckBox checkAddToScript; - } -} - diff --git a/MovementScriptGenerator/Form1.cs b/MovementScriptGenerator/Form1.cs deleted file mode 100644 index 26d15ec..0000000 --- a/MovementScriptGenerator/Form1.cs +++ /dev/null @@ -1,169 +0,0 @@ -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; - -namespace MovementScriptGenerator -{ - public partial class Main : Form - { - CircleControl circleControl = new CircleControl(); - SpiralControl spiralControl = new SpiralControl(); - - 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!" - }; - - public Main() - { - InitializeComponent(); - initializeComboBoxes(); - updateDescription(); - updateContent(); - } - - private void initializeComboBoxes() - { - cbType.DataSource = moveTypes; - cbType.SelectedIndex = 0; - } - - private void updateDescription() - { - lblMoveDescription.Text = moveDescriptions[cbType.SelectedIndex]; - } - - private void updateContent() - { - tlContent.Controls.Clear(); - switch (cbType.SelectedIndex) - { - case 0: - tlContent.Controls.Add(circleControl); - break; - case 1: - tlContent.Controls.Add(spiralControl); - break; - } - } - - private bool GenerateMovementScriptFile(MovementScript script, string path) - { - try - { - using (StreamWriter file = File.CreateText(path)) - { - JsonSerializer serializer = new JsonSerializer(); - serializer.Formatting = Formatting.Indented; - - serializer.Serialize(file, script); - } - return true; - } - catch - { - MessageBox.Show($"File could not be generated.\nPlease dont use any special characters in the file name"); - return false; - } - - } - - private bool AddToMovementScriptFile(MovementScript script, string path) - { - JsonSerializer serializer = new JsonSerializer(); - - if (!File.Exists(path)) - { - MessageBox.Show("File doesn't exist!"); - return false; - } - - string previousFileContent = File.ReadAllText(path); - - try - { - MovementScript previousMovementScript = JsonConvert.DeserializeObject(previousFileContent); - - script.frames.InsertRange(0, previousMovementScript.frames); - - using (StreamWriter file = File.CreateText(path)) - { - 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 btnGenerate_Click(object sender, EventArgs e) - { - string filePath = $@"{txtPath.Text}{txtName.Text}.Json"; - - if (txtName.Text.Replace(" ", String.Empty) == "") - { - MessageBox.Show("Filename is missing!"); - txtName.Focus(); - return; - } - MovementScript movementScript = new MovementScript(); - - switch (cbType.SelectedIndex) - { - case 0: - movementScript = circleControl.CreateMovementScript(); - break; - case 1: - movementScript = spiralControl.CreateMovementScript(); - break; - } - - movementScript.syncToSong = checkSyncToSong.Checked; - - if (checkAddToScript.Checked) - { - if(AddToMovementScriptFile(movementScript, filePath)) - { - MessageBox.Show("Move added to MovementScript"); - }; - } - else - { - if(GenerateMovementScriptFile(movementScript, filePath)) - { - MessageBox.Show("Movement Script generated"); - }; - } - } - - private void cbType_SelectedIndexChanged(object sender, EventArgs e) - { - updateDescription(); - updateContent(); - } - } -} diff --git a/MovementScriptGenerator/Icons/0_Circle_Icon.png b/MovementScriptGenerator/Icons/0_Circle_Icon.png new file mode 100644 index 0000000..f7ab849 Binary files /dev/null and b/MovementScriptGenerator/Icons/0_Circle_Icon.png differ diff --git a/MovementScriptGenerator/Icons/1_Spiral_Icon.png b/MovementScriptGenerator/Icons/1_Spiral_Icon.png new file mode 100644 index 0000000..53a8a61 Binary files /dev/null and b/MovementScriptGenerator/Icons/1_Spiral_Icon.png differ diff --git a/MovementScriptGenerator/Icons/2_JTurn_Icon.png b/MovementScriptGenerator/Icons/2_JTurn_Icon.png new file mode 100644 index 0000000..19bb52b Binary files /dev/null and b/MovementScriptGenerator/Icons/2_JTurn_Icon.png differ diff --git a/MovementScriptGenerator/Icons/3_Repeat_Icon.png b/MovementScriptGenerator/Icons/3_Repeat_Icon.png new file mode 100644 index 0000000..44dc901 Binary files /dev/null and b/MovementScriptGenerator/Icons/3_Repeat_Icon.png differ diff --git a/MovementScriptGenerator/MainForm.Designer.cs b/MovementScriptGenerator/MainForm.Designer.cs new file mode 100644 index 0000000..68ff9b1 --- /dev/null +++ b/MovementScriptGenerator/MainForm.Designer.cs @@ -0,0 +1,979 @@ + +namespace MovementScriptGenerator +{ + partial class Main + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main)); + 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.lblSyncToSong = new System.Windows.Forms.Label(); + this.checkAddToScript = new System.Windows.Forms.CheckBox(); + 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.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.btnElementDelete = new System.Windows.Forms.Button(); + 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.lblElementTitle = new System.Windows.Forms.Label(); + this.flpContent = new System.Windows.Forms.FlowLayoutPanel(); + 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.tlpElementSettingName = new System.Windows.Forms.TableLayoutPanel(); + this.txtElementName = new System.Windows.Forms.TextBox(); + this.lblMoveName = new System.Windows.Forms.Label(); + 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(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ToolTip = new System.Windows.Forms.ToolTip(this.components); + 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.flpElementGeneralSettings.SuspendLayout(); + this.tlpElementSettingType.SuspendLayout(); + this.tlpElementSettingName.SuspendLayout(); + this.menuStripOptions.SuspendLayout(); + this.tlpMenuAndContent.SuspendLayout(); + this.SuspendLayout(); + // + // 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; + // + // btnGenerateScript + // + 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.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); + // + // 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.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 + // + 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(279, 3); + this.checkSyncToSong.Name = "checkSyncToSong"; + this.checkSyncToSong.Size = new System.Drawing.Size(15, 23); + this.checkSyncToSong.TabIndex = 6; + this.checkSyncToSong.UseVisualStyleBackColor = true; + // + // 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(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")); + // + // 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(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 + // + 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, 23); + this.checkLoop.TabIndex = 2; + this.checkLoop.UseVisualStyleBackColor = true; + // + // 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, 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."); + // + // 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.lblChainName.AutoSize = true; + this.lblChainName.Location = new System.Drawing.Point(3, 0); + this.lblChainName.Name = "lblChainName"; + this.lblChainName.Size = new System.Drawing.Size(38, 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"); + // + // txtChainName + // + 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; + 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 + // + 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(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); + // + // 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 + // + 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, 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); + // + // 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, 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); + // + // 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, 35); + 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 = 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); + // + // 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 = 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); + // + // 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, 93); + 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.ToolTip.SetToolTip(this.btnElementDelete, "removes the selected element from the chain."); + this.btnElementDelete.UseVisualStyleBackColor = true; + this.btnElementDelete.Click += new System.EventHandler(this.btnElementDelete_Click); + // + // 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 + // + this.btnAddMoveToChain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.btnAddMoveToChain.AutoSize = true; + this.btnAddMoveToChain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + 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(36, 26); + 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.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 + // + 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(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 = 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; + 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(143, 3); + 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 = 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); + // + // lblElementTitle + // + 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.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, 59); + this.flpContent.Margin = new System.Windows.Forms.Padding(0); + this.flpContent.Name = "flpContent"; + this.flpContent.Size = new System.Drawing.Size(307, 558); + this.flpContent.TabIndex = 3; + this.flpContent.WrapContents = false; + // + // lblElementDescriptionTitle + // + this.lblElementDescriptionTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + 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"; + // + // 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.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 + // + 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; + 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 + // + 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.MiddleLeft; + this.ToolTip.SetToolTip(this.lblMoveName, "The displayed name of the element."); + // + // menuStripOptions + // + this.menuStripOptions.Dock = System.Windows.Forms.DockStyle.None; + this.menuStripOptions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripFileOptions}); + 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 + // + 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 + // + this.ToolTip.AutoPopDelay = 32767; + this.ToolTip.InitialDelay = 500; + 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.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); + 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(1105, 715); + this.Controls.Add(this.tlpMenuAndContent); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + 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); + 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.flpElementGeneralSettings.ResumeLayout(false); + this.tlpElementSettingType.ResumeLayout(false); + this.tlpElementSettingType.PerformLayout(); + this.tlpElementSettingName.ResumeLayout(false); + this.tlpElementSettingName.PerformLayout(); + this.menuStripOptions.ResumeLayout(false); + this.menuStripOptions.PerformLayout(); + this.tlpMenuAndContent.ResumeLayout(false); + this.tlpMenuAndContent.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tlpContentAndMargin; + private System.Windows.Forms.FlowLayoutPanel flpContent; + private System.Windows.Forms.Label lblType; + private System.Windows.Forms.ComboBox cbElementType; + private System.Windows.Forms.Label lblElementSettingsTitle; + private System.Windows.Forms.ToolTip ToolTip; + private System.Windows.Forms.Label lblChainName; + private System.Windows.Forms.Button btnGenerateScript; + private System.Windows.Forms.Label lblElementDescriptionHint; + private System.Windows.Forms.CheckBox checkSyncToSong; + 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.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 tlpElementSettings; + private System.Windows.Forms.Label lblElementTitle; + private System.Windows.Forms.FlowLayoutPanel flpChainSettings; + private System.Windows.Forms.Label lblLoop; + 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 flpElementOptions; + private System.Windows.Forms.Button btnResetMoveSettings; + 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 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.Button btnEditScriptPath; + private System.Windows.Forms.Button btnInsert; + private System.Windows.Forms.MenuStrip menuStripOptions; + 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/MainForm.cs b/MovementScriptGenerator/MainForm.cs new file mode 100644 index 0000000..36bd692 --- /dev/null +++ b/MovementScriptGenerator/MainForm.cs @@ -0,0 +1,1057 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Windows.Forms; +using MovementScriptGenerator.Modules; +using MovementScriptGenerator.Modules.OtherChainElements; +using Newtonsoft.Json; +using Microsoft.WindowsAPICodePack.Dialogs; +using MovementScriptGenerator.Properties; + + +namespace MovementScriptGenerator +{ + public partial class Main : Form + { + //Move controls + CircleControl circleControl = new CircleControl(); + SpiralControl spiralControl = new SpiralControl(); + + //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 + //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 + private static readonly int maxStackDepth = 64; + + Chain chain = new Chain() + { + Elements = 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 elements that are in the given range. The start element and the end element 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(); + OnElementTypeChanged(); + UpdateChainWindow(); + } + + private void InitializeComponentView() + { + WindowState = (FormWindowState)Settings.Default.WindowState; + 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) + { + 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; + } + //Loaded file can't be a chain without fullName property + if(loadedChain.FullName == null) + { + return null; + } + } + } + + return loadedChain; + } + + private void InitializeTextBoxes() + { + txtChainName.Text = chain.Name; + } + + private void InitializeComboBoxes() + { + cbElementType.DataSource = Enum.GetNames(typeof(ChainElementsEnum)); + cbElementType.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() + { + lblElementDescription.Text = elementDescriptions[cbElementType.SelectedIndex]; + } + + private void OnElementTypeChanged() + { + tlpContent.Controls.Clear(); + switch (cbElementType.SelectedIndex) + { + case 0: + tlpContent.Controls.Add(circleControl); + break; + case 1: + tlpContent.Controls.Add(spiralControl); + break; + case 3: + tlpContent.Controls.Add(repeatControl); + break; + } + } + + private void ResetDisplayedElementSettings() + { + txtElementName.Text = string.Empty; + if(tlpContent.Controls.Count == 0) + { + return; + } + switch (tlpContent.Controls[0]) + { + case CircleControl _: + circleControl = new CircleControl(); + break; + case SpiralControl _: + spiralControl = new SpiralControl(); + break; + case RepeatControl _: + repeatControl = new RepeatControl(); + break; + default: + break; + } + } + + private void UpdateChainWindow() + { + tvChain.BeginUpdate(); + tvChain.Nodes.Clear(); + for (int i = 0; i < chain.Elements.Count; i++) + { + ChainElement currentElement = chain.Elements[i]; + tvChain.Nodes.Add(string.Empty, $"{i + 1}. {currentElement.Name}", currentElement.IconIndex, currentElement.IconIndex); + } + if (tvChain.Nodes.Count > 0) + { + tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1]; + } + if (tvChain.SelectedNode == null) + { + DisableElementOptionsAll(); + } + tvChain.EndUpdate(); + } + + private void UpdateChainWindow(int indexOfNodeToBeSelected) + { + //TODO Dont scroll to top on update + tvChain.BeginUpdate(); + tvChain.Nodes.Clear(); + for(int i = 0; i < chain.Elements.Count; i++) + { + ChainElement currentElement = chain.Elements[i]; + tvChain.Nodes.Add(string.Empty, $"{i + 1}. {currentElement.Name}", currentElement.IconIndex, currentElement.IconIndex); + } + if(indexOfNodeToBeSelected < tvChain.Nodes.Count) + { + tvChain.SelectedNode = tvChain.Nodes[indexOfNodeToBeSelected]; + } + else + { + 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) + { + if (File.Exists(filePath)) + { + 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; + } + } + + try + { + using (StreamWriter file = File.CreateText(filePath)) + { + JsonSerializer serializer = new JsonSerializer(); + serializer.Formatting = Formatting.Indented; + + serializer.Serialize(file, script); + } + return true; + } + catch + { + 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 cbElementType_SelectedIndexChanged(object sender, EventArgs e) + { + UpdateDescription(); + OnElementTypeChanged(); + } + + private void btnAddElementToChain_Click(object sender, EventArgs e) + { + string ElementName = txtElementName.Text; + if (!ElementNameValid(ElementName)) + { + ElementName = null; + } + + switch (cbElementType.SelectedIndex) + { + case (int)ChainElementsEnum.Circle: + Circle circle = circleControl.CreateMove(ElementName); + chain.Elements.Add(circle); + break; + case (int)ChainElementsEnum.Spiral: + Spiral spiral = spiralControl.CreateMove(ElementName); + chain.Elements.Add(spiral); + break; + case (int)ChainElementsEnum.Repeat: + if (repeatControl.ValidateInputs()) + { + Repeat repeat = repeatControl.CreateElement(ElementName); + 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 element to chain."); + return; + } + + UpdateChainWindow(); + } + + private void btnGenerateScript_Click(object sender, EventArgs e) + { + if (txtScriptName.Text.Replace(" ", string.Empty) == string.Empty) + { + MessageBox.Show($"Can't generate a movement script without a script name.\nPlease enter a name for the movement script."); + txtScriptName.Focus(); + return; + } + + string scriptName = txtScriptName.Text; + + if (scriptName.IndexOfAny(illegalCharsForExplorer) != -1) + { + 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(generateScriptPath)) + { + 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 elements.\nPlease add elements to the chain before trying to generate a movement script."); + cbElementType.Focus(); + return; + } + + MovementScript movementScript = new MovementScript() + { + Frames = AddFramesToScript(chain), + SyncToSong = checkSyncToSong.Checked, + Loop = checkLoop.Checked + }; + + if(movementScript.Frames == null) + { + 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; + } + + 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"); + }; + } + else + { + if (GenerateMovementScriptFile(movementScript, filePath)) + { + MessageBox.Show("Movement script generated"); + }; + } + } + + /// + /// 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; + 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); + 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(); + + 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("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) + { + ResetDisplayedElementSettings(); + OnElementTypeChanged(); + } + + private void btnElementApplySettings_Click(object sender, EventArgs e) + { + string newElementName = txtElementName.Text; + if (!ElementNameValid(newElementName)) + { + newElementName = 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 (cbElementType.SelectedIndex) + { + case (int)ChainElementsEnum.Circle: + if(selectedElement is Circle) + { + Circle circle = circleControl.CreateMove(newElementName); + chain.Elements[selectedNode.Index] = 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 (int)ChainElementsEnum.Spiral: + if(selectedElement is Spiral) + { + Spiral spiral = spiralControl.CreateMove(newElementName); + chain.Elements[selectedNode.Index] = 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; + case (int)ChainElementsEnum.Repeat: + if(selectedElement is Repeat) + { + if (repeatControl.ValidateInputs()) + { + Repeat repeat = repeatControl.CreateElement(newElementName); + 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."); + return; + } + + UpdateChainWindow(selectedNode.Index); + } + 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 ElementNameValid(string elementName) + { + if (elementName.Replace(" ", string.Empty) == "") + { + return false; + } + + return true; + } + + private void btnElementGetSettings_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; + switch (selectedElementInChain) + { + case Circle circleElement: + populatingOfFieldsSuccessful = circleControl.Populate(circleElement); + cbElementType.SelectedIndex = (int)ChainElementsEnum.Circle; + break; + case Spiral spiralElement: + populatingOfFieldsSuccessful = spiralControl.Populate(spiralElement); + cbElementType.SelectedIndex = (int)ChainElementsEnum.Spiral; + break; + case Repeat repeatElement: + populatingOfFieldsSuccessful = repeatControl.Populate(repeatElement); + cbElementType.SelectedIndex = (int)ChainElementsEnum.Repeat; + 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 + { + txtElementName.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; + } + else + { + EnableElementOptionsOtherType(); + } + } + + private void EnableElementOptionsMoveType() + { + btnElementMoveUp.Enabled = true; + btnElementMoveDown.Enabled = true; + btnElementGetSettings.Enabled = true; + btnElementApplySettings.Enabled = true; + btnElementDuplicate.Enabled = true; + btnElementDelete.Enabled = true; + 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; + btnElementMoveDown.Enabled = false; + btnElementGetSettings.Enabled = false; + btnElementApplySettings.Enabled = false; + btnElementDuplicate.Enabled = false; + btnElementDelete.Enabled = false; + btnInsert.Enabled = false; + } + + private void btnElementMoveUp_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; + } + if (selectedNode.Index != 0) + { + ChainElement selectedChainElement = chain.Elements[selectedNode.Index]; + + chain.Elements.Remove(selectedChainElement); + chain.Elements.Insert(selectedNode.Index - 1, selectedChainElement); + + UpdateChainWindow(selectedNode.Index - 1); + } + } + + private void btnElementMoveDown_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; + } + if (selectedNode.Index != tvChain.Nodes.Count -1) + { + ChainElement selectedChainElement = chain.Elements[selectedNode.Index]; + + chain.Elements.Remove(selectedChainElement); + chain.Elements.Insert(selectedNode.Index + 1, selectedChainElement); + + 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; + case Repeat repeatElement: + selectedChainElement = repeatElement.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 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 elementName = txtElementName.Text; + if (!ElementNameValid(elementName)) + { + elementName = null; + } + + switch (cbElementType.SelectedIndex) + { + case (int)ChainElementsEnum.Circle: + Circle circle = circleControl.CreateMove(elementName); + chain.Elements.Insert(insertIndex, circle); + break; + case (int)ChainElementsEnum.Spiral: + Spiral spiral = spiralControl.CreateMove(elementName); + chain.Elements.Insert(insertIndex, spiral); + break; + case (int)ChainElementsEnum.Repeat: + Repeat repeat = repeatControl.CreateElement(elementName); + chain.Elements.Insert(insertIndex, repeat); + break; + default: + MessageBox.Show("can't add element to chain."); + return; + } + + UpdateChainWindow(insertIndex); + } + + private void btnEditScriptPath_Click(object sender, EventArgs e) + { + CommonOpenFileDialog dialog = new CommonOpenFileDialog(); + dialog.IsFolderPicker = true; + dialog.InitialDirectory = Directory.Exists(generateScriptPath) ? generateScriptPath: defaultInitialDirectory; + if(dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + generateScriptPath = dialog.FileName; + } + } + + private void tvChain_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) + { + btnElementGetSettings_Click(sender, e); + } + + private void Main_FormClosing(object sender, FormClosingEventArgs 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) + { + e.Cancel = true; + } + } + + //Saving general settings + if(WindowState != FormWindowState.Minimized) + { + Settings.Default.WindowState = (int)WindowState; + 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 = Path.GetDirectoryName(chain.FullName); + + 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 = GetInitialDirectoryForChainFiles(); + if(dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + chain.FullName = 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 = GetInitialDirectoryForChainFiles(); + 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; + 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 GetInitialDirectoryForChainFiles() + { + if (Directory.Exists(Path.GetDirectoryName(chain.FullName))) + { + return Path.GetDirectoryName(chain.FullName); + } + + if (Directory.Exists(savedChainDirectoryPath)) + { + return savedChainDirectoryPath; + } + + return defaultInitialDirectory; + } + } +} diff --git a/MovementScriptGenerator/Form1.resx b/MovementScriptGenerator/MainForm.resx similarity index 90% rename from MovementScriptGenerator/Form1.resx rename to MovementScriptGenerator/MainForm.resx index 5f13cf2..cc618ee 100644 --- a/MovementScriptGenerator/Form1.resx +++ b/MovementScriptGenerator/MainForm.resx @@ -120,19 +120,38 @@ 17, 17 + + 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 + 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 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 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 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 moves. +If a file with the same name exists, that file will be overwritten! + + 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 new file mode 100644 index 0000000..4b3bd91 --- /dev/null +++ b/MovementScriptGenerator/Modules/Chain.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace MovementScriptGenerator.Modules +{ + public class Chain + { + public string Name { get; set; } + public string FullName { get; set; } + public List Elements { get; set; } + } +} diff --git a/MovementScriptGenerator/Modules/ChainElement.cs b/MovementScriptGenerator/Modules/ChainElement.cs new file mode 100644 index 0000000..fac16e4 --- /dev/null +++ b/MovementScriptGenerator/Modules/ChainElement.cs @@ -0,0 +1,24 @@ + +using System; + +namespace MovementScriptGenerator.Modules +{ + 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/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..1a8b552 --- /dev/null +++ b/MovementScriptGenerator/Modules/Move.cs @@ -0,0 +1,21 @@ +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..d3ff149 --- /dev/null +++ b/MovementScriptGenerator/Modules/Moves/Circle.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using MovementScriptGenerator.Modules; + +namespace MovementScriptGenerator +{ + public class Circle : Move + { + 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, + 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; + 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 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..1bfd2f8 --- /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 + { + public float StartDistance { get; } + public float EndDistance { get; } + public float HorizontalRot { get; } + public float VerticalRot { get; } + public int SpiralAmmount { get; } + public bool SpiralClockwise { get; } + public float StartHold { get; } + public float EndHold { get; } + public bool Ease { get; } + 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; + 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; + + 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/OtherChainElements/Repeat.cs b/MovementScriptGenerator/Modules/OtherChainElements/Repeat.cs new file mode 100644 index 0000000..5dcb539 --- /dev/null +++ b/MovementScriptGenerator/Modules/OtherChainElements/Repeat.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace MovementScriptGenerator.Modules.OtherChainElements +{ + public class Repeat : ChainElement + { + public int StartElement { get; } + public int EndElement { get; } + public Repeat(string name, int startElement, int endElement) : base(name) + { + Name = name ?? "Repeat"; + StartElement = startElement; + EndElement = endElement; + } + } +} 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..cdcfcec 100644 --- a/MovementScriptGenerator/MovementScriptGenerator.csproj +++ b/MovementScriptGenerator/MovementScriptGenerator.csproj @@ -36,6 +36,16 @@ Icon.ico + + + ..\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 @@ -52,15 +62,21 @@ - - + + + + Form - - Form1.cs + + MainForm.cs + + + + @@ -71,7 +87,14 @@ CircleControl.cs - + + + UserControl + + + RepeatControl.cs + + UserControl @@ -81,8 +104,8 @@ CircleControl.cs - - Form1.cs + + MainForm.cs ResXFileCodeGenerator @@ -93,6 +116,9 @@ True Resources.resx + + RepeatControl.cs + SpiralControl.cs @@ -113,5 +139,6 @@ + \ No newline at end of file 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")] diff --git a/MovementScriptGenerator/Properties/Settings.Designer.cs b/MovementScriptGenerator/Properties/Settings.Designer.cs index ef6e25c..81b4616 100644 --- a/MovementScriptGenerator/Properties/Settings.Designer.cs +++ b/MovementScriptGenerator/Properties/Settings.Designer.cs @@ -8,22 +8,91 @@ // //------------------------------------------------------------------------------ - -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; + } + } + + [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 3964565..b32c246 100644 --- a/MovementScriptGenerator/Properties/Settings.settings +++ b/MovementScriptGenerator/Properties/Settings.settings @@ -1,7 +1,24 @@  - - - - - - + + + + + + + + + + + + + + 0, 0 + + + 923, 754 + + + 0 + + + \ No newline at end of file diff --git a/MovementScriptGenerator/RepeatControl.Designer.cs b/MovementScriptGenerator/RepeatControl.Designer.cs new file mode 100644 index 0000000..2e7b509 --- /dev/null +++ b/MovementScriptGenerator/RepeatControl.Designer.cs @@ -0,0 +1,203 @@ + +namespace MovementScriptGenerator +{ + partial class RepeatControl + { + /// + /// 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.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(); + 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.ToolTip = new System.Windows.Forms.ToolTip(this.components); + this.flpSpiralControl.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numStartElement)).BeginInit(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numEndElement)).BeginInit(); + this.SuspendLayout(); + // + // 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 + // + 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; + this.ToolTip.SetToolTip(this.lblStartElement, "The index/number of the first element that will be repeated."); + // + // 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; + 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 + // + 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.flpSpiralControl); + this.Name = "RepeatControl"; + this.Size = new System.Drawing.Size(258, 70); + 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(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numEndElement)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.FlowLayoutPanel flpSpiralControl; + 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; + private System.Windows.Forms.ToolTip ToolTip; + } +} diff --git a/MovementScriptGenerator/RepeatControl.cs b/MovementScriptGenerator/RepeatControl.cs new file mode 100644 index 0000000..c3c93ad --- /dev/null +++ b/MovementScriptGenerator/RepeatControl.cs @@ -0,0 +1,62 @@ +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(); + } + + private void RepeatControl_Load(object sender, EventArgs e) + { + ScrollEventDisable scrollEventDisable = new ScrollEventDisable(); + scrollEventDisable.DisableScrollForChainElementControls(sender, e, Controls[0]); + } + + 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..71c2de5 --- /dev/null +++ b/MovementScriptGenerator/RepeatControl.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file 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/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..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(); @@ -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(); @@ -68,13 +68,13 @@ 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(); ((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(); @@ -93,29 +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.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 // @@ -216,8 +217,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 +228,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 @@ -688,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(); @@ -702,7 +704,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(); @@ -735,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; @@ -768,8 +770,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..79f40cd 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() { @@ -27,12 +19,43 @@ 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; 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 = 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) @@ -48,30 +71,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; } } } 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