diff --git a/PCK-Studio/Forms/Editor/Animation.cs b/PCK-Studio/Forms/Editor/Animation.cs index 7ef4b203..a80785af 100644 --- a/PCK-Studio/Forms/Editor/Animation.cs +++ b/PCK-Studio/Forms/Editor/Animation.cs @@ -41,8 +41,6 @@ namespace PckStudio.Forms.Editor public readonly Image Texture; public int Ticks; - public static implicit operator Image(Frame f) => f.Texture; - public Frame(Image texture) : this(texture, MinimumFrameTime) { } @@ -131,7 +129,7 @@ namespace PckStudio.Forms.Editor { StringBuilder stringBuilder = new StringBuilder(Interpolate ? "#" : string.Empty); foreach (var frame in frames) - stringBuilder.Append($"{GetTextureIndex(frame)}*{frame.Ticks},"); + stringBuilder.Append($"{GetTextureIndex(frame.Texture)}*{frame.Ticks},"); return stringBuilder.ToString(0, stringBuilder.Length - 1); } diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index 715e48f0..c8f3c303 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -265,14 +265,9 @@ namespace PckStudio.Forms.Editor private void bulkAnimationSpeedToolStripMenuItem_Click(object sender, EventArgs e) { SetBulkSpeed diag = new SetBulkSpeed(frameTreeView); - if(diag.ShowDialog(this) == DialogResult.OK) + 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.GetTextureIndex(f), diag.time); - } + currentAnimation.GetFrames().ForEach(frame => frame.Ticks = diag.time); LoadAnimationTreeView(); } diag.Dispose(); diff --git a/PCK-Studio/Forms/Editor/AnimationPlayer.cs b/PCK-Studio/Forms/Editor/AnimationPlayer.cs index 4a87299d..bca7ca62 100644 --- a/PCK-Studio/Forms/Editor/AnimationPlayer.cs +++ b/PCK-Studio/Forms/Editor/AnimationPlayer.cs @@ -68,7 +68,7 @@ namespace PckStudio.Forms.Editor { Monitor.Enter(_animation); Animation.Frame frame = _animation[frameIndex]; - display.Image = frame; + display.Image = frame.Texture; Monitor.Exit(_animation); return frame; }