Get new animation working

This commit is contained in:
Tim Young 2017-09-18 11:18:26 -05:00
parent 2e5bf62fb1
commit 4ce60ad422
2 changed files with 18 additions and 2 deletions

View File

@ -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
//

View File

@ -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();
}
}
}