do preview if preview fwd / back pressed but preview not pressed yet.
This commit is contained in:
parent
6e08d0d6f5
commit
3f4e6c5e71
@ -605,25 +605,30 @@ 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)
|
||||||
{
|
{
|
||||||
if(PreviewSprite != null)
|
if (PreviewSprite != null)
|
||||||
{
|
{
|
||||||
int Animations = PreviewSprite.AnimationCount;
|
int Animations = PreviewSprite.AnimationCount;
|
||||||
int NextAnim = PreviewSprite.AnimationIndex - 1;
|
int NextAnim = PreviewSprite.AnimationIndex - 1;
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user