diff --git a/Dalamud/Interface/Animation/Easing.cs b/Dalamud/Interface/Animation/Easing.cs index 1edebb69b..441108e6f 100644 --- a/Dalamud/Interface/Animation/Easing.cs +++ b/Dalamud/Interface/Animation/Easing.cs @@ -9,6 +9,7 @@ namespace Dalamud.Interface.Animation /// public abstract class Easing { + // TODO: Use game delta time here instead private readonly Stopwatch animationTimer = new(); private double valueInternal; @@ -45,7 +46,7 @@ namespace Dalamud.Interface.Animation get => this.valueInternal; protected set { - this.valueInternal = Math.Min(value, 1); + this.valueInternal = value; if (this.Point1.HasValue && this.Point2.HasValue) this.EasedPoint = AnimUtil.Lerp(this.Point1.Value, this.Point2.Value, (float)this.valueInternal); @@ -57,6 +58,16 @@ namespace Dalamud.Interface.Animation /// public TimeSpan Duration { get; set; } + /// + /// Gets a value indicating whether or not the animation is running. + /// + public bool IsRunning => this.animationTimer.IsRunning; + + /// + /// Gets a value indicating whether or not the animation is done. + /// + public bool IsDone => this.animationTimer.ElapsedMilliseconds > this.Duration.TotalMilliseconds; + /// /// Gets the progress of the animation, from 0 to 1. ///