diff --git a/SpriteLibrary/SpriteEntryForm.Designer.cs b/SpriteLibrary/SpriteEntryForm.Designer.cs index 1d094af..b8cb5dc 100644 --- a/SpriteLibrary/SpriteEntryForm.Designer.cs +++ b/SpriteLibrary/SpriteEntryForm.Designer.cs @@ -392,6 +392,7 @@ this.btnNewAnimation.TabIndex = 21; this.btnNewAnimation.Text = "New Anim"; this.btnNewAnimation.UseVisualStyleBackColor = true; + this.btnNewAnimation.Click += new System.EventHandler(this.btnNewAnimation_Click); // // pbPreview // diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs index 65b1721..21df9cc 100644 --- a/SpriteLibrary/SpriteEntryForm.cs +++ b/SpriteLibrary/SpriteEntryForm.cs @@ -325,10 +325,10 @@ namespace SpriteLibrary } - private void btnApply_Click(object sender, EventArgs e) + void ApplyChanges() { FormToSpriteInformation(); - if(CurrentSIIndex >0 && CurrentSIIndex < SpriteInformation.Count) + if (CurrentSIIndex > 0 && CurrentSIIndex < SpriteInformation.Count) { SpriteInformation[CurrentSIIndex].CopyFrom(TempInformation); } @@ -340,6 +340,11 @@ namespace SpriteLibrary UpdateMenu(); } + private void btnApply_Click(object sender, EventArgs e) + { + ApplyChanges(); + } + private void WeHaveNewItem() { TempInformation.CopyFrom(SpriteInformation[CurrentSIIndex]); @@ -383,5 +388,15 @@ namespace SpriteLibrary SpriteInformationToForm(); UpdateMenu(); } + + private void btnNewAnimation_Click(object sender, EventArgs e) + { + ApplyChanges(); + AnimationInfo AI = TempInformation.Animations[CurrentSIAnimation].Clone(); + TempInformation.Animations.Add(AI); + CurrentSIAnimation++; + SpriteInformationToForm(); + UpdateMenu(); + } } }