Advertisement
zerenx

THUD_BountyCacheIndicatorPlugin.cs

Apr 6th, 2017
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 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.         }
  16.  
  17.         public override void Load(IController hud)
  18.         {
  19.             base.Load(hud);
  20.  
  21.             BountyCacheDecorator = new WorldDecoratorCollection(
  22.                 new GroundCircleDecorator(Hud)
  23.                 {
  24.                     Brush = Hud.Render.CreateBrush(240, 200, 200, 0, 4),
  25.                     Radius = 1.5f,
  26.                 },
  27.                 new GroundLabelDecorator(Hud)
  28.                 {
  29.                     BackgroundBrush = Hud.Render.CreateBrush(220, 200, 200, 0, 0),
  30.                     TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 255, 255, true, false, false)
  31.                 },
  32.                 new MapShapeDecorator(Hud)
  33.                 {
  34.                     ShapePainter = new RotatingTriangleShapePainter(Hud),
  35.                     Brush = Hud.Render.CreateBrush(220, 200, 200, 0, 5),
  36.                     Radius = 10f,
  37.                     RadiusTransformator = new StandardPingRadiusTransformator(Hud, 250)
  38.                 }
  39.             );
  40.         }
  41.  
  42.         public void PaintWorld(WorldLayer layer)
  43.         {            
  44.             var items = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && item.SnoItem.MainGroupCode == "horadriccache");
  45.  
  46.             foreach (var item in items)
  47.             {
  48.                 var text = string.IsNullOrWhiteSpace(GroundLabelText) ? item.SnoItem.NameLocalized : GroundLabelText;
  49.                 BountyCacheDecorator.Paint(layer, item, item.FloorCoordinate, GroundLabelText);
  50.             }
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement