Example #1
0
        private void DrawWarnings(IPlayer me)
        {
            //IN ARCHON
            if (me.Powers.BuffIsActive(134872, 2))                                                                                                                //Archon
            {
                if (!me.Powers.BuffIsActive(135663, 0))                                                                                                           //Slow Time
                {
                    var layout = WarningFont.GetTextLayout("\u22EF\u2995 " + /*me.Powers.GetBuff(135663).SnoPower.NameLocalized*/ "Bubble Up" + " \u2996\u22EF"); // UsedWizardPowers returns "Archon" instead of "Slow Time" so i used GetBuff() instead
                    WarningFont.DrawText(layout, HudWidth * 0.5f - (layout.Metrics.Width * 0.5f), HudHeight * WarningYPos);
                }
            }
            else
            {//NOT IN ARCHON
                if (_magicWeaponSkill != null)
                {
                    var layout = WarningFont.GetTextLayout("\u22EF\u2995 " + Hud.Sno.SnoPowers.Wizard_MagicWeapon.NameLocalized + " \u2996\u22EF");
                    if (!me.Powers.BuffIsActive(76108, 0))
                    {
                        WarningFont.DrawText(layout, HudWidth * 0.5f - (layout.Metrics.Width * 0.5f), HudHeight * WarningYPos);
                    }
                }

                if (_energyArmorSkill != null)
                {
                    var layout = WarningFont.GetTextLayout("\u22EF\u2995 " + Hud.Sno.SnoPowers.Wizard_EnergyArmor.NameLocalized + " \u2996\u22EF");
                    if (!me.Powers.BuffIsActive(86991, 0) && !me.Powers.BuffIsActive(86991, 1) && !me.Powers.BuffIsActive(86991, 2) && !me.Powers.BuffIsActive(86991, 3) && !me.Powers.BuffIsActive(86991, 4) && !me.Powers.BuffIsActive(86991, 5))
                    {
                        WarningFont.DrawText(layout, HudWidth * 0.5f - (layout.Metrics.Width * 0.5f), HudHeight * (WarningYPos + WarningYPosIncr));
                    }
                }
            }
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip || Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Barbarian)
            {
                return;
            }

            foreach (var player in Hud.Game.Players.Where(p => p.SnoArea.Sno == Hud.Game.Me.SnoArea.Sno))
            {
                DrawPlayerWarnings(player);
            }

            if (missingIP)
            {
                warningStr += "\u2620";
            }
            if (tooFar)
            {
                warningStr += "\u2757";
            }

            var textlayout = WarningFont.GetTextLayout(warningStr);

            WarningFont.DrawText(textlayout, HudWidth * 0.96f, HudHeight * 0.26f);
            missingIP  = false;
            tooFar     = false;
            warningStr = "";
        }
        private void DrawPlayerWarnings(IPlayer player)
        {
            var warning      = "";
            var portraitRect = player.PortraitUiElement.Rectangle;
            var yPos         = portraitRect.Y + YOffset * HudHeight;
            var xPos         = portraitRect.X + XOffset * HudWidth;

            if (!player.Powers.BuffIsActive(79528, 0) && !player.Powers.BuffIsActive(79528, 1)) //no ip
            {
                missingIP = true;
                warning  += "\u2620";
            }
            if (player.NormalizedXyDistanceToMe > 50f) //to far away
            {
                tooFar   = true;
                warning += "\u2757";
            }

            var textlayout = WarningFont.GetTextLayout(warning);

            WarningFont.DrawText(textlayout, xPos, yPos);
        }