From dddab20eefb66bc977821042388fdcad0d27ba47 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 20 Sep 2017 11:39:09 -0500 Subject: [PATCH] Delete animations --- SpriteLibrary/SpriteEntryForm.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/SpriteLibrary/SpriteEntryForm.cs b/SpriteLibrary/SpriteEntryForm.cs index ce8c60d..8b8fb40 100644 --- a/SpriteLibrary/SpriteEntryForm.cs +++ b/SpriteLibrary/SpriteEntryForm.cs @@ -686,7 +686,21 @@ namespace SpriteLibrary private void btnDeleteAnim_Click(object sender, EventArgs e) { - + //delete the current entry. Deal with zero entries. + DialogResult Answer = MessageBox.Show("Delete The current Animation?", "Delete", MessageBoxButtons.YesNo); + if (Answer == DialogResult.Yes) + { + TempInformation.Animations.RemoveAt(CurrentSIAnimation); + CurrentSIAnimation--; + if (CurrentSIAnimation < 0 && TempInformation.Animations.Count > 0) CurrentSIAnimation = 0; + if(TempInformation.Animations.Count == 0) + { + AnimationInfo AI = new AnimationInfo(); + TempInformation.Animations.Add(AI); + CurrentSIAnimation = 0; + } + WeHaveNewItem(); + } } } }