diff --git a/OpenRA.Mods.RA/Chronoshiftable.cs b/OpenRA.Mods.RA/Chronoshiftable.cs index 9721cda4ab..79da3e72eb 100755 --- a/OpenRA.Mods.RA/Chronoshiftable.cs +++ b/OpenRA.Mods.RA/Chronoshiftable.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -8,6 +8,7 @@ */ #endregion +using System.Drawing; using OpenRA.Mods.RA.Activities; using OpenRA.Traits; @@ -18,13 +19,14 @@ namespace OpenRA.Mods.RA public readonly bool ExplodeInstead = false; } - public class Chronoshiftable : ITick, ISync + public class Chronoshiftable : ITick, ISync, ISelectionBar { // Return-to-sender logic [Sync] CPos chronoshiftOrigin; [Sync] int chronoshiftReturnTicks = 0; Actor chronosphere; bool killCargo; + int TotalTicks; public void Tick(Actor self) { @@ -66,6 +68,7 @@ namespace OpenRA.Mods.RA /// Set up return-to-sender info chronoshiftOrigin = self.Location; chronoshiftReturnTicks = duration; + TotalTicks = duration; this.chronosphere = chronosphere; this.killCargo = killCargo; @@ -75,5 +78,13 @@ namespace OpenRA.Mods.RA return true; } + + // Show the remaining time as a bar + public float GetValue() + { + return (float)chronoshiftReturnTicks / TotalTicks; + } + + public Color GetColor() { return Color.White; } } }