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,14 +605,18 @@ namespace SpriteLibrary
} }
} }
private void btnPreview_Click(object sender, EventArgs e) private void DoPreview()
{ {
//remove the old one //remove the old one
if (PreviewSprite != null) PreviewSprite.Destroy(); if (PreviewSprite != null) PreviewSprite.Destroy();
//Create a new one //Create a new one
PreviewSprite = TempInformation.CreateSprite(PreviewController, myDatabase); PreviewSprite = TempInformation.CreateSprite(PreviewController, myDatabase);
PreviewSprite.PutBaseImageLocation(new Point(1, 1)); 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) private void btnPreviewAnimBack_Click(object sender, EventArgs e)
@ -624,6 +628,7 @@ namespace SpriteLibrary
if (NextAnim < 0) NextAnim = Animations - 1; if (NextAnim < 0) NextAnim = Animations - 1;
PreviewSprite.ChangeAnimation(NextAnim); PreviewSprite.ChangeAnimation(NextAnim);
} }
else DoPreview();
} }
private void btnPreviewAnimFwd_Click(object sender, EventArgs e) private void btnPreviewAnimFwd_Click(object sender, EventArgs e)
@ -635,6 +640,7 @@ namespace SpriteLibrary
if (NextAnim >= Animations) NextAnim = 0; if (NextAnim >= Animations) NextAnim = 0;
PreviewSprite.ChangeAnimation(NextAnim); PreviewSprite.ChangeAnimation(NextAnim);
} }
else DoPreview();
} }
private void btnReset_Click(object sender, EventArgs e) private void btnReset_Click(object sender, EventArgs e)