Advertisement
s4000

DAV_KeyShardPlugin

Oct 10th, 2019
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.32 KB | None | 0 0
  1. using System.Globalization;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.DAV
  5. {
  6.     public class DAV_KeyShardPlugin : BasePlugin, IInGameTopPainter, ICustomizer {
  7.         public float xPos { get; set; }
  8.         public float yPos { get; set; }
  9.         public IFont Font_Key { get; set; }
  10.         public IFont Font_Shard { get; set; }
  11.         public IFont Font_Space { get; set; }
  12.         public ITexture Icon_Key { get; set; }
  13.         public ITexture Icon_Shard { get; set; }
  14.         public ITexture Icon_Space { get; set; }
  15.  
  16.         public DAV_KeyShardPlugin() {
  17.             Enabled = true;
  18.         }
  19.  
  20.         public override void Load(IController hud) {
  21.             base.Load(hud);
  22.  
  23.             xPos = Hud.Window.Size.Width * 0.57f;
  24.             yPos = Hud.Window.Size.Height * 0.985f;
  25.             Font_Key = Hud.Render.CreateFont("arial", 8, 255, 102, 255, 102, true, false, true);
  26.             Font_Shard = Hud.Render.CreateFont("arial", 8, 255, 255, 102, 102, true, false, true);
  27.             Font_Space = Hud.Render.CreateFont("arial", 8, 255, 51, 255, 255, true, false, true);
  28.             Icon_Key = Hud.Texture.GetTexture(1221854026);
  29.             Icon_Shard = Hud.Texture.GetTexture(2742058);
  30.             Icon_Space = Hud.Texture.GetTexture(4077504870);
  31.         }
  32.  
  33.         public void PaintTopInGame(ClipState clipState) {
  34.             if (clipState != ClipState.BeforeClip) return;
  35.             if (Hud.Game.MapMode == MapMode.WaypointMap || Hud.Game.MapMode == MapMode.ActMap || Hud.Game.MapMode == MapMode.Map) return;
  36.  
  37.             var xref = xPos;
  38.             var layout = Font_Key.GetTextLayout(Hud.Game.Me.Materials.GreaterRiftKeystone.ToString());
  39.             var size = layout.Metrics.Height;
  40.             Icon_Key.Draw(xref, yPos, size, size);
  41.             xref += size * 1.1f;
  42.             Font_Key.DrawText(layout, xref, yPos);
  43.             xref += layout.Metrics.Width + 10f;
  44.  
  45.             layout = Font_Shard.GetTextLayout(Hud.Game.Me.Materials.BloodShard.ToString());
  46.             size = layout.Metrics.Height;
  47.             Icon_Shard.Draw(xref, yPos, size, size);
  48.             xref += size * 1.1f;
  49.             Font_Shard.DrawText(layout, xref, yPos);
  50.             xref += layout.Metrics.Width + 10f;
  51.            
  52.             layout = Font_Space.GetTextLayout((Hud.Game.Me.InventorySpaceTotal - Hud.Game.InventorySpaceUsed).ToString());
  53.             size = layout.Metrics.Height;
  54.             Icon_Space.Draw(xref, yPos, size, size);
  55.             xref += size * 1.1f;
  56.             Font_Space.DrawText(layout, xref, yPos);
  57.         }
  58.        
  59.         public void Customize() {
  60.             Hud.TogglePlugin<BloodShardPlugin>(false);
  61.             Hud.TogglePlugin<InventoryFreeSpacePlugin>(false);
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement