Exemplo n.º 1
0
        private void OnPresent()
        {
            foreach (var camp in DeadCamps.Where(x => x.NextRespawnTime - Game.ClockTime > 0))
            {
                var timeSpan = TimeSpan.FromSeconds(camp.NextRespawnTime - Game.ClockTime);
                var text     = timeSpan.ToString(@"m\:ss");
                var size     = MiscUtils.MeasureText(text);

                Render.Text(text,
                            new Vector2(camp.MinimapPosition.X - size[0] / 2f, (int)camp.MinimapPosition.Y - size[1] / 2f),
                            RenderTextFlags.Center, Color.Black);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Fired when the scene is completely rendered.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void Drawing_OnEndScene(EventArgs args)
        {
            if (!this.Menu.Item("DrawTimers").IsActive() || Drawing.Direct3DDevice.IsDisposed || Font.IsDisposed)
            {
                return;
            }

            foreach (var camp in DeadCamps.Where(x => x.NextRespawnTime - Game.Time > 0))
            {
                var timeSpan = TimeSpan.FromSeconds(camp.NextRespawnTime - Game.Time);
                var text     = timeSpan.ToString(@"m\:ss");
                var size     = Font.MeasureText(text);

                Font.DrawText(
                    null,
                    text,
                    (int)camp.MinimapPosition.X - size.Width / 2,
                    (int)camp.MinimapPosition.Y - size.Height / 2,
                    new ColorBGRA(255, 255, 255, 255));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Fired when the scene is completely rendered.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void Drawing_OnEndScene(EventArgs args)
        {
            if (!getCheckBoxItem("DrawTimers"))
            {
                return;
            }

            foreach (var camp in DeadCamps.Where(x => x.NextRespawnTime - Environment.TickCount > 0))
            {
                var timeSpan = TimeSpan.FromMilliseconds(camp.NextRespawnTime - Environment.TickCount);
                var text     = timeSpan.ToString(@"m\:ss");
                var size     = Font.MeasureText(text);

                Font.DrawText(
                    null,
                    text,
                    (int)camp.MinimapPosition.X - size.Width / 2,
                    (int)camp.MinimapPosition.Y - size.Height / 2,
                    new ColorBGRA(255, 255, 255, 255));
            }
        }