Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PluginEnablerOrDisablerPlugin.cs "$Revision: 1394 $" "$Date: 2019-03-16 12:39:39 +0200 (la, 16 maalis 2019) $"
- using SharpDX.Direct2D1;
- using System.Collections.Generic;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.User
- {
- public class PluginEnablerOrDisablerPlugin : BasePlugin, ICustomizer
- {
- public PluginEnablerOrDisablerPlugin() { Enabled = true; Order = 100; }
- public void Customize()
- {
- // Bottom panel customization.
- // Hide DPS label that is over normal skill "key" label.
- Hud.RunOnPlugin<Turbo.Plugins.Default.OriginalSkillBarPlugin>(plugin =>
- {
- plugin.SkillPainter.EnableSkillDpsBar = false;
- plugin.SkillPainter.EnableDetailedDpsHint = false;
- });
- // Inventory and Stash customization.
- // Disable item graying and cube animation.
- Hud.RunOnPlugin<Turbo.Plugins.Default.InventoryAndStashPlugin>(plugin =>
- {
- plugin.LooksGoodDisplayEnabled = false;
- plugin.NotGoodDisplayEnabled = false;
- plugin.DefinitelyBadDisplayEnabled = false;
- plugin.CanCubedEnabled = false;
- });
- // Minimap customization.
- // Show only Normal and Resplendent chests.
- Hud.RunOnPlugin<Turbo.Plugins.Default.ChestPlugin>(plugin =>
- {
- plugin.LoreChestDecorator.Decorators.Clear();
- });
- // Worldmap and Minimap customization.
- // Disable default Monster plugin - can be enabled and works with MyMonsterColoring.
- Hud.TogglePlugin<Turbo.Plugins.Default.StandardMonsterPlugin>(false);
- // Disable default MonsterRiftProgressionColoringPlugin.
- Hud.TogglePlugin<Turbo.Plugins.Default.MonsterRiftProgressionColoringPlugin>(false);
- // Enable "minimalistic" custom monster coloring scheme both in rifts and outside them.
- Hud.TogglePlugin<Turbo.Plugins.User.MyMonsterColoring>(true);
- // Make Pickup Range indicator more "prominent" but disable it. Some builds might find this useful, though.
- Hud.RunOnPlugin<Turbo.Plugins.Default.PickupRangePlugin>(plugin =>
- {
- plugin.Enabled = false;
- plugin.FillBrush = Hud.Render.CreateBrush(6, 255, 255, 255, 0);
- plugin.OutlineBrush = Hud.Render.CreateBrush(24, 0, 0, 0, 3);
- });
- // Show only ancient and primal data, hide item labels.
- Hud.RunOnPlugin<Turbo.Plugins.Default.ItemsPlugin>(plugin =>
- {
- plugin.EnableSpeakPrimal = true;
- plugin.EnableSpeakPrimalSet = true;
- plugin.LegendaryDecorator.Enabled = false;
- plugin.SetDecorator.Enabled = false;
- plugin.InArmorySetDecorator.Enabled = false;
- plugin.AncientDecorator.ToggleDecorators<GroundLabelDecorator>(false);
- plugin.AncientDecorator.Decorators.Add(new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", 6, 255, 235, 120, 0, true, false, false),
- RadiusOffset = 14,
- Up = true,
- });
- plugin.AncientSetDecorator.ToggleDecorators<GroundLabelDecorator>(false);
- plugin.AncientSetDecorator.Decorators.Add(new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", 6, 255, 0, 170, 0, true, false, false),
- RadiusOffset = 14,
- Up = true,
- });
- plugin.PrimalDecorator.ToggleDecorators<GroundLabelDecorator>(false);
- plugin.PrimalDecorator.Decorators.Add(new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 240, 20, 0, true, false, false),
- RadiusOffset = 14,
- Up = true,
- });
- plugin.PrimalSetDecorator.ToggleDecorators<GroundLabelDecorator>(false);
- plugin.PrimalSetDecorator.Decorators.Add(new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 240, 20, 0, true, false, false),
- RadiusOffset = 14,
- Up = true,
- });
- // Add ground circle for Death Breaths.
- plugin.DeathsBreathDecorator.Add(new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(192, 102, 202, 177, -2),
- Radius = 1.25f,
- });
- });
- // Change Sentry minimap markers from orange triangle to white plus-sign.
- Hud.RunOnPlugin<PlayerSkillPlugin>(plugin =>
- {
- List<IWorldDecorator> decorators = new List<IWorldDecorator>();
- decorators.AddRange(plugin.SentryDecorator.Decorators);
- decorators.AddRange(plugin.SentryWithCustomEngineeringDecorator.Decorators);
- foreach (var decorator in decorators)
- {
- if (decorator is MapShapeDecorator)
- {
- ((MapShapeDecorator)decorator).Brush = Hud.Render.CreateBrush(255, 255, 255, 255, 2.5f);
- ((MapShapeDecorator)decorator).ShapePainter = new PlusShapePainter(Hud);
- ((MapShapeDecorator)decorator).Radius = 4.5f;
- }
- }
- });
- }
- }
- public class MyMonsterColoring : BasePlugin, IInGameWorldPainter
- {
- public float TrashBreakpoint { get; set; } = 2.50f; // 33% of rift orb value breakpoint.
- public float KillBreakpoint { get; set; } = 3.75f; // 50% of rift orb value breakpoint.
- // Monster decorators by type.
- public WorldDecoratorCollection EliteDecorator { get; set; } // Supports GroundLabelDecorator, other decorators do not!
- public WorldDecoratorCollection BlueDecorator { get; set; }
- public WorldDecoratorCollection GreenDecorator { get; set; }
- public WorldDecoratorCollection GreyDecorator { get; set; }
- // Special decorators.
- public WorldDecoratorCollection BossDecorator { get; set; } // Draws 50 yard circle around boss.
- public WorldDecoratorCollection PlayerDecorator { get; set; } // Draws player hitbox to show where player is during boss/elite fights.
- public IBrush ShadowBrush { get; set; }
- public float RiftProgressionRange { get; set; } = 50f;
- public float BossCirleRadius { get; set; } = 50f;
- public MyMonsterColoring() { Enabled = true; Order = 500; }
- public override void Load(IController hud)
- {
- base.Load(hud);
- ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1);
- BossDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 192, 96, 0, 1.5f), // Dim orange circle
- Radius = BossCirleRadius,
- }
- );
- PlayerDecorator = new WorldDecoratorCollection(
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 153, 204, 255, 3.5f, DashStyle.DashDot), // Light blue dash-dotted circle
- Radius = -1,
- }
- );
- EliteDecorator = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 255, 200, 100, 2), // Dim yellow circle
- ShadowBrush = ShadowBrush,
- Radius = 4f,
- },
- new GroundCircleDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(255, 255, 0, 255, 2f), // Violet circle for monster hitbox
- Radius = -1, // Show monster hitbox
- }
- );
- BlueDecorator = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 60, 128, 255, 3), // Dodger blue circle
- ShadowBrush = ShadowBrush,
- Radius = 3.5f,
- }
- );
- GreenDecorator = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- ShapePainter = new CircleShapePainter(Hud),
- Brush = Hud.Render.CreateBrush(255, 128, 255, 0, 3), // Green circle
- ShadowBrush = ShadowBrush,
- Radius = 3f,
- }
- );
- GreyDecorator = new WorldDecoratorCollection(
- new MapShapeDecorator(Hud)
- {
- Brush = Hud.Render.CreateBrush(128, 217, 217, 217, 0), // Light grey dot
- ShadowBrush = ShadowBrush,
- ShapePainter = new CircleShapePainter(Hud),
- Radius = 2.5f,
- }
- );
- }
- public void PaintWorld(WorldLayer layer)
- {
- if (Hud.Game.IsInTown) return;
- if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map)) return;
- bool inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;
- int eliteCount = 0;
- foreach (var monster in Hud.Game.AliveMonsters)
- {
- if (monster.IsElite)
- {
- eliteCount += 1;
- EliteDecorator.Paint(layer, monster, monster.FloorCoordinate, monster.SnoMonster.NameLocalized);
- if (monster.SnoMonster.Priority == MonsterPriority.boss && BossDecorator != null)
- {
- BossDecorator.Paint(layer, monster, monster.FloorCoordinate, null);
- }
- }
- else if (inRift)
- {
- if (monster.NormalizedXyDistanceToMe < RiftProgressionRange && monster.SnoMonster.RiftProgression > 0)
- {
- if (monster.SnoMonster.RiftProgression < TrashBreakpoint)
- {
- GreyDecorator.Paint(layer, monster, monster.FloorCoordinate, null); // Trash.
- }
- else if (monster.SnoMonster.RiftProgression < KillBreakpoint)
- {
- GreenDecorator.Paint(layer, monster, monster.FloorCoordinate, null); // Some value.
- }
- else
- {
- BlueDecorator.Paint(layer, monster, monster.FloorCoordinate, null); // Rest is best.
- }
- }
- }
- else
- {
- GreyDecorator.Paint(layer, monster, monster.FloorCoordinate, null); // What ever.
- }
- }
- if (eliteCount > 0 && PlayerDecorator != null)
- {
- PlayerDecorator.Paint(layer, Hud.Game.Me, Hud.Game.Me.FloorCoordinate, null);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement