-
Member
Possible to draw circles around player to show specified range(s)?
I'm not sure if there is a plugin or anything already, at least that I've seen so far on the forums, but I was wondering if there is a plugin, or a code snippet that could be added somewhere, that would draw a circle around my character, showing distance to specified ranges, so that I could more easily identify if things are within range (such as for Bone Armour)?
-
Member
here's one. you can save as RangeRound.cs file and put into plugin/default folder.
I make the F9 key to show or change the circle. There're two circle, if you want only one you can delete those code about Round2, and change the (on>2) to (on>1)
Code:
using System.Linq;
using SharpDX.DirectInput;
namespace Turbo.Plugins.Default
{
public class RangeRound : BasePlugin, IInGameWorldPainter, IKeyEventHandler
{
public GroundCircleDecorator Round1 { get; set; }
public GroundCircleDecorator Round2 { get; set; }
public IKeyEvent ToggleKeyEvent { get; set; }
public int on { get; set; }
public RangeRound()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
on = 0;
ToggleKeyEvent = Hud.Input.CreateKeyEvent(true, Key.F9, false, false, false);
Round1 = new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(150, 0, 255, 0, 2.0f),
Radius = 15f
};
Round2 = new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(150, 0, 255, 0, 2.0f),
Radius = 25f
};
}
public void PaintWorld(WorldLayer layer)
{
if (Hud.Game.MapMode != MapMode.Minimap) return;
if (on==1) Round1.Paint(null, Hud.Game.Me.FloorCoordinate, null);
else if (on==2) Round2.Paint(null, Hud.Game.Me.FloorCoordinate, null);
}
public void OnKeyEvent(IKeyEvent keyEvent)
{
if (keyEvent.IsPressed && ToggleKeyEvent.Matches(keyEvent))
{
on++;
if (on>2) on = 0;
}
}
}
}
Last edited by Klamist; 01-21-2019 at 03:17 AM.
-
Post Thanks / Like - 2 Thanks
-
Member
Thanks heaps! And I would just change the 2 values (Radius - 15f and Radius = 25f) as needed, correct?
-
Member
Yes, if you just edit these two numbers, you can press F9 (you can change which key by modify key.F~ in code)
to switch:
no circle, 15 yards, 25yards.