Get anim fwd/backw working

This commit is contained in:
Tim Young 2017-09-18 15:34:30 -05:00
parent e74de637eb
commit c0d1d1599d
2 changed files with 36 additions and 1 deletions

View File

@ -436,6 +436,7 @@
this.btnAnimFwd.TabIndex = 18; this.btnAnimFwd.TabIndex = 18;
this.btnAnimFwd.Text = ">"; this.btnAnimFwd.Text = ">";
this.btnAnimFwd.UseVisualStyleBackColor = true; this.btnAnimFwd.UseVisualStyleBackColor = true;
this.btnAnimFwd.Click += new System.EventHandler(this.btnAnimFwd_Click);
// //
// btnAnimBack // btnAnimBack
// //
@ -446,6 +447,7 @@
this.btnAnimBack.TabIndex = 19; this.btnAnimBack.TabIndex = 19;
this.btnAnimBack.Text = "<"; this.btnAnimBack.Text = "<";
this.btnAnimBack.UseVisualStyleBackColor = true; this.btnAnimBack.UseVisualStyleBackColor = true;
this.btnAnimBack.Click += new System.EventHandler(this.btnAnimBack_Click);
// //
// lblAnimationFwdBack // lblAnimationFwdBack
// //

View File

@ -113,6 +113,16 @@ namespace SpriteLibrary
} }
else else
panelRadioButtons.Visible = true; panelRadioButtons.Visible = true;
if(TempInformation.Animations.Count >1)
{
btnAnimBack.Enabled = true;
btnAnimFwd.Enabled = true;
}
else
{
btnAnimBack.Enabled = false;
btnAnimFwd.Enabled = false;
}
if (rbFromImage.Checked) if (rbFromImage.Checked)
{ {
if(!TCTabPages.TabPages.Contains(tpFromImage)) if(!TCTabPages.TabPages.Contains(tpFromImage))
@ -398,5 +408,28 @@ namespace SpriteLibrary
SpriteInformationToForm(); SpriteInformationToForm();
UpdateMenu(); UpdateMenu();
} }
private void btnAnimBack_Click(object sender, EventArgs e)
{
ApplyChanges();
CurrentSIAnimation--;
if (CurrentSIAnimation < 0)
CurrentSIAnimation = TempInformation.Animations.Count - 1;
SpriteInformationToForm();
UpdateMenu();
}
private void btnAnimFwd_Click(object sender, EventArgs e)
{
ApplyChanges();
CurrentSIAnimation++;
if (CurrentSIAnimation >=TempInformation.Animations.Count)
CurrentSIAnimation = 0;
SpriteInformationToForm();
UpdateMenu();
}
} }
} }