From e4b9f3c6b395ea05a184059c85cb6c5fc24d059c Mon Sep 17 00:00:00 2001 From: MattNL Date: Thu, 25 Aug 2022 15:29:40 -0400 Subject: [PATCH] Restored SetBulkSpeed functionality --- PCK-Studio/Forms/Editor/AnimationEditor.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index 92f1ebfe..8a69e0c8 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -29,8 +29,6 @@ namespace PckStudio.Forms.Editor public string TileName = string.Empty; - //int frameCounter = 0; // ported directly from Java Edition code -MattNL - sealed class Animation { public const int MinimumFrameTime = 1; @@ -497,7 +495,16 @@ namespace PckStudio.Forms.Editor private void bulkAnimationSpeedToolStripMenuItem_Click(object sender, EventArgs e) { SetBulkSpeed diag = new SetBulkSpeed(frameTreeView); - diag.ShowDialog(this); + if(diag.ShowDialog(this) == DialogResult.OK) + { + var list = currentAnimation.GetFrames(); + for (int i = 0; i < list.Count; i++) + { + Animation.Frame f = list[i]; + currentAnimation.SetFrame(f, currentAnimation.GetFrameIndex(f), diag.time); + } + LoadAnimationTreeView(); + } diag.Dispose(); }