Advertisement
Guest User

TurboHud AdvancedMarkerPlugin

a guest
Jun 27th, 2018
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.56 KB | None | 0 0
  1. using Turbo.Plugins.Default;
  2.  
  3. namespace Turbo.Plugins.Xenthalon
  4. {
  5.  
  6.     public class AdvancedMarkerPlugin : BasePlugin, IInGameWorldPainter, ICustomizer
  7.     {
  8.         public WorldDecoratorCollection QuestDecorator { get; set; }
  9.         public WorldDecoratorCollection KeywardenDecorator { get; set; }
  10.         public WorldDecoratorCollection BossDecorator { get; set; }
  11.  
  12.         public AdvancedMarkerPlugin()
  13.         {
  14.             Enabled = true;
  15.         }
  16.  
  17.         public override void Load(IController hud)
  18.         {
  19.             base.Load(hud);
  20.  
  21.             QuestDecorator = new WorldDecoratorCollection(
  22.                 new MapShapeDecorator(Hud)
  23.                 {
  24.                     Brush = Hud.Render.CreateBrush(192, 255, 255, 55, -1),
  25.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  26.                     Radius = 10.0f,
  27.                     ShapePainter = new CircleShapePainter(Hud),
  28.                 },
  29.                 new MapLabelDecorator(Hud)
  30.                 {
  31.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 255, 0, false, false, 128, 0, 0, 0, true),
  32.                     RadiusOffset = 10,
  33.                     Up = true,
  34.                 },
  35.                 new MapShapeDecorator(Hud)
  36.                 {
  37.                     Brush = Hud.Render.CreateBrush(192, 255, 255, 55, -1),
  38.                     ShapePainter = new LineFromMeShapePainter(Hud)
  39.                 }
  40.             );
  41.  
  42.             KeywardenDecorator = new WorldDecoratorCollection(
  43.                 new MapShapeDecorator(Hud)
  44.                 {
  45.                     Brush = Hud.Render.CreateBrush(192, 238, 130, 238, -1),
  46.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  47.                     Radius = 10.0f,
  48.                     ShapePainter = new CircleShapePainter(Hud),
  49.                 },
  50.                 new MapLabelDecorator(Hud)
  51.                 {
  52.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 20, 255, false, false, 128, 0, 0, 0, true),
  53.                     RadiusOffset = 10,
  54.                     Up = true,
  55.                 },
  56.                 new MapShapeDecorator(Hud)
  57.                 {
  58.                     Brush = Hud.Render.CreateBrush(192, 238, 130, 238, -1),
  59.                     ShapePainter = new LineFromMeShapePainter(Hud)
  60.                 }
  61.             );
  62.  
  63.             BossDecorator = new WorldDecoratorCollection(
  64.                 new MapShapeDecorator(Hud)
  65.                 {
  66.                     Brush = Hud.Render.CreateBrush(192, 180, 0, 0, -1),
  67.                     ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
  68.                     Radius = 10.0f,
  69.                     ShapePainter = new CircleShapePainter(Hud),
  70.                 },
  71.                 new MapLabelDecorator(Hud)
  72.                 {
  73.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 200, 255, 0, 0, false, false, 128, 0, 0, 0, true),
  74.                     RadiusOffset = 10,
  75.                     Up = true,
  76.                 },
  77.                 new MapShapeDecorator(Hud)
  78.                 {
  79.                     Brush = Hud.Render.CreateBrush(192, 180, 0, 0, -1),
  80.                     ShapePainter = new LineFromMeShapePainter(Hud)
  81.                 }
  82.             );
  83.         }
  84.  
  85.         public void PaintWorld(WorldLayer layer)
  86.         {
  87.             var markers = Hud.Game.Markers;
  88.  
  89.             foreach (var marker in markers)
  90.             {
  91.                 QuestDecorator.ToggleDecorators<GroundLabelDecorator>(!marker.FloorCoordinate.IsOnScreen()); // do not display ground labels when the marker is on the screen
  92.                 KeywardenDecorator.ToggleDecorators<GroundLabelDecorator>(!marker.FloorCoordinate.IsOnScreen());
  93.                 BossDecorator.ToggleDecorators<GroundLabelDecorator>(!marker.FloorCoordinate.IsOnScreen());
  94.  
  95.                 if (marker.SnoQuest != null)
  96.                 {
  97.                     QuestDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
  98.                 }
  99.                 else if (marker.SnoActor != null)
  100.                 {
  101.                     if (marker.SnoActor.Code.Contains("_Boss_"))
  102.                     {
  103.                         BossDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
  104.                     }
  105.                     else
  106.                     {
  107.                         KeywardenDecorator.Paint(layer, null, marker.FloorCoordinate, marker.Name);
  108.                     }
  109.                 }
  110.             }
  111.         }
  112.  
  113.         public void Customize()
  114.         {
  115.             Hud.TogglePlugin<MarkerPlugin>(false);  // disable default MarkerPlugin
  116.         }
  117.  
  118.     }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement