Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Turbo.Plugins.PsychosPlugins
- {
- //credit to http://turbohud.freeforums.net/user/12675 for the massive update to this plugin, thank you for the help!
- using System.Collections.Generic;
- using System.Linq;
- using Turbo.Plugins.Default;
- public class ShrineLabelPlugin : BasePlugin
- {
- public bool UseCustomColors { get; set; }
- public bool UseCustomNames { get; set; }
- public string PossibleRiftPylonName { get; set; }
- public Dictionary<ShrineType, WorldDecoratorCollection> ShrineDecorators { get; set; }
- public Dictionary<ShrineType, string> ShrineCustomNames { get; set; }
- public WorldDecoratorCollection PossibleRiftPylonDecorators { get; set; }
- public ShrineLabelPlugin()
- {
- Enabled = true;
- UseCustomColors = false;
- UseCustomNames = false;
- }
- public WorldDecoratorCollection CreateDecorators(float size = 6f, int a = 192, int r = 255, int g = 255, int b = 55, float radiusOffset = 5f)
- {
- return new WorldDecoratorCollection(
- new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", size, a, r, g, b, false, false, 128, 0, 0, 0, true),
- RadiusOffset = radiusOffset,
- }
- );
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- ShrineDecorators = new Dictionary<ShrineType, WorldDecoratorCollection>();
- ShrineCustomNames = new Dictionary<ShrineType, string>();
- ShrineDecorators[ShrineType.PoolOfReflection] = CreateDecorators();
- ShrineDecorators[ShrineType.HealingWell] = CreateDecorators();
- ShrineDecorators[ShrineType.BlessedShrine] = CreateDecorators();
- ShrineDecorators[ShrineType.EnlightenedShrine] = CreateDecorators();
- ShrineDecorators[ShrineType.FortuneShrine] = CreateDecorators();
- ShrineDecorators[ShrineType.FrenziedShrine] = CreateDecorators();
- ShrineDecorators[ShrineType.EmpoweredShrine] = CreateDecorators();
- ShrineDecorators[ShrineType.FleetingShrine] = CreateDecorators();
- ShrineDecorators[ShrineType.PowerPylon] = CreateDecorators();
- ShrineDecorators[ShrineType.ConduitPylon] = CreateDecorators();
- ShrineDecorators[ShrineType.ChannelingPylon] = CreateDecorators();
- ShrineDecorators[ShrineType.ShieldPylon] = CreateDecorators();
- ShrineDecorators[ShrineType.SpeedPylon] = CreateDecorators();
- ShrineDecorators[ShrineType.BanditShrine] = CreateDecorators();
- PossibleRiftPylonDecorators = CreateDecorators(7f, 255, 255, 255, 0);
- ShrineCustomNames[ShrineType.PoolOfReflection] = string.Empty;
- ShrineCustomNames[ShrineType.HealingWell] = string.Empty;
- ShrineCustomNames[ShrineType.BlessedShrine] = "Blessed Shrine";
- ShrineCustomNames[ShrineType.EnlightenedShrine] = "Enlightened Shrine";
- ShrineCustomNames[ShrineType.FortuneShrine] = "Fortune Shrine";
- ShrineCustomNames[ShrineType.FrenziedShrine] = "Frenzied Shrine";
- ShrineCustomNames[ShrineType.EmpoweredShrine] = "Empowered Shrine";
- ShrineCustomNames[ShrineType.FleetingShrine] = "Fleeting Shrine";
- ShrineCustomNames[ShrineType.PowerPylon] = "Power Pylon";
- ShrineCustomNames[ShrineType.ConduitPylon] = "Conduit Pylon";
- ShrineCustomNames[ShrineType.ChannelingPylon] = "Channeling Pylon";
- ShrineCustomNames[ShrineType.ShieldPylon] = "Shield Pylon";
- ShrineCustomNames[ShrineType.SpeedPylon] = "Speed Pylon";
- ShrineCustomNames[ShrineType.BanditShrine] = "Bandit Shrine";
- PossibleRiftPylonName = "Pylon?";
- }
- public override void Customize()
- {
- if (UseCustomColors == false && UseCustomNames == false)
- {
- Hud.RunOnPlugin<ShrinePlugin>(plugin =>
- {
- plugin.AllShrineDecorator.Add(new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 255, 255, 55, false, false, 128, 0, 0, 0, true),
- RadiusOffset = 5.0f,
- });
- });
- }
- }
- public override void PaintWorld(WorldLayer layer)
- {
- if (UseCustomColors != true && UseCustomNames != true) return;
- var shrines = Hud.Game.Shrines.Where(s => s.DisplayOnOverlay);
- foreach (var shrine in shrines)
- {
- if (!ShrineDecorators.ContainsKey(shrine.Type)) continue;
- var shrineName = UseCustomNames ? ShrineCustomNames[shrine.Type] : shrine.SnoActor.NameLocalized;
- ShrineDecorators[shrine.Type].Paint(layer, shrine, shrine.FloorCoordinate, shrineName);
- }
- var riftPylonSpawnPoints = Hud.Game.Actors.Where(x => x.SnoActor.Sno == 428690);
- foreach (var actor in riftPylonSpawnPoints)
- {
- PossibleRiftPylonDecorators.Paint(layer, actor, actor.FloorCoordinate, UseCustomNames ? PossibleRiftPylonName : "pylon?");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement