Advertisement
zjqyf

AttackSpeed.cs

Jun 25th, 2017
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. using System.Globalization;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.glq
  5. {
  6. public class AttackSpeed : BasePlugin, IInGameTopPainter
  7. {
  8.  
  9. public TopLabelWithTitleDecorator AttackSpeedDecorator { get; set; }
  10. public AttackSpeed()
  11. {
  12. Enabled = true;
  13. }
  14.  
  15. public override void Load(IController hud)
  16. {
  17. base.Load(hud);
  18.  
  19. AttackSpeedDecorator = new TopLabelWithTitleDecorator(Hud)
  20. {
  21. BackgroundBrush = Hud.Render.CreateBrush(160, 255, 255, 255, 0),
  22. BorderBrush = Hud.Render.CreateBrush(255, 0, 0, 0, -1),
  23. TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 0, 0, 0, true, false, false),
  24. };
  25. }
  26.  
  27. public void PaintTopInGame(ClipState clipState)
  28. {
  29. if (Hud.Render.UiHidden) return;
  30.  
  31. if (clipState == ClipState.BeforeClip)
  32. {
  33.  
  34. var w = Hud.Window.Size.Width * 0.04f;
  35. var h = Hud.Window.Size.Height * 0.02f;
  36.  
  37. var x = Hud.Window.Size.Width * 0.5f - w/2;
  38. var y = Hud.Window.Size.Height * 0.5f + Hud.Window.Size.Height * 0.01f;
  39.  
  40. AttackSpeedDecorator.Paint(x , y, w, h, Hud.Game.Me.Offense.AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
  41.  
  42. }
  43. }
  44.  
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement