Fix for .gif import not setting correct category

This commit is contained in:
MattN-L
2024-03-16 13:48:32 -04:00
parent 954b062d36
commit d8cf0107f3

View File

@@ -74,15 +74,20 @@ namespace PckStudio.Forms.Editor
animationPictureBox.BlendColor = blendColor;
}
private void ValidateToolStrip()
{
bulkAnimationSpeedToolStripMenuItem.Enabled =
importToolStripMenuItem.Enabled =
exportAsToolStripMenuItem.Enabled =
changeTileToolStripMenuItem.Enabled =
InterpolationCheckbox.Visible = !IsSpecialTile(_tileName);
}
private void AnimationEditor_Load(object sender, EventArgs e)
{
bulkAnimationSpeedToolStripMenuItem.Enabled =
importToolStripMenuItem.Enabled =
exportAsToolStripMenuItem.Enabled =
changeTileToolStripMenuItem.Enabled =
InterpolationCheckbox.Visible = !IsSpecialTile(_tileName);
ValidateToolStrip();
SetTileLabel();
SetTileLabel();
LoadAnimationTreeView();
}
@@ -127,12 +132,17 @@ namespace PckStudio.Forms.Editor
animationPictureBox.SelectFrame(_animation, frameTreeView.SelectedNode.Index);
}
private void StopAnimation()
{
animationPictureBox.Stop();
AnimationStartStopBtn.Text = "Play Animation";
}
private void AnimationStartStopBtn_Click(object sender, EventArgs e)
{
if (animationPictureBox.IsPlaying)
{
animationPictureBox.Stop();
AnimationStartStopBtn.Text = "Play Animation";
StopAnimation();
return;
}
if (_animation.FrameCount > 1)
@@ -341,6 +351,7 @@ namespace PckStudio.Forms.Editor
private void changeTileToolStripMenuItem_Click(object sender, EventArgs e)
{
StopAnimation();
using (ChangeTile diag = new ChangeTile())
{
if (diag.ShowDialog(this) != DialogResult.OK)
@@ -350,10 +361,7 @@ namespace PckStudio.Forms.Editor
_animation.Category = diag.Category;
_tileName = diag.SelectedTile;
bulkAnimationSpeedToolStripMenuItem.Enabled =
importToolStripMenuItem.Enabled =
exportAsToolStripMenuItem.Enabled =
InterpolationCheckbox.Visible = !IsSpecialTile(_tileName);
ValidateToolStrip();
SetTileLabel();
}
@@ -468,7 +476,11 @@ namespace PckStudio.Forms.Editor
gif.SelectActiveFrame(dimension, i);
textures.Add(new Bitmap(gif));
}
var animCat = _animation.Category;
_animation = new Animation(textures, string.Empty);
_animation.Category = animCat;
LoadAnimationTreeView();
}