do preview if preview fwd / back pressed but preview not pressed yet.

This commit is contained in:
Tim Young 2017-09-20 10:57:24 -05:00
parent 6e08d0d6f5
commit 3f4e6c5e71

View File

@ -605,25 +605,30 @@ namespace SpriteLibrary
}
}
private void btnPreview_Click(object sender, EventArgs e)
private void DoPreview()
{
//remove the old one
if (PreviewSprite != null) PreviewSprite.Destroy();
//Create a new one
PreviewSprite = TempInformation.CreateSprite(PreviewController, myDatabase);
PreviewSprite.PutBaseImageLocation(new Point(1, 1));
//PreviewSprite.SetSize(new Size(50, 50));
}
private void btnPreview_Click(object sender, EventArgs e)
{
DoPreview();
}
private void btnPreviewAnimBack_Click(object sender, EventArgs e)
{
if(PreviewSprite != null)
if (PreviewSprite != null)
{
int Animations = PreviewSprite.AnimationCount;
int NextAnim = PreviewSprite.AnimationIndex - 1;
if (NextAnim < 0) NextAnim = Animations - 1;
PreviewSprite.ChangeAnimation(NextAnim);
}
else DoPreview();
}
private void btnPreviewAnimFwd_Click(object sender, EventArgs e)
@ -635,6 +640,7 @@ namespace SpriteLibrary
if (NextAnim >= Animations) NextAnim = 0;
PreviewSprite.ChangeAnimation(NextAnim);
}
else DoPreview();
}
private void btnReset_Click(object sender, EventArgs e)