are standing in the Oculus, the border will turn into a dashed style (class doesn't matter). This way it's is easy to tell whether you are in one or more oculus rings.
Code:
using Turbo.Plugins.Default;
using System.Linq;
namespace Turbo.Plugins.User
{
public class OculusColor : BasePlugin, IInGameWorldPainter, ICustomizer
{
public WorldDecoratorCollection DecoratorOutside { get; set; }
public WorldDecoratorCollection DecoratorInside { get; set; }
public OculusColor()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
DecoratorOutside = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 128, 255, 0, -2),
Radius = 10.0f,
},
new GroundLabelDecorator(Hud)
{
CountDownFrom = 7,
TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 255, 96, true, false, 128, 0, 0, 0, true),
},
new GroundTimerDecorator(Hud)
{
CountDownFrom = 7,
BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 192, 0, 0),
Radius = 30,
},
new MapShapeDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 128, 255, 0, 2),
Radius = 10.0f,
ShapePainter = new CircleShapePainter(Hud),
}
);
DecoratorInside = new WorldDecoratorCollection(
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 128, 255, 0, -2, SharpDX.Direct2D1.DashStyle.Dash),
Radius = 10.0f,
},
new GroundLabelDecorator(Hud)
{
CountDownFrom = 7,
TextFont = Hud.Render.CreateFont("tahoma", 11, 255, 96, 255, 96, true, false, 128, 0, 0, 0, true),
},
new GroundTimerDecorator(Hud)
{
CountDownFrom = 7,
BackgroundBrushEmpty = Hud.Render.CreateBrush(128, 0, 0, 0, 0),
BackgroundBrushFill = Hud.Render.CreateBrush(200, 0, 192, 0, 0),
Radius = 30,
},
new MapShapeDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(255, 128, 255, 0, 2),
Radius = 10.0f,
ShapePainter = new CircleShapePainter(Hud),
}
);
}
public void Customize()
{
Hud.TogglePlugin<OculusPlugin>(false);
}
public void PaintWorld(WorldLayer layer)
{
if (Hud.Game.IsInTown) return;
var actors = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._generic_proxy && x.GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, Hud.Sno.SnoPowers.OculusRing.Sno) == 1);
if (actors.Count() > 0){
foreach (var actor in actors){
float dist = actor.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate);
if (dist < 13.3f){
DecoratorInside.Paint(layer, actor, actor.FloorCoordinate, null);
}
else{
DecoratorOutside.Paint(layer, actor, actor.FloorCoordinate, null);
}
}
}
}
}
}