From 60e4860cfcb02759f62c6a5f97b391c236a6ebf9 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Wed, 1 Jan 2020 17:59:27 -0500 Subject: [PATCH] Some fixes for animation timeline and animation switching --- .../Forms/Animation/Rewrite/AnimationPanel.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Switch_Toolbox_Library/Forms/Animation/Rewrite/AnimationPanel.cs b/Switch_Toolbox_Library/Forms/Animation/Rewrite/AnimationPanel.cs index 27693b19..b0953a74 100644 --- a/Switch_Toolbox_Library/Forms/Animation/Rewrite/AnimationPanel.cs +++ b/Switch_Toolbox_Library/Forms/Animation/Rewrite/AnimationPanel.cs @@ -92,10 +92,13 @@ namespace Toolbox.Library { get { - float frameCount = 1; + float frameCount = uint.MinValue; for (int i = 0; i < currentAnimations.Count; i++) frameCount = Math.Max(frameCount, currentAnimations[i].FrameCount); + if (frameCount == uint.MinValue) + frameCount = 1; + return frameCount; } } @@ -269,7 +272,11 @@ namespace Toolbox.Library if (animationTrackBar.CurrentFrame == animationTrackBar.FrameCount - 1) { if (IsLooping) + { + //Reset the min setting as animations can potentically be switched + currentFrameUpDown.Minimum = (decimal)StartFrame; currentFrameUpDown.Value = (decimal)StartFrame; + } else Stop(); }