Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ZeiCircle.cs "$Revision: 2440 $" "$Date: 2019-08-05 13:40:48 +0300 (ma, 05 elo 2019) $"
- // https://pastebin.com/eGUnK60J
- using SharpDX.Direct2D1;
- using SharpDX;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.JarJar.DefaultUI
- {
- // Idea from: https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-plugin-review-zone/618264-v7-2-international-glq-zeicircleforboss.html
- public class ZeiCircle : BasePlugin, IInGameWorldPainter
- {
- public WorldDecoratorCollection ZeiDecorator { get; set; }
- public WorldDecoratorCollection SteadyAimDecoratorOn { get; set; }
- public WorldDecoratorCollection SteadyAimDecoratorOff { get; set; }
- private GroundCircleDecorator zeiGroundCircle;
- public ZeiCircle() { Enabled = true; } // TODO: remember to check for ExplosiveMonsterPlugin
- public override void Load(IController hud)
- {
- base.Load(hud);
- var color = Color.Magenta;
- zeiGroundCircle = new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, color.R, color.G, color.B, 1.5f, DashStyle.Solid),
- Radius = 50f,
- };
- ZeiDecorator = new WorldDecoratorCollection(
- zeiGroundCircle,
- new GroundLabelDecorator(Hud)
- {
- BackgroundBrush = Hud.Render.CreateBrush(255, 255, 255, 64, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 9f, 255, 0, 0, 0, false, false, false),
- }
- );
- color = Color.HotPink;
- SteadyAimDecoratorOn = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, color.R, color.G, color.B, 1.5f, DashStyle.Solid),
- Radius = 10f,
- },
- new GroundLabelDecorator(Hud)
- {
- BackgroundBrush = Hud.Render.CreateBrush(255, 255, 255, 64, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 9f, 255, 0, 0, 0, false, false, false),
- }
- );
- color = Color.DeepPink;
- SteadyAimDecoratorOff = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, color.R, color.G, color.B, 2.5f, DashStyle.Dash),
- Radius = 10f,
- },
- new GroundLabelDecorator(Hud)
- {
- BackgroundBrush = Hud.Render.CreateBrush(255, 255, 255, 64, 0),
- TextFont = Hud.Render.CreateFont("tahoma", 9f, 255, 0, 0, 0, false, false, false),
- }
- );
- }
- public void PaintWorld(WorldLayer layer)
- {
- if (Hud.Game.IsInTown)
- return;
- if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map))
- return;
- if (Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.ZeisStoneOfVengeancePrimary.Sno, iconIndex: 0))
- {
- var helperRadius = double.MaxValue;
- foreach (var monster in Hud.Game.AliveMonsters)
- {
- var dist = (float)monster.NormalizedXyDistanceToMe;
- if (dist < helperRadius)
- {
- helperRadius = dist;
- }
- }
- if (helperRadius != double.MaxValue) // Can see monsters!
- {
- if (helperRadius > 50)
- {
- helperRadius = 50;
- }
- zeiGroundCircle.Radius = (float)helperRadius;
- // Show zei radius only if less than 50 yards.
- ZeiDecorator.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, helperRadius < 50 ? string.Format("{0:0}", helperRadius) : null);
- }
- }
- if (Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.DemonHunter_Passive_SteadyAim.Sno, iconIndex: 0))
- {
- if (Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.DemonHunter_Passive_SteadyAim.Sno, iconIndex: 1))
- {
- SteadyAimDecoratorOn.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, null);
- }
- else
- {
- SteadyAimDecoratorOff.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, null);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement