psychopyro212

Untitled

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