Adds color changing to cooldown circle and a blink animation when done (#1087)

Co-authored-by: Tomeno <tomeno@lulzsec.co.uk>
This commit is contained in:
Tomeno
2020-06-09 12:18:09 +02:00
committed by GitHub
parent df342548b5
commit 4cb61b8693
2 changed files with 33 additions and 12 deletions

View File

@@ -100,12 +100,12 @@ namespace Content.Client.UserInterface
var end = cooldown.CooldownEnd.Value;
var length = (end - start).TotalSeconds;
var progress = (_gameTiming.CurTime - start).TotalSeconds;
var ratio = 1 - (float)(progress / length).Clamp(0, 1);
var progress = (_gameTiming.CurTime - start).TotalSeconds / length;
var ratio = (progress <= 1 ? (1 - progress) : (_gameTiming.CurTime - end).TotalSeconds * -5);
cooldownDisplay.Fraction = ratio;
cooldownDisplay.Progress = (float)ratio.Clamp(-1, 1);
if (ratio > 0)
if (ratio > -1f)
{
cooldownDisplay.Visible = true;
}