TurboHUD Pylon Tracker Plugin menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    xblade2k7's Avatar Active Member
    Reputation
    50
    Join Date
    Jun 2009
    Posts
    283
    Thanks G/R
    101/34
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    TurboHUD Pylon Tracker Plugin

    TurboHUD Pylon Tracker Plugin


    I'll create a plugin that displays icons for active pylons with their remaining duration. This will help you track your active buffs during gameplay.

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Turbo.Plugins.Default;
    
    namespace Turbo.Plugins.User
    {
        public class PylonTrackerPlugin : BasePlugin, IInGameTopPainter
        {
            // Dictionary to store pylon SNOs and their corresponding textures
            private readonly Dictionary<uint, string> _pylonTextures = new Dictionary<uint, string>
            {
                { 364241, "pylon_conduit" },      // Conduit Pylon
                { 364240, "pylon_channeling" },   // Channeling Pylon
                { 364239, "pylon_empowered" },    // Empowered Pylon
                { 364238, "pylon_protection" },   // Protection Pylon
                { 364237, "pylon_fleeting" }      // Fleeting Pylon
            };
    
            // Position and size settings
            public float BaseX { get; set; }
            public float BaseY { get; set; }
            public float IconSize { get; set; }
            public float Spacing { get; set; }
    
            // Font for timer text
            public IFont TimerFont { get; set; }
    
            public PylonTrackerPlugin()
            {
                Enabled = true;
            }
    
            public override void Load(IController hud)
            {
                base.Load(hud);
    
                // Setup default position (top center of screen)
                BaseX = Hud.Window.Size.Width * 0.5f;
                BaseY = Hud.Window.Size.Height * 0.05f;
                IconSize = 200f;
                Spacing = 10f;
    
                // Setup timer font
                TimerFont = Hud.Render.CreateFont("tahoma", 9, 255, 255, 255, 255, true, false, 128, 0, 0, 0, true);
            }
    
            public void PaintTopInGame(ClipState clipState)
            {
                if (clipState != ClipState.AfterClip) return;
                if (Hud.Game.IsPaused) return;
    
                // Create a list to store active pylons
                var activePylons = new List<PylonInfo>();
    
                // Iterate through all buffs to find active pylons
                foreach (var buff in Hud.Game.Me.Powers.AllBuffs)
                {
                    if (buff.SnoPower != null && _pylonTextures.ContainsKey(buff.SnoPower.Sno) && buff.Active)
                    {
                        double timeLeft = buff.TimeLeftSeconds.Length > 0 ? buff.TimeLeftSeconds[0] : 0;
                        activePylons.Add(new PylonInfo
                        {
                            Sno = buff.SnoPower.Sno,
                            TimeLeft = timeLeft,
                            Texture = _pylonTextures[buff.SnoPower.Sno]
                        });
                    }
                }
    
                if (!activePylons.Any()) return;
    
                // Calculate starting position to center the icons
                float totalWidth = (activePylons.Count * IconSize) + ((activePylons.Count - 1) * Spacing);
                float startX = BaseX - (totalWidth / 2);
    
                // Draw each active pylon icon with timer
                for (int i = 0; i < activePylons.Count; i++)
                {
                    var pylon = activePylons[i];
                    float x = startX + (i * (IconSize + Spacing));
                    float y = BaseY;
    
                    // Draw pylon icon
                    var texture = Hud.Texture.GetTexture(pylon.Texture);
                    if (texture != null)
                    {
                        texture.Draw(x, y, IconSize, IconSize);
                    }
    
                    // Draw timer
                    string timeText = pylon.TimeLeft >= 10 ? pylon.TimeLeft.ToString("F0") : pylon.TimeLeft.ToString("F1");
                    
                    var layout = TimerFont.GetTextLayout(timeText);
                    TimerFont.DrawText(layout, x + (IconSize - layout.Metrics.Width) / 2, y + IconSize + 2);
                }
            }
    
            // Helper class to store pylon information
            private class PylonInfo
            {
                public uint Sno { get; set; }
                public double TimeLeft { get; set; }
                public string Texture { get; set; }
            }
        }
    }
    How to Use This Plugin:
    Save this code as PylonTrackerPlugin.cs in your TurboHUD Plugins/User folder

    Restart TurboHUD or reload plugins

    Features:
    Displays icons for all active pylons (Conduit, Channeling, Empowered, Protection, Fleeting)

    Shows remaining time for each pylon buff

    Automatically centers the icons at the top of the screen

    Time display changes to one decimal place when under 10 seconds for better precision

    Customization:
    You can adjust these properties in the Load method:

    BaseX and BaseY: Position of the icons on screen

    IconSize: Size of the pylon icons

    Spacing: Space between icons

    TimerFont: Font style for the timer text

    Notes:
    The plugin uses default texture names for pylons. If these don't work with your TurboHUD version, you may need to adjust the texture names in the _pylonTextures dictionary.

    The plugin only displays pylons that are currently active on your character.

    Icons are automatically centered at the top of your screen.

    If you need any adjustments or have issues with the texture names, let me know and I can help you modify the plugin accordingly.

    Regards
    Last edited by xblade2k7; 4 Days Ago at 07:21 PM.

    TurboHUD Pylon Tracker Plugin

Similar Threads

  1. [v9.2] Pylon Taker Plugin
    By s4000 in forum TurboHUD Community Plugins
    Replies: 8
    Last Post: 12-25-2020, 12:11 PM
  2. [Request] can anybody helps to update the pylon marker plugin to V9?
    By greetree in forum TurboHUD Support
    Replies: 3
    Last Post: 06-02-2019, 07:49 AM
  3. [Question] How to remove the Stat Tracker Plugin?
    By Tantunxd in forum TurboHUD Support
    Replies: 2
    Last Post: 02-15-2019, 08:40 AM
  4. [Request] Pylon Check Plugin
    By JohnWick in forum TurboHUD Discussions
    Replies: 23
    Last Post: 10-29-2018, 05:03 PM
  5. [How To] Install Plugins and run TurboHUD
    By Kace36 in forum TurboHUD Support
    Replies: 10
    Last Post: 01-16-2018, 02:27 PM
All times are GMT -5. The time now is 03:48 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search