EliteBar menu

User Tag List

Thread: EliteBar

Results 1 to 8 of 8
  1. #1
    Graax's Avatar Member
    Reputation
    1
    Join Date
    Nov 2019
    Posts
    7
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    EliteBar

    Could that please make someone run? It has been very helpful in the past ....


    using System.Linq;
    using System.Collections.Generic;
    using Turbo.Plugins.Default;

    namespace Turbo.Plugins.Gigi
    {
    public class EliteBarPlugin : BasePlugin, IInGameWorldPainter
    {
    public WorldDecoratorCollection HitBoxDecorator { get; set; }
    public IFont LightFont { get; set; }
    public IFont RedFont { get; set; }
    public IFont NameFont { get; set; }
    public IBrush BackgroundBrush { get; set; }
    public IBrush BorderBrush { get; set; }
    public IBrush RareBrush { get; set; }
    public IBrush RareJuggerBrush { get; set; }
    public IBrush RareMinionBrush { get; set; }
    public IBrush ChampionBrush { get; set; }
    public IBrush BossBrush { get; set; }
    public bool JuggernautHighlight { get; set; }
    public bool MissingHighlight { get; set; }
    public bool ShowRareMinions { get ; set; }
    public bool ShowDebuffAndCC { get; set; }
    public bool ShowBossHitBox { get; set; }
    public bool ShowMonsterType { get; set; }
    public bool CircleNonIllusion { get; set; }
    public float XPos { get; set; }
    public float YPos { get; set; }
    public float XScaling { get; set; }
    public float YScaling { get; set; }
    public string PercentageDescriptor { get; set; }
    public Dictionary<MonsterAffix, string> DisplayAffix;
    private float px, py, h, w2;

    public EliteBarPlugin()
    {
    Enabled = true;
    }

    public override void Load(IController hud)
    {
    base.Load(hud);

    //Configuration
    MissingHighlight = true;
    JuggernautHighlight = true;
    CircleNonIllusion = true;
    ShowRareMinions = true;
    ShowDebuffAndCC = true;
    ShowBossHitBox = true;
    ShowMonsterType = true;
    XScaling = 1.0f;
    YScaling = 1.0f;
    PercentageDescriptor = "0.00";
    XPos = Hud.Window.Size.Width * 0.125f;
    YPos = Hud.Window.Size.Height * 0.0333f;
    DisplayAffix = new Dictionary<MonsterAffix, string>();

    //Colorization
    LightFont = Hud.Render.CreateFont("tahoma", 6f, 160, 255, 255, 255, false, false, true);
    RedFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 0, 0, false, false, true);
    NameFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 255, 255, false, false, true);
    BackgroundBrush = Hud.Render.CreateBrush(255, 125, 120, 120, 0);
    BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 255, 1);
    RareBrush = Hud.Render.CreateBrush(255, 255, 128, 0, 0);
    RareJuggerBrush = Hud.Render.CreateBrush(255, 225, 100, 50, 0);
    RareMinionBrush = Hud.Render.CreateBrush(220, 200, 100, 0, 0);
    ChampionBrush = Hud.Render.CreateBrush(255, 0, 128, 255, 0);
    BossBrush = Hud.Render.CreateBrush(255, 200, 20, 0, 0);

    //HitBoxDecorator for Bosses and NonClone-Illusionist
    HitBoxDecorator = new WorldDecoratorCollection(
    new GroundCircleDecorator(Hud) {
    Brush = Hud.Render.CreateBrush(255, 57, 194, 29, 3),
    Radius = -1
    }
    );
    }

    private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref){
    if (m.Rarity == ActorRarity.RareMinion && !ShowRareMinions) return; //no minions
    if (m.SummonerAcdDynamicId != 0) return; //no clones
    var w = m.CurHealth * w2 / m.MaxHealth;
    var per = LightFont.GetTextLayout((m.CurHealth * 100 / m.MaxHealth).ToString(PercentageDescriptor)+ "%");
    var y = YPos + py * 8 * yref;
    IBrush cBrush = null;
    IFont cFont = null;

    //Brush selection
    switch(m.Rarity){
    case ActorRarity.Boss:
    cBrush = BossBrush;
    break;
    case ActorRarity.Champion:
    cBrush = ChampionBrush;
    break;
    case ActorRarity.Rare:
    cBrush = RareBrush;
    break;
    case ActorRarity.RareMinion:
    cBrush = RareMinionBrush;
    break;
    default:
    cBrush = BackgroundBrush;
    break;
    }

    //Jugger Highlight
    if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut)){
    cFont = RedFont;
    cBrush = RareJuggerBrush;
    }
    else
    cFont = NameFont;

    //Missing Highlight
    if (MissingHighlight && (m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare) && !m.IsOnScreen){
    var missing = RedFont.GetTextLayout("\u26A0");
    RedFont.DrawText(missing, XPos - 17, y - py);
    }

    //Circle Non-Clones and Boss
    if (CircleNonIllusion && m.SummonerAcdDynamicId == 0 && HasAffix(m, MonsterAffix.Illusionist) || m.Rarity == ActorRarity.Boss && ShowBossHitBox)
    HitBoxDecorator.Paint(layer, m, m.FloorCoordinate, string.Empty);

    //Show Debuffs on Monster
    if (ShowDebuffAndCC){
    string textDebuff = null;
    if (m.Locust) textDebuff += (textDebuff == null ? "" : ", ") + "Locust";
    if (m.Palmed) textDebuff += (textDebuff == null ? "" : ", ") + "Palm";
    if (m.Haunted) textDebuff += (textDebuff == null ? "" : ", ") + "Haunt";
    if (m.MarkedForDeath) textDebuff += (textDebuff == null ? "" : ", ") + "Mark";
    if (m.Strongarmed) textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm";
    string textCC = null;
    if (m.Frozen) textCC += (textCC == null ? "" : ", ") + "Frozen";
    if (m.Chilled) textCC += (textCC == null ? "" : ", ") + "Chill";
    if (m.Slow) textCC += (textCC == null ? "" : ", ") + "Slow";
    if (m.Stunned) textCC += (textCC == null ? "" : ", ") + "Stun";
    if (m.Invulnerable) textCC += (textCC == null ? "" : ", ") + "Invulnerable";
    if (m.Blind) textCC += (textCC == null ? "" : ", ") + "Blind";
    var d = LightFont.GetTextLayout(textDebuff + (textDebuff != null && textCC != null ? " | " : "") + textCC);
    LightFont.DrawText(d, XPos + 65 + w2, y - py);
    }

    //Draw Rectangles
    BackgroundBrush.DrawRectangle(XPos, y, w2, h);
    BorderBrush.DrawRectangle(XPos, y, w2, h);
    cBrush.DrawRectangle(XPos, y, (float)w, h);
    LightFont.DrawText(per, XPos + 8 + w2, y - py);

    //Draw MonsterType
    if (ShowMonsterType){
    var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized);
    cFont.DrawText(name, XPos + 3, y - py);
    }

    //increase linecount
    yref += 1.0f;
    }

    private void DrawPack(WorldLayer layer, IMonsterPack p, ref float yref){
    //Check if any affixes are wished to be displayed
    if (DisplayAffix.Any()){
    string dAffix = "";
    foreach(ISnoMonsterAffix afx in p.AffixSnoList){ //iterate affix list
    if (DisplayAffix.Keys.Contains(afx.Affix)) //if affix is an key
    dAffix += DisplayAffix[afx.Affix] + " "; //add to output
    }
    if (!string.IsNullOrEmpty(dAffix)){
    var d = LightFont.GetTextLayout(dAffix);
    var y = YPos + py * 8 * yref;
    LightFont.DrawText(d, XPos, y - py);
    yref += 1.0f;
    }
    }
    //iterate all alive monsters of pack and print healthbars
    foreach(IMonster m in p.MonstersAlive)
    DrawHealthBar(layer, m, ref yref);
    }

    private bool HasAffix(IMonster m, MonsterAffix afx){
    return m.AffixSnoList.Any(a => a.Affix == afx);
    }

    public void PaintWorld(WorldLayer layer)
    {
    //Spacing
    px = Hud.Window.Size.Width * 0.00155f * XScaling;
    py = Hud.Window.Size.Height * 0.001667f * YScaling;
    h = py * 6;
    w2 = px * 60;

    var packs = Hud.Game.MonsterPacks.Where(x => x.MonstersAlive.Any());
    var bosses = Hud.Game.AliveMonsters.Where(m => m.Rarity == ActorRarity.Boss);

    float yref = 0f;
    foreach(IMonster m in bosses)
    DrawHealthBar(layer, m, ref yref);
    yref += 0.5f; //spacing between RG and Elites
    foreach(IMonsterPack p in packs){
    DrawPack(layer, p, ref yref);
    yref += 0.5f; //spacing between Elites
    }
    }
    }

    }



    THX

    EliteBar
  2. #2
    knight84's Avatar Active Member
    Reputation
    19
    Join Date
    Mar 2017
    Posts
    270
    Thanks G/R
    24/18
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    //Modified plugin of the original, which can be downloaded from:
    //https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-approved-plugins/612897-english-gigi-elitebarplugin.html
    //Changes: Added Strongarm, Curses, Fix: Bug when a yellow elite is dead but not minions , Fix: Sometimes it shows an fake elite life , added Variables OnlyGr & ShowCurses

    using System.Linq;
    using System.Collections.Generic;
    using Turbo.Plugins.Default;

    namespace Turbo.Plugins.Gigi
    {
    public class EliteBarPlugin : BasePlugin, IInGameWorldPainter
    {
    public WorldDecoratorCollection HitBoxDecorator { get; set; }
    public IFont LightFont { get; set; }
    public IFont RedFont { get; set; }
    public IFont NameFont { get; set; }
    public IBrush BackgroundBrush { get; set; }
    public IBrush BorderBrush { get; set; }
    public IBrush RareBrush { get; set; }
    public IBrush RareJuggerBrush { get; set; }
    public IBrush RareMinionBrush { get; set; }
    public IBrush ChampionBrush { get; set; }
    public IBrush BossBrush { get; set; }
    public bool JuggernautHighlight { get; set; }
    public bool MissingHighlight { get; set; }
    public bool ShowRareMinions { get ; set; }
    public bool ShowDebuffAndCC { get; set; }
    public bool ShowBossHitBox { get; set; }
    public bool ShowMonsterType { get; set; }
    public bool CircleNonIllusion { get; set; }
    public float XPos { get; set; }
    public float YPos { get; set; }
    public float XScaling { get; set; }
    public float YScaling { get; set; }
    public string PercentageDescriptor { get; set; }
    public Dictionary<MonsterAffix, string> DisplayAffix;
    private float px, py, h, w2;
    public bool OnlyGR { get; set; }
    public bool ShowCurses { get; set; }

    public EliteBarPlugin()
    {
    Enabled = true;
    }

    public override void Load(IController hud)
    {
    base.Load(hud);

    //Configuration
    MissingHighlight = true;
    JuggernautHighlight = true;
    CircleNonIllusion = true;
    ShowRareMinions = true;
    ShowDebuffAndCC = true;
    ShowBossHitBox = true;
    ShowMonsterType = true;
    XScaling = 1.0f;
    YScaling = 1.5f;
    PercentageDescriptor = "0.00";
    XPos = Hud.Window.Size.Width * 0.670f;
    YPos = Hud.Window.Size.Height * 0.0720f;
    DisplayAffix = new Dictionary<MonsterAffix, string>();
    OnlyGR = false;
    ShowCurses = true;

    //Colorization
    LightFont = Hud.Render.CreateFont("tahoma", 6f, 160, 255, 255, 255, false, false, true);
    RedFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 0, 0, false, false, true);
    NameFont = Hud.Render.CreateFont("tahoma", 7f, 200, 255, 255, 255, false, false, true);
    BackgroundBrush = Hud.Render.CreateBrush(255, 125, 120, 120, 0);
    BorderBrush = Hud.Render.CreateBrush(255, 255, 255, 255, 1);
    RareBrush = Hud.Render.CreateBrush(255, 255, 128, 0, 0);
    RareJuggerBrush = Hud.Render.CreateBrush(255, 225, 100, 50, 0);
    RareMinionBrush = Hud.Render.CreateBrush(220, 200, 100, 0, 0);
    ChampionBrush = Hud.Render.CreateBrush(255, 0, 128, 255, 0);
    BossBrush = Hud.Render.CreateBrush(255, 200, 20, 0, 0);

    //HitBoxDecorator for Bosses and NonClone-Illusionist
    HitBoxDecorator = new WorldDecoratorCollection(
    new GroundCircleDecorator(Hud) {
    Brush = Hud.Render.CreateBrush(255, 57, 194, 29, 3),
    Radius = -1
    }
    );
    }

    private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref){
    if (m.Rarity == ActorRarity.RareMinion && !ShowRareMinions) return; //no minions
    if (m.SummonerAcdDynamicId != 0) return; //no clones

    var wint = m.CurHealth / m.MaxHealth; string whptext;
    if ((wint < 0) || (wint > 1)) { wint = 1 ; whptext = "bug" ; }
    else { whptext = (wint * 100).ToString(PercentageDescriptor) + "%"; }
    var w = wint * w2;
    var per = LightFont.GetTextLayout(whptext);

    var y = YPos + py * 8 * yref;
    IBrush cBrush = null;
    IFont cFont = null;

    //Brush selection
    switch(m.Rarity){
    case ActorRarity.Boss:
    cBrush = BossBrush;
    break;
    case ActorRarity.Champion:
    cBrush = ChampionBrush;
    break;
    case ActorRarity.Rare:
    cBrush = RareBrush;
    break;
    case ActorRarity.RareMinion:
    cBrush = RareMinionBrush;
    break;
    default:
    cBrush = BackgroundBrush;
    break;
    }

    //Jugger Highlight
    if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut)){
    cFont = RedFont;
    cBrush = RareJuggerBrush;
    }
    else
    cFont = NameFont;

    //Missing Highlight
    if (MissingHighlight && (m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare) && !m.IsOnScreen){
    var missing = RedFont.GetTextLayout("\u26A0");
    RedFont.DrawText(missing, XPos - 17, y - py);
    }

    //Circle Non-Clones and Boss
    if (CircleNonIllusion && m.SummonerAcdDynamicId == 0 && HasAffix(m, MonsterAffix.Illusionist) || m.Rarity == ActorRarity.Boss && ShowBossHitBox)
    HitBoxDecorator.Paint(layer, m, m.FloorCoordinate, string.Empty);

    string d = string.Empty;
    //Show Debuffs on Monster
    if (ShowDebuffAndCC){
    string textDebuff = null;
    if (m.Locust) textDebuff += (textDebuff == null ? "" : ", ") + "Locust";
    if (m.Palmed) textDebuff += (textDebuff == null ? "" : ", ") + "Palm";
    if (m.Haunted) textDebuff += (textDebuff == null ? "" : ", ") + "Haunt";
    // if (m.MarkedForDeath) textDebuff += (textDebuff == null ? "" : ", ") + "Mark";
    if (m.Strongarmed) textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm"; // No funciona, reemplazado por otro código
    if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 318772) == 1) //318772 2 power: ItemPassive_Unique_Ring_590_x1
    textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm";
    string textCC = null;
    // if (m.Frozen) textCC += (textCC == null ? "" : ", ") + "Frozen";
    // if (m.Chilled) textCC += (textCC == null ? "" : ", ") + "Chill";
    // if (m.Slow) textCC += (textCC == null ? "" : ", ") + "Slow";
    if (m.Stunned) textCC += (textCC == null ? "" : ", ") + "Stun";
    // if (m.Invulnerable) textCC += (textCC == null ? "" : ", ") + "Invulnerable";
    if (m.Blind) textCC += (textCC == null ? "" : ", ") + "Blind";
    if (textDebuff != null) { d = textDebuff; }
    if (textCC != null) { d += ((d != string.Empty)? " | ":"") + textCC ; }
    }
    if (ShowCurses) {
    string Curses = null;
    if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471845) == 1) //471845 1 power: Frailty
    Curses += (Curses == null ? "" : " ") + "F";
    if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 471869) == 1) //471869 1 power: Leech
    Curses += (Curses == null ? "" : " ") + "L";
    if (m.GetAttributeValue(Hud.Sno.Attributes.Power_Buff_2_Visual_Effect_None, 47173 == 1) //471738 1 power: Decrepify
    Curses += (Curses == null ? "" : " ") + "D";
    if (Curses != null) { d += ((d != string.Empty)? " | ":"") + Curses ; }
    }
    if (d != string.Empty) { LightFont.DrawText(LightFont.GetTextLayout(d), XPos + 65 + w2, y - py); }

    //Draw Rectangles
    BackgroundBrush.DrawRectangle(XPos, y, w2, h);
    BorderBrush.DrawRectangle(XPos, y, w2, h);
    cBrush.DrawRectangle(XPos, y, (float)w, h);
    LightFont.DrawText(per, XPos + 8 + w2, y - py);

    //Draw MonsterType
    if (ShowMonsterType){
    var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized);
    cFont.DrawText(name, XPos + 3, y - py);
    }

    //increase linecount
    yref += 1.0f;
    }

    private void DrawPack(WorldLayer layer, IMonsterPack p, ref float yref){
    //Check if any affixes are wished to be displayed
    bool elitealive = false;
    foreach(IMonster m in p.MonstersAlive) {
    if ((m.Rarity == ActorRarity.Rare) || (m.Rarity == ActorRarity.Champion) ) { elitealive = true; }
    }

    if (elitealive || ShowRareMinions) {
    if (DisplayAffix.Any()){
    string dAffix = "";
    foreach(ISnoMonsterAffix afx in p.AffixSnoList){ //iterate affix list
    if (DisplayAffix.Keys.Contains(afx.Affix)) //if affix is an key
    dAffix += DisplayAffix[afx.Affix] + " "; //add to output
    }
    if (!string.IsNullOrEmpty(dAffix)){
    var d = LightFont.GetTextLayout(dAffix);
    var y = YPos + py * 8 * yref;
    LightFont.DrawText(d, XPos, y - py);
    yref += 1.0f;
    }
    }
    //iterate all alive monsters of pack and print healthbars
    foreach(IMonster m in p.MonstersAlive)
    DrawHealthBar(layer, m, ref yref);
    }
    }

    private bool HasAffix(IMonster m, MonsterAffix afx){
    return m.AffixSnoList.Any(a => a.Affix == afx);
    }

    public void PaintWorld(WorldLayer layer)
    {
    //Spacing
    if ((OnlyGR) && (Hud.Game.Me.InGreaterRiftRank == 0)) return ;
    px = Hud.Window.Size.Width * 0.00155f * XScaling;
    py = Hud.Window.Size.Height * 0.001667f * YScaling;
    h = py * 6;
    w2 = px * 60;

    var packs = Hud.Game.MonsterPacks.Where(x => x.MonstersAlive.Any());
    var bosses = Hud.Game.AliveMonsters.Where(m => m.Rarity == ActorRarity.Boss);

    float yref = 0f;
    foreach(IMonster m in bosses)
    DrawHealthBar(layer, m, ref yref);
    yref += 0.5f; //spacing between RG and Elites
    foreach(IMonsterPack p in packs){
    DrawPack(layer, p, ref yref);
    yref += 0.5f; //spacing between Elites
    }
    }
    }

    }

    this code should work

  3. #3
    Graax's Avatar Member
    Reputation
    1
    Join Date
    Nov 2019
    Posts
    7
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not work ..... :confused:

  4. #4
    knight84's Avatar Active Member
    Reputation
    19
    Join Date
    Mar 2017
    Posts
    270
    Thanks G/R
    24/18
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    strange, for me its working

    whats your exception ?

  5. #5
    Graax's Avatar Member
    Reputation
    1
    Join Date
    Nov 2019
    Posts
    7
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    turbohud-19.11.25.0-v9.1-stable-for-diablo-iii-2.6.7.64160-64-bit\Plugins\Gigi\EliteBar.cs(162,8 : error CS1026: ) expected


    can you upload a .cs file, than iCopy this in the Gigi Folder?

    THX
    Last edited by Graax; 11-26-2019 at 02:14 AM.

  6. #6
    s4000's Avatar Contributor
    Reputation
    286
    Join Date
    Oct 2018
    Posts
    495
    Thanks G/R
    18/273
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

  7. Thanks Graax (1 members gave Thanks to s4000 for this useful post)
  8. #7
    Graax's Avatar Member
    Reputation
    1
    Join Date
    Nov 2019
    Posts
    7
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx so much!!!

    Have someone a List of Names? To Change Names in English....
    Last edited by Graax; 11-26-2019 at 05:42 AM.

  9. #8
    s4000's Avatar Contributor
    Reputation
    286
    Join Date
    Oct 2018
    Posts
    495
    Thanks G/R
    18/273
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Graax View Post
    Thx so much!!!

    Have someone a List of Names? To Change Names in English....
    you can see the english name in that code itself, eg
    DisplayAffix.Add(MonsterAffix.Wormhole, new Tuple<int, string, string>(1, "蟲洞", "Danger"));

  10. Thanks Graax (1 members gave Thanks to s4000 for this useful post)
All times are GMT -5. The time now is 04:38 PM. 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