psychopyro212

Untitled

Feb 17th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.29 KB | None | 0 0
  1. namespace Turbo.Plugins.PsychosPlugins
  2. {
  3. using Turbo.Plugins.Default;
  4. using System.Linq;
  5.  
  6.     public class ShrineLabelPlugin : BasePlugin
  7.     {
  8.         public WorldDecoratorCollection BlessedShrineDecorator { get; set; }
  9.         public WorldDecoratorCollection EnlightenedShrineDecorator { get; set; }
  10.         public WorldDecoratorCollection FortuneShrineDecorator { get; set; }
  11.         public WorldDecoratorCollection FrenziedShrineDecorator { get; set; }
  12.         public WorldDecoratorCollection EmpoweredShrineDecorator { get; set; }
  13.         public WorldDecoratorCollection FleetingShrineDecorator { get; set; }
  14.         public WorldDecoratorCollection PowerPylonDecorator { get; set; }
  15.         public WorldDecoratorCollection ConduitPylonDecorator { get; set; }
  16.         public WorldDecoratorCollection ChannelingPylonDecorator { get; set; }
  17.         public WorldDecoratorCollection ShieldPylonDecorator { get; set; }
  18.         public WorldDecoratorCollection SpeedPylonDecorator { get; set; }
  19.         public WorldDecoratorCollection BanditShrineDecorator { get; set; }
  20.         public WorldDecoratorCollection PossibleRiftPylonDecorator { get; set; }
  21.         public string BlessedShrineName { get; set; }
  22.         public string EnlightenedShrineName { get; set; }
  23.         public string FortuneShrineName { get; set; }
  24.         public string FrenziedShrineName { get; set; }
  25.         public string EmpoweredShrineName { get; set; }
  26.         public string FleetingShrineName { get; set; }
  27.         public string PowerPylonName { get; set; }
  28.         public string ConduitPylonName { get; set; }
  29.         public string ChannelingPylonName { get; set; }
  30.         public string PossibleRiftPylonName { get; set; }
  31.         public string ShieldPylonName { get; set; }
  32.         public string SpeedPylonName { get; set; }
  33.         public string BanditShrineName { get; set; }
  34.         public bool UseCustomColors { get; set; }
  35.         public bool UseCustomNames { get; set; }
  36.  
  37.         public ShrineLabelPlugin()
  38.         {
  39.             Enabled = true;
  40.             UseCustomColors = false;
  41.             UseCustomNames = false;
  42.         }
  43.  
  44.         public override void Load(IController hud)
  45.         {
  46.             base.Load(hud);
  47.  
  48.             BlessedShrineDecorator = new WorldDecoratorCollection(
  49.                 new MapLabelDecorator(Hud) {
  50.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  51.                     RadiusOffset = 5.0f,
  52.                 }
  53.             );
  54.  
  55.             EnlightenedShrineDecorator = new WorldDecoratorCollection(
  56.                 new MapLabelDecorator(Hud) {
  57.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  58.                     RadiusOffset = 5.0f,
  59.                 }
  60.             );
  61.  
  62.             FortuneShrineDecorator = new WorldDecoratorCollection(
  63.                 new MapLabelDecorator(Hud) {
  64.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  65.                     RadiusOffset = 5.0f,
  66.                 }
  67.             );
  68.  
  69.             FrenziedShrineDecorator = new WorldDecoratorCollection(
  70.                 new MapLabelDecorator(Hud) {
  71.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  72.                     RadiusOffset = 5.0f,
  73.                 }
  74.             );
  75.  
  76.             EmpoweredShrineDecorator = new WorldDecoratorCollection(
  77.                 new MapLabelDecorator(Hud) {
  78.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  79.                     RadiusOffset = 5.0f,
  80.                 }
  81.             );
  82.  
  83.             FleetingShrineDecorator = new WorldDecoratorCollection(
  84.                 new MapLabelDecorator(Hud) {
  85.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  86.                     RadiusOffset = 5.0f,
  87.                 }
  88.             );
  89.  
  90.             PowerPylonDecorator = new WorldDecoratorCollection(
  91.                 new MapLabelDecorator(Hud) {
  92.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  93.                     RadiusOffset = 5.0f,
  94.                 }
  95.             );
  96.  
  97.             ConduitPylonDecorator = new WorldDecoratorCollection(
  98.                 new MapLabelDecorator(Hud) {
  99.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  100.                     RadiusOffset = 5.0f,
  101.                 }
  102.             );
  103.  
  104.             ChannelingPylonDecorator = new WorldDecoratorCollection(
  105.                 new MapLabelDecorator(Hud) {
  106.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  107.                     RadiusOffset = 5.0f,
  108.                 }
  109.             );
  110.  
  111.             ShieldPylonDecorator = new WorldDecoratorCollection(
  112.                 new MapLabelDecorator(Hud) {
  113.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  114.                     RadiusOffset = 5.0f,
  115.                 }
  116.             );
  117.  
  118.             SpeedPylonDecorator = new WorldDecoratorCollection(
  119.                 new MapLabelDecorator(Hud) {
  120.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  121.                     RadiusOffset = 5.0f,
  122.                 }
  123.             );
  124.  
  125.             BanditShrineDecorator = new WorldDecoratorCollection(
  126.                 new MapLabelDecorator(Hud) {
  127.                     LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  128.                     RadiusOffset = 5.0f,
  129.                 }
  130.             );
  131.             PossibleRiftPylonDecorator = new WorldDecoratorCollection(
  132.                 new MapLabelDecorator(Hud) {
  133.  
  134.                     LabelFont = Hud.Render.CreateFont("tahoma", 7f, 255, 255, 255, 0, false, false, 128, 0, 0, 0, true),
  135.  
  136.                     RadiusOffset = 5.0f,
  137.  
  138.                 }
  139.             );
  140.  
  141.             BlessedShrineName = "Blessed Shrine";
  142.             EnlightenedShrineName = "Enlightened Shrine";
  143.             FortuneShrineName = "Fortune Shrine";
  144.             FrenziedShrineName = "Frenzied Shrine";
  145.             EmpoweredShrineName = "Empowered Shrine";
  146.             FleetingShrineName = "Fleeting Shrine";
  147.             PowerPylonName = "Power Pylon";
  148.             ConduitPylonName = "Conduit Plyon";
  149.             ChannelingPylonName = "Channeling Pylon";
  150.             ShieldPylonName = "Shield Pylon";
  151.             SpeedPylonName = "Speed Pylon";
  152.             BanditShrineName = "Bandit Shrine";
  153.             PossibleRiftPylonName = "Pylon?";
  154.         }
  155.            
  156.         public override void Customize()
  157.         {
  158.             if (UseCustomColors == false && UseCustomNames == false)
  159.             {
  160.                 Hud.RunOnPlugin<ShrinePlugin>(plugin =>
  161.                 {
  162.                     plugin.AllShrineDecorator.Add(new MapLabelDecorator(Hud)
  163.                     {
  164.                         LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
  165.                         RadiusOffset = 5.0f,
  166.                     });
  167.                 });
  168.             }
  169.         }
  170.  
  171.         public override void PaintWorld(WorldLayer layer) {
  172.             var ShrineName = string.Empty;
  173.             if (UseCustomColors == true || UseCustomNames == true)
  174.             {
  175.                 var shrines = Hud.Game.Shrines;
  176.                 foreach (var shrine in shrines)
  177.                 {
  178.                     switch (shrine.Type)
  179.                     {
  180.                         case ShrineType.BlessedShrine:
  181.                             if (UseCustomNames == true){ShrineName = BlessedShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  182.                             BlessedShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  183.                             break;
  184.                         case ShrineType.EnlightenedShrine:
  185.                         if (UseCustomNames == true){ShrineName = EnlightenedShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  186.                             EnlightenedShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  187.                             break;
  188.                         case ShrineType.FortuneShrine:
  189.                         if (UseCustomNames == true){ShrineName = FortuneShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  190.                             FortuneShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  191.                             break;
  192.                         case ShrineType.FrenziedShrine:
  193.                         if (UseCustomNames == true){ShrineName = FrenziedShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  194.                             FrenziedShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  195.                             break;
  196.                         case ShrineType.EmpoweredShrine:
  197.                         if (UseCustomNames == true){ShrineName = EmpoweredShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  198.                             EmpoweredShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  199.                             break;
  200.                         case ShrineType.FleetingShrine:
  201.                         if (UseCustomNames == true){ShrineName = FleetingShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  202.                             FleetingShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  203.                             break;
  204.                         case ShrineType.PowerPylon:
  205.                         if (UseCustomNames == true){ShrineName = PowerPylonName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  206.                             PowerPylonDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  207.                             break;
  208.                         case ShrineType.ConduitPylon:
  209.                         if (UseCustomNames == true){ShrineName = ConduitPylonName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  210.                             ConduitPylonDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  211.                             break;
  212.                         case ShrineType.ChannelingPylon:
  213.                         if (UseCustomNames == true){ShrineName = ChannelingPylonName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  214.                             ChannelingPylonDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  215.                             break;
  216.                         case ShrineType.ShieldPylon:
  217.                         if (UseCustomNames == true){ShrineName = ShieldPylonName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  218.                             ShieldPylonDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  219.                             break;
  220.                         case ShrineType.SpeedPylon:
  221.                         if (UseCustomNames == true){ShrineName = SpeedPylonName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  222.                             SpeedPylonDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  223.                             break;
  224.                         case ShrineType.BanditShrine:
  225.                         if (UseCustomNames == true){ShrineName = BanditShrineName;} else {ShrineName = shrine.SnoActor.NameLocalized;}
  226.                             BanditShrineDecorator.Paint(layer, shrine, shrine.FloorCoordinate, ShrineName);
  227.                             break;
  228.                     }
  229.                 }
  230.                
  231.                 var riftPylonSpawnPoints = Hud.Game.Actors.Where(x => x.SnoActor.Sno == 428690);
  232.                 foreach (var actor in riftPylonSpawnPoints)
  233.                 {
  234.                     if (UseCustomNames == true){ShrineName = PossibleRiftPylonName;} else {ShrineName = "pylon?";}
  235.                     PossibleRiftPylonDecorator.Paint(layer, actor, actor.FloorCoordinate, ShrineName);
  236.                    
  237.                 }
  238.             }
  239.         }
  240.     }
  241. }
Advertisement
Add Comment
Please, Sign In to add comment