TheGlew

RangeCircles

Nov 19th, 2020 (edited)
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.00 KB | None | 0 0
  1. using System.Linq;
  2. using SharpDX.DirectInput;
  3. using Turbo.Plugins.Default;
  4.  
  5. namespace Turbo.Plugins.glew
  6. {
  7.     public class RangeRound : BasePlugin, IInGameWorldPainter, IKeyEventHandler
  8.     {
  9.         public GroundCircleDecorator Round1 { get; set; }
  10.         public GroundCircleDecorator Round2 { get; set; }
  11.         public IKeyEvent ToggleKeyEvent { get; set; }
  12.         public int on { get; set; }
  13.        
  14.         public RangeRound()
  15.         {
  16.             Enabled = true;
  17.         }
  18.  
  19.         public override void Load(IController hud)
  20.         {
  21.             base.Load(hud);
  22.             on = 0;
  23.             ToggleKeyEvent = Hud.Input.CreateKeyEvent(true, Key.D9, false, false, false);  // Change Key.F9 to Key.# where # is your key of choice, for reference. https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.keys?view=net-5.0
  24.            
  25.             Round1 = new GroundCircleDecorator(Hud)
  26.             {
  27.                 Brush = Hud.Render.CreateBrush(175, 255, 115, 45, 4.0f), // CreateBrush(Opacity, Red, Green, Blue, Radius)
  28.                 Radius = 10f // Change this to your Lower Range Choice
  29.             };
  30.            
  31.             Round2 = new GroundCircleDecorator(Hud)
  32.             {
  33.                 Brush = Hud.Render.CreateBrush(255, 0, 40, 255, 4.0f), // CreateBrush(Opacity, Red, Green, Blue, Radius)
  34.                 Radius = 25f // Change this to your Higher Range Choice
  35.             };
  36.         }
  37.            
  38.         public void PaintWorld(WorldLayer layer)
  39.         {
  40.             if (Hud.Game.MapMode != MapMode.Minimap) return;
  41.             if (on==1)
  42.             Round1.Paint(null, Hud.Game.Me.FloorCoordinate, null);
  43.             if (on==2)
  44.             Round2.Paint(null, Hud.Game.Me.FloorCoordinate, null);
  45.             if (on==3)
  46.             {
  47.             Round1.Paint(null, Hud.Game.Me.FloorCoordinate, null);
  48.             Round2.Paint(null, Hud.Game.Me.FloorCoordinate, null);
  49.             }
  50.         }
  51.        
  52.         public void OnKeyEvent(IKeyEvent keyEvent)
  53.         {
  54.             if (keyEvent.IsPressed && ToggleKeyEvent.Matches(keyEvent))
  55.             {
  56.                 on++;
  57.                 if (on>3) on = 0;
  58.             }
  59.         }
  60.     }
  61. }
Add Comment
Please, Sign In to add comment