Advertisement
Guest User

MinimapCursorPlugin.cs

a guest
Nov 29th, 2017
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using Turbo.Plugins.Default;
  5.  
  6. namespace Turbo.Plugins.johnbl
  7. {
  8.     public class MinimapCursorPlugin : BasePlugin, IInGameWorldPainter
  9.     {
  10.         public WorldDecoratorCollection MiniMapVisorDecorator { get; set; }
  11.         public bool ShowInTown { get; set; }
  12.        
  13.         public MinimapCursorPlugin()
  14.         {
  15.             Enabled = true;
  16.             ShowInTown = false;
  17.         }
  18.  
  19.         public override void Load(IController hud)
  20.         {
  21.             base.Load(hud);
  22.            
  23.             MiniMapVisorDecorator = new WorldDecoratorCollection(
  24.             new MapShapeDecorator(Hud)
  25.             {
  26.                 Brush = Hud.Render.CreateBrush(255, 255, 255, 255, 1f),
  27.                 ShapePainter = new PlusShapePainter(Hud),
  28.                 Radius = 10,
  29.             },
  30.            
  31.             new MapShapeDecorator(Hud)
  32.             {
  33.                 Brush = Hud.Render.CreateBrush(255, 255, 255, 255, 1f),
  34.                 ShapePainter = new CircleShapePainter(Hud),
  35.                 Radius = 5,
  36.             }
  37.             );
  38.         }
  39.  
  40.         public void PaintWorld(WorldLayer layer)
  41.         {
  42.             if (!ShowInTown && Hud.Game.IsInTown) return;
  43.            
  44.             var cursorScreenCoord = Hud.Window.CreateScreenCoordinate(Hud.Window.CursorX, Hud.Window.CursorY);
  45.             var visorWorldCoord = cursorScreenCoord.ToWorldCoordinate();
  46.            
  47.             MiniMapVisorDecorator.Paint(layer, null, visorWorldCoord, null);                       
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement