From 4a580c3780112c7c0cd507eff49c04dc730f0bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 4 Apr 2013 19:11:57 +0200 Subject: [PATCH] don't render empty remaining tick bars for iron curtain / chrono --- OpenRA.Mods.RA/Chronoshiftable.cs | 4 +++- OpenRA.Mods.RA/IronCurtainable.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Chronoshiftable.cs b/OpenRA.Mods.RA/Chronoshiftable.cs index 79da3e72eb..574320ae88 100755 --- a/OpenRA.Mods.RA/Chronoshiftable.cs +++ b/OpenRA.Mods.RA/Chronoshiftable.cs @@ -82,9 +82,11 @@ namespace OpenRA.Mods.RA // Show the remaining time as a bar public float GetValue() { + if (chronoshiftReturnTicks == 0) // otherwise an empty bar is rendered all the time + return 0f; + return (float)chronoshiftReturnTicks / TotalTicks; } - public Color GetColor() { return Color.White; } } } diff --git a/OpenRA.Mods.RA/IronCurtainable.cs b/OpenRA.Mods.RA/IronCurtainable.cs index 1b64da6b79..2336db3f6f 100644 --- a/OpenRA.Mods.RA/IronCurtainable.cs +++ b/OpenRA.Mods.RA/IronCurtainable.cs @@ -45,9 +45,11 @@ namespace OpenRA.Mods.RA // Show the remaining time as a bar public float GetValue() { + if (RemainingTicks == 0) // otherwise an empty bar is rendered all the time + return 0f; + return (float)RemainingTicks / TotalTicks; } - public Color GetColor() { return Color.Red; } } } \ No newline at end of file