Advertisement
JackCeparou

BountyCacheIndicatorPlugin (ZX)

Apr 6th, 2017
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.94 KB | None | 0 0
  1. namespace Turbo.Plugins.ZX
  2. {
  3.     using System.Linq;
  4.     using Turbo.Plugins.Default;
  5.  
  6.     public class BountyCacheIndicatorPlugin : BasePlugin, IInGameWorldPainter
  7.     {
  8.         public WorldDecoratorCollection BountyCacheDecorator { get; set; }
  9.         public string GroundLabelText;
  10.  
  11.         public BountyCacheIndicatorPlugin()
  12.         {
  13.             Enabled = true;
  14.             //GroundLabelText = "BOUNTY";
  15.             GroundLabelText = null;
  16.         }
  17.  
  18.         public override void Load(IController hud)
  19.         {
  20.             base.Load(hud);
  21.  
  22.             BountyCacheDecorator = new WorldDecoratorCollection(
  23.                 new GroundCircleDecorator(Hud)
  24.                 {
  25.                     Brush = Hud.Render.CreateBrush(240, 200, 200, 0, 4),
  26.                     Radius = 1.5f,
  27.                 },
  28.                 new GroundLabelDecorator(Hud)
  29.                 {
  30.                     BackgroundBrush = Hud.Render.CreateBrush(220, 200, 200, 0, 0),
  31.                     TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 255, 255, true, false, false)
  32.                 },
  33.                 new MapShapeDecorator(Hud)
  34.                 {
  35.                     ShapePainter = new RotatingTriangleShapePainter(Hud),
  36.                     Brush = Hud.Render.CreateBrush(220, 200, 200, 0, 5),
  37.                     Radius = 10f,
  38.                     RadiusTransformator = new StandardPingRadiusTransformator(Hud, 250)
  39.                 }
  40.             );
  41.         }
  42.  
  43.         public void PaintWorld(WorldLayer layer)
  44.         {
  45.             var items = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "horadriccache");
  46.  
  47.             foreach (var item in items)
  48.             {
  49.                 var text = string.IsNullOrWhiteSpace(GroundLabelText) ? item.SnoItem.NameLocalized : GroundLabelText;
  50.                 BountyCacheDecorator.Paint(layer, item, item.FloorCoordinate, text);
  51.             }
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement