Advertisement
HaKache

KeyTrackerPlugin

Aug 29th, 2019
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 KB | None | 0 0
  1. // KeyTrackerPlugin
  2. // Shows a label on Rift Obelisk tracking your rift keys amount.
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using Turbo.Plugins.Default;
  8.  
  9. namespace Turbo.Plugins.Extended.Inventory
  10. {
  11.     public class KeyTrackerPlugin : BasePlugin, IInGameWorldPainter
  12.     {
  13.         public TopLabelDecorator ObeliskDecorator { get; set; }
  14.         private string obeliskText { get; set; }
  15.        
  16.         public KeyTrackerPlugin()
  17.         {
  18.             Enabled = true;
  19.         }
  20.              
  21.         public override void Load(IController hud)
  22.         {
  23.             base.Load(hud);
  24.  
  25.             ObeliskDecorator = new TopLabelDecorator(Hud)
  26.             {
  27.                 TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 210, 210, 210, true, false, 250, 50, 15, 40, true),
  28.                 TextFunc = () => obeliskText,
  29.             };
  30.  
  31.         }
  32.        
  33.         public void PaintWorld(WorldLayer layer)
  34.         {
  35.             if (!Hud.Game.IsInTown) return;
  36.  
  37.             var obeliskPos = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_openworld_lootrunobelisk_b && x.IsOnScreen);
  38.             var actualKeys = Hud.Game.Me.Materials.GreaterRiftKeystone;
  39.             obeliskText = actualKeys.ToString();
  40.  
  41.             var GRK = Hud.Inventory.GetSnoItem(2835237830);
  42.             var KeyTexture = Hud.Texture.GetItemTexture(GRK);
  43.  
  44.             var ScreenWidth = Hud.Window.Size.Width;
  45.             var ScreenHeight = Hud.Window.Size.Height;
  46.  
  47.             foreach (var actor in obeliskPos)
  48.             {
  49.             KeyTexture.Draw(actor.ScreenCoordinate.X - (ScreenWidth / 60f), actor.ScreenCoordinate.Y + (ScreenWidth / 22f), 50f, 50f, 1f);
  50.                     ObeliskDecorator.Paint(actor.ScreenCoordinate.X - (ScreenWidth / 24f), actor.ScreenCoordinate.Y + (ScreenWidth / 17.8f), (float)(ScreenWidth / 13), (float)(ScreenHeight / 28), HorizontalAlign.Center);
  51.             }
  52.  
  53.         }
  54.  
  55.  
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement