Advertisement
zjqyf

AttackSpeed2.cs

Jul 30th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. using System.Globalization;
  2. using Turbo.Plugins.Default;
  3.  
  4. namespace Turbo.Plugins.glq
  5. {
  6. public class AttackSpeed2 : BasePlugin, IInGameTopPainter
  7. {
  8.  
  9. public TopLabelWithTitleDecorator AttackSpeedDecorator { get; set; }
  10. public IBrush CHANNELBackgroundBrush { get; set; }
  11. public IBrush DELAYBackgroundBrush { get; set; }
  12. public AttackSpeed2()
  13. {
  14. Enabled = true;
  15. }
  16.  
  17. public override void Load(IController hud)
  18. {
  19. base.Load(hud);
  20. CHANNELBackgroundBrush = Hud.Render.CreateBrush(160, 255, 255, 255, 0);
  21. DELAYBackgroundBrush = Hud.Render.CreateBrush(160, 255, 0, 0, 0);
  22.  
  23. AttackSpeedDecorator = new TopLabelWithTitleDecorator(Hud)
  24. {
  25. BackgroundBrush = CHANNELBackgroundBrush,
  26. BorderBrush = Hud.Render.CreateBrush(255, 0, 0, 0, -1),
  27. TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 0, 0, 0, true, false, false),
  28. };
  29. }
  30.  
  31. public void PaintTopInGame(ClipState clipState)
  32. {
  33. if (Hud.Render.UiHidden) return;
  34.  
  35. if (clipState == ClipState.BeforeClip)
  36. {
  37.  
  38. var w = Hud.Window.Size.Width * 0.08f;
  39. var h = Hud.Window.Size.Height * 0.02f;
  40.  
  41. var x = Hud.Window.Size.Width * 0.5f - w/2;
  42. var y = Hud.Window.Size.Height * 0.5f + Hud.Window.Size.Height * 0.01f;
  43. var AttackSpeed = Hud.Game.Me.Offense.AttackSpeed;
  44. if(AttackSpeed < 2.380)
  45. {
  46. AttackSpeedDecorator.BackgroundBrush = CHANNELBackgroundBrush;
  47. AttackSpeedDecorator.Paint(x, y, w, h, "CHANNEL " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
  48. }
  49. if (AttackSpeed > 2.380 && AttackSpeed <= 3.400)
  50. {
  51. AttackSpeedDecorator.BackgroundBrush = DELAYBackgroundBrush;
  52. AttackSpeedDecorator.Paint(x, y, w, h, "DELAY " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
  53. }
  54. if (AttackSpeed > 3.401 && AttackSpeed <= 4.328)
  55. {
  56. AttackSpeedDecorator.BackgroundBrush = CHANNELBackgroundBrush;
  57. AttackSpeedDecorator.Paint(x, y, w, h, "CHANNEL " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
  58. }
  59. if (AttackSpeed > 3.428)
  60. {
  61. AttackSpeedDecorator.BackgroundBrush = DELAYBackgroundBrush;
  62. AttackSpeedDecorator.Paint(x, y, w, h, "DELAY " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
  63. }
  64.  
  65. }
  66. }
  67.  
  68. }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement