Advertisement
jarppaaja

PluginEnablerOrDisablerPlugin

Mar 20th, 2019
3,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 14.70 KB | None | 0 0
  1. // PluginEnablerOrDisablerPlugin.cs "$Revision: 2410 $" "$Date: 2019-07-23 09:33:39 +0300 (ti, 23 heinä 2019) $"
  2. // https://www.ownedcore.com/forums/diablo-3/turbohud/turbohud-community-plugins/782208-v9-minimal-plugin-theme.html
  3. // https://pastebin.com/nggKPP1w
  4. using System.Collections.Generic;
  5. using SharpDX;
  6. using Turbo.Plugins.Default;
  7.  
  8. namespace Turbo.Plugins.User
  9. {
  10.     public class PluginEnablerOrDisablerPlugin : BasePlugin, ICustomizer
  11.     {
  12.         private const bool YES = true;
  13.         private const bool NOO = false;
  14.  
  15.         public PluginEnablerOrDisablerPlugin() { Enabled = true; Order = 10; }  // Notice plugin order, place your own plugin customizations using higder order number!
  16.  
  17.         public void Customize()
  18.         {
  19.             SetupPlugins();                                             // Choose which default plugins to use.
  20.             CustomizeDefault();                                         // Customize default plugins.
  21.             CustomizeSpecial();                                         // Customize any third party plugins you have.
  22.         }
  23.  
  24.         private void SetupPlugins()
  25.         {
  26.             Hud.TogglePlugin<BountyTablePlugin>(YES);                   // F6 for bountry summary table
  27.             Hud.TogglePlugin<DamageBonusPlugin>(NOO);
  28.             Hud.TogglePlugin<DebugPlugin>(NOO);
  29.             Hud.TogglePlugin<ExperienceOverBarPlugin>(NOO);             // Skillbar experience gained and pool bonus
  30.             Hud.TogglePlugin<GameInfoPlugin>(NOO);
  31.             Hud.TogglePlugin<NetworkLatencyPlugin>(NOO);
  32.             Hud.TogglePlugin<NotifyAtRiftPercentagePlugin>(NOO);        // On screen label "Rift Completion" when rift progress is greater than 90%.
  33.             Hud.TogglePlugin<ParagonCapturePlugin>(NOO);                // Captures screenshots to "capture_paragon" folder when you got new paragon level.
  34.             Hud.TogglePlugin<PortraitBottomStatsPlugin>(NOO);           // Player portrait label "DPS dealt to monsters" in single player mode.
  35.             Hud.TogglePlugin<ResourceOverGlobePlugin>(YES);             // Skillbar health and player class specifc resource numbers
  36.             Hud.TogglePlugin<RiftPlugin>(NOO);                          // Rift progressbar more and better data.
  37.             Hud.TogglePlugin<WaypointQuestsPlugin>(YES);                // Act Map normal/special bounty names and completion status
  38.             // Actors
  39.             Hud.TogglePlugin<ChestPlugin>(YES);                         // Minimap chest marker
  40.             Hud.TogglePlugin<ClickableChestGizmoPlugin>(NOO);           //
  41.             Hud.TogglePlugin<CursedEventPlugin>(YES);                   // Minimap cursed event chest marfker
  42.             Hud.TogglePlugin<DeadBodyPlugin>(NOO);                      //
  43.             Hud.TogglePlugin<GlobePlugin>(YES);                         // Minimap rift progression orbs and power globes
  44.             Hud.TogglePlugin<OculusPlugin>(NOO);                        //
  45.             Hud.TogglePlugin<PortalPlugin>(YES);                        // Minimap portals to other levels
  46.             Hud.TogglePlugin<RackPlugin>(NOO);                          //
  47.             Hud.TogglePlugin<ShrinePlugin>(YES);                        // Minimap shrine and well markers
  48.             // BuffLists
  49.             Hud.TogglePlugin<CheatDeathBuffFeederPlugin>(NOO);          // Minimap shows red transpared overlay when your passive "cheat death" skill
  50.             Hud.TogglePlugin<ConventionOfElementsBuffListPlugin>(NOO);  // Player portrait shows Convention Of Element cycle/state for all players
  51.             Hud.TogglePlugin<MiniMapLeftBuffListPlugin>(NOO);           // Minimap left side shows rift pylon effects (vertically)
  52.             Hud.TogglePlugin<MiniMapRightBuffListPlugin>(NOO);          // Minimap right side passive "cheat death" skill
  53.             Hud.TogglePlugin<PlayerBottomBuffListPlugin>(NOO);          // Player bottom: Taeguk, Focus and Restraint
  54.             Hud.TogglePlugin<PlayerLeftBuffListPlugin>(NOO);            // Player left side: customizable by you
  55.             Hud.TogglePlugin<PlayerRightBuffListPlugin>(NOO);           // Player right side: customizable by you
  56.             Hud.TogglePlugin<PlayerTopBuffListPlugin>(NOO);             // Player top: customizable by you
  57.             Hud.TogglePlugin<TopLeftBuffListPlugin>(NOO);               // Screen top left: customizable by you
  58.             Hud.TogglePlugin<TopRightBuffListPlugin>(NOO);              // Screen top right: customizable by you
  59.             // CooldownSoundPlayer
  60.             Hud.TogglePlugin<CooldownSoundPlayerPlugin>(YES);           // Plays a sound when player skill cooldown expires.
  61.             // Decorators
  62.             Hud.TogglePlugin<GroundLabelDecoratorPainterPlugin>(true);  // Required for all other plugin decorators to work!
  63.             // Inventory
  64.             Hud.TogglePlugin<BloodShardPlugin>(YES);                    // Skillbar blood shard label
  65.             Hud.TogglePlugin<InventoryAndStashPlugin>(YES);             // Draw "A" or "P" marker on items, item greying and cubing is customized here
  66.             Hud.TogglePlugin<InventoryFreeSpacePlugin>(NOO);            //
  67.             Hud.TogglePlugin<InventoryKanaiCubedItemsPlugin>(YES);      // Inventory header cubed item icon and mouse hover description
  68.             Hud.TogglePlugin<InventoryMaterialCountPlugin>(YES);        // Inventory bottom material counts
  69.             Hud.TogglePlugin<StashPreviewPlugin>(NOO);                  //
  70.             Hud.TogglePlugin<StashUsedSpacePlugin>(NOO);                //
  71.             // Items
  72.             Hud.TogglePlugin<CosmeticItemsPlugin>(YES);                 // Minimap cosmetic item markers
  73.             Hud.TogglePlugin<HoveredItemInfoPlugin>(NOO);               //
  74.             Hud.TogglePlugin<ItemsPlugin>(YES);                         // Minimap markers for ancient and primal items
  75.             Hud.TogglePlugin<PickupRangePlugin>(NOO);                   // Show pickup range under player feet
  76.             // LabelLists
  77.             Hud.TogglePlugin<AttributeLabelListPlugin>(NOO);            // Skillbar miscellaneous info about skills and player attributes.
  78.             Hud.TogglePlugin<TopExperienceStatistics>(NOO);             // Paragon point statistics middle top of the screen (mouse hover to see more)
  79.             // Minimap
  80.             Hud.TogglePlugin<MarkerPlugin>(YES);                        // Minimap POI markers like bounty or keywarden names
  81.             Hud.TogglePlugin<SceneHintPlugin>(NOO);                     // ???
  82.             // Monsters
  83.             Hud.TogglePlugin<DangerousMonsterPlugin>(NOO);              // Minimap Draws small circle red and name over named dangerous monsters. See CustomizeDefault().
  84.             Hud.TogglePlugin<EliteMonsterAffixPlugin>(NOO);             //
  85.             Hud.TogglePlugin<EliteMonsterSkillPlugin>(NOO);             //
  86.             Hud.TogglePlugin<ExplosiveMonsterPlugin>(NOO);              //
  87.             Hud.TogglePlugin<GoblinPlugin>(NOO);                        // Minimap goblin markers
  88.             Hud.TogglePlugin<MonsterPackPlugin>(NOO);                   //
  89.             Hud.TogglePlugin<MonsterRiftProgressionColoringPlugin>(YES);// Minimap rift progression monster colors
  90.             Hud.TogglePlugin<StandardMonsterPlugin>(YES);               // Minimap monster colors
  91.             Hud.TogglePlugin<TopMonsterHealthBarPlugin>(YES);           // Current monster health bar: show monster health in numbers and in percentage and status ailmenst above it.
  92.             // Players
  93.             Hud.TogglePlugin<BannerPlugin>(NOO);                        //
  94.             Hud.TogglePlugin<HeadStonePlugin>(YES);                     // TODO: Testing to see what they look like!
  95.             Hud.TogglePlugin<MultiplayerExperienceRangePlugin>(NOO);    //
  96.             Hud.TogglePlugin<OtherPlayersPlugin>(NOO);                  //
  97.             Hud.TogglePlugin<PlayerSkillPlugin>(YES);                   // Minimap player castable "minion" markers (hydra, sentry, black hole etc.)
  98.             Hud.TogglePlugin<SkillRangeHelperPlugin>(NOO);              //
  99.             // SkillBars
  100.             Hud.TogglePlugin<OriginalHealthPotionSkillPlugin>(YES);     // Skillbar health potion cooldown timer
  101.             Hud.TogglePlugin<OriginalSkillBarPlugin>(YES);              // Skillbar player skill cooldowns etc.
  102.             Hud.TogglePlugin<UiHiddenPlayerSkillBarPlugin>(NOO);        //
  103.         }
  104.  
  105.         private void CustomizeSpecial()
  106.         {
  107.             // Add your own plugin customization code here so it is easy to keep separated from plugin's original code.
  108.         }
  109.  
  110.         private void CustomizeDefault()
  111.         {
  112.             // Bottom skillbar panel customization.
  113.  
  114.             // Hide DPS labels that are over normal skill "key" labels.
  115.             Hud.RunOnPlugin<OriginalSkillBarPlugin>(plugin =>
  116.             {
  117.                 plugin.SkillPainter.EnableSkillDpsBar = false;
  118.                 plugin.SkillPainter.EnableDetailedDpsHint = false;
  119.             });
  120.  
  121.             // Inventory and Stash customization.
  122.  
  123.             // Disable item graying and cube animation.
  124.             Hud.RunOnPlugin<InventoryAndStashPlugin>(plugin =>
  125.             {
  126.                 plugin.LooksGoodDisplayEnabled = false;
  127.                 plugin.NotGoodDisplayEnabled = false;
  128.                 plugin.DefinitelyBadDisplayEnabled = false;
  129.                 plugin.CanCubedEnabled = false;
  130.             });
  131.  
  132.             // Minimap customization.
  133.  
  134.             Hud.RunOnPlugin<DangerousMonsterPlugin>(plugin =>   // If you enabled this, here are my customizations!
  135.             {
  136.                 plugin.Order = 501;                             // Draw after MyMonsterColoring.
  137.                 plugin.AddNames("Enslaved Nightmare");          // "Terror Demon" is included already.
  138.                 foreach (var decorator in plugin.Decorator.GetDecorators<MapShapeDecorator>())
  139.                 {
  140.                     decorator.Radius = 3;                       // Increase radius for better visibility.
  141.                 }
  142.             });
  143.             // Show only Normal and Resplendent chests - hide others.
  144.             Hud.RunOnPlugin<ChestPlugin>(plugin =>
  145.             {
  146.                 plugin.LoreChestDecorator.Decorators.Clear();
  147.             });
  148.  
  149.             // Worldmap and Minimap customization.
  150.  
  151.             // Make Pickup Range indicator more "prominent" but disable it. Some builds might find this useful, though.
  152.             Hud.RunOnPlugin<PickupRangePlugin>(plugin =>
  153.             {
  154.                 plugin.Enabled = false;
  155.                 plugin.FillBrush = Hud.Render.CreateBrush(6, 255, 255, 255, 0);
  156.                 plugin.OutlineBrush = Hud.Render.CreateBrush(24, 0, 0, 0, 3);
  157.  
  158.             });
  159.             // Show only ancient and primal data, hide item labels.
  160.             Hud.RunOnPlugin<ItemsPlugin>(plugin =>
  161.             {
  162.                 plugin.EnableSpeakPrimal = true;
  163.                 plugin.EnableSpeakPrimalSet = true;
  164.  
  165.                 plugin.LegendaryDecorator.Enabled = false;
  166.                 plugin.SetDecorator.Enabled = false;
  167.                 plugin.InArmorySetDecorator.Enabled = false;
  168.  
  169.                 plugin.AncientDecorator.ToggleDecorators<GroundLabelDecorator>(false);
  170.                 plugin.AncientDecorator.Decorators.Add(new MapLabelDecorator(Hud)
  171.                 {
  172.                     LabelFont = Hud.Render.CreateFont("tahoma", 6, 255, 235, 120, 0, true, false, false),
  173.                     RadiusOffset = 14,
  174.                     Up = true,
  175.                 });
  176.                 plugin.AncientSetDecorator.ToggleDecorators<GroundLabelDecorator>(false);
  177.                 plugin.AncientSetDecorator.Decorators.Add(new MapLabelDecorator(Hud)
  178.                 {
  179.                     LabelFont = Hud.Render.CreateFont("tahoma", 6, 255, 0, 170, 0, true, false, false),
  180.                     RadiusOffset = 14,
  181.                     Up = true,
  182.                 });
  183.                 plugin.PrimalDecorator.ToggleDecorators<GroundLabelDecorator>(false);
  184.                 plugin.PrimalDecorator.Decorators.Add(new MapLabelDecorator(Hud)
  185.                 {
  186.                     LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 240, 20, 0, true, false, false),
  187.                     RadiusOffset = 14,
  188.                     Up = true,
  189.                 });
  190.                 plugin.PrimalSetDecorator.ToggleDecorators<GroundLabelDecorator>(false);
  191.                 plugin.PrimalSetDecorator.Decorators.Add(new MapLabelDecorator(Hud)
  192.                 {
  193.                     LabelFont = Hud.Render.CreateFont("tahoma", 7, 255, 240, 20, 0, true, false, false),
  194.                     RadiusOffset = 14,
  195.                     Up = true,
  196.                 });
  197.                 // Add ground circle for Death Breaths.
  198.                 plugin.DeathsBreathDecorator.Add(new GroundCircleDecorator(Hud)
  199.                 {
  200.                     Brush = Hud.Render.CreateBrush(192, 102, 202, 177, -2),
  201.                     Radius = 1.25f,
  202.                 });
  203.             });
  204.  
  205.             // Selected monster healthbar font size.
  206.             Hud.RunOnPlugin<Default.TopMonsterHealthBarPlugin>(plugin =>
  207.             {
  208.                 var textColor = Color.White;
  209.                 plugin.MonsterHitpointsFont = Hud.Render.CreateFont("tahoma", 8, textColor.A, textColor.R, textColor.G, textColor.B, true, false, false);   // No shadow!
  210.             });
  211.  
  212.             // Change Sentry minimap markers from orange triangle to Aquamarine plus-sign with circle oever it.
  213.             Hud.RunOnPlugin<PlayerSkillPlugin>(plugin =>
  214.             {
  215.                 var decorators = new List<IWorldDecorator>();
  216.                 decorators.AddRange(plugin.SentryDecorator.Decorators);
  217.                 decorators.AddRange(plugin.SentryWithCustomEngineeringDecorator.Decorators);
  218.                 var lineColor = Color.Aquamarine;
  219.                 var whiteBrush = Hud.Render.CreateBrush(255, lineColor.R, lineColor.G, lineColor.B, -1f);
  220.                 foreach (var decorator in decorators)
  221.                 {
  222.                     if (decorator is MapShapeDecorator)
  223.                     {
  224.                         ((MapShapeDecorator)decorator).Brush = whiteBrush;
  225.                         ((MapShapeDecorator)decorator).ShapePainter = new PlusShapePainter(Hud);
  226.                         ((MapShapeDecorator)decorator).Radius = 7f;
  227.                     }
  228.                 }
  229.                 var circleDecorator = new MapShapeDecorator(Hud)
  230.                 {
  231.                     Brush = whiteBrush,
  232.                     ShapePainter = new CircleShapePainter(Hud),
  233.                     Radius = 5f,
  234.                 };
  235.                 plugin.SentryDecorator.Decorators.Add(circleDecorator);
  236.                 plugin.SentryWithCustomEngineeringDecorator.Decorators.Add(circleDecorator);
  237.             });
  238.         }
  239.     }
  240. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement