Advertisement
zjqyf

HealthGlobePlugin.cs

May 7th, 2017
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System.Linq;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.glq
  5. {
  6. public class HealthGlobePlugin : BasePlugin, IInGameWorldPainter
  7. {
  8.  
  9. public WorldDecoratorCollection HealthGlobeDecorator { get; set; }
  10.  
  11. public HealthGlobePlugin()
  12. {
  13. Enabled = true;
  14. }
  15.  
  16. public override void Load(IController hud)
  17. {
  18. base.Load(hud);
  19.  
  20. HealthGlobeDecorator = new WorldDecoratorCollection(
  21.  
  22. new MapShapeDecorator(Hud)
  23. {
  24. Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 0),
  25. ShapePainter = new CircleShapePainter(Hud),
  26. Radius = 4f,
  27. },
  28. new GroundCircleDecorator(Hud)
  29. {
  30. Brush = Hud.Render.CreateBrush(255, 255, 0, 0, 0),
  31. Radius = 0.7f
  32. }
  33. );
  34. }
  35.  
  36. public void PaintWorld(WorldLayer layer)
  37. {
  38.  
  39. var healthGlobes = Hud.Game.Actors.Where(x => x.SnoActor.Kind == ActorKind.HealthGlobe);
  40.  
  41. foreach (var actor in healthGlobes)
  42.  
  43. {
  44. HealthGlobeDecorator.Paint(layer, actor, actor.FloorCoordinate, "");
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement