Example #1
0
        private void OnDrawTimer(IRenderer renderer)
        {
            try
            {
                var cd = this.ownerTeam == Team.Radiant ? Game.ScanCooldownDire : Game.ScanCooldownRadiant;

                if (cd > 0)
                {
                    if (!this.showRemaining)
                    {
                        cd += Game.GameTime;
                    }

                    Drawer.DrawTextWithBackground(TimeSpan.FromSeconds(cd).ToString(@"m\:ss"), this.textSize, this.textPosition, renderer);
                }
                else if (!this.hide)
                {
                    Drawer.DrawTextWithBackground("Ready", this.textSize, this.textPosition, renderer);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #2
0
        private void OnDraw(IRenderer renderer)
        {
            try
            {
                var gameTime          = Game.RawGameTime;
                var cd                = gameTime - this.roshanKillTime;
                var aegisCd           = gameTime - this.aegisPickUpTime;
                var showRemainingTime = this.showRemaining.IsEnabled;

                if (this.altKey)
                {
                    showRemainingTime = !showRemainingTime;
                }

                string text;

                if (cd > GameData.RoshanMaxRespawnTime)
                {
                    if (this.hide)
                    {
                        return;
                    }

                    text = "Alive";
                }
                else if (cd > GameData.RoshanMinRespawnTime)
                {
                    var time = GameData.RoshanMaxRespawnTime - cd;
                    if (!showRemainingTime)
                    {
                        time += Game.GameTime;
                    }

                    text = TimeSpan.FromSeconds(time).ToString(@"m\:ss") + "*";
                }
                else if (aegisCd <= GameData.AegisExpirationTime)
                {
                    var time = GameData.AegisExpirationTime - aegisCd;
                    if (!showRemainingTime)
                    {
                        time += Game.GameTime;
                    }

                    text = TimeSpan.FromSeconds(time).ToString(@"m\:ss") + "!";
                }
                else
                {
                    var time = GameData.RoshanMaxRespawnTime - cd;
                    if (!showRemainingTime)
                    {
                        time += Game.GameTime;
                    }

                    text = TimeSpan.FromSeconds(time).ToString(@"m\:ss");

                    if (this.showMinTime)
                    {
                        text = TimeSpan.FromSeconds(time - (GameData.RoshanMaxRespawnTime - GameData.RoshanMinRespawnTime))
                               .ToString(@"m\:ss") + Environment.NewLine + text;
                    }
                }

                Drawer.DrawTextWithBackground(text, this.textSize, this.textPosition, renderer);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }