Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Globalization;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.glq
- {
- public class AttackSpeed2 : BasePlugin, IInGameTopPainter
- {
- public TopLabelWithTitleDecorator AttackSpeedDecorator { get; set; }
- public IBrush CHANNELBackgroundBrush { get; set; }
- public IBrush DELAYBackgroundBrush { get; set; }
- public AttackSpeed2()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- CHANNELBackgroundBrush = Hud.Render.CreateBrush(160, 255, 255, 255, 0);
- DELAYBackgroundBrush = Hud.Render.CreateBrush(160, 255, 0, 0, 0);
- AttackSpeedDecorator = new TopLabelWithTitleDecorator(Hud)
- {
- BackgroundBrush = CHANNELBackgroundBrush,
- BorderBrush = Hud.Render.CreateBrush(255, 0, 0, 0, -1),
- TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 0, 0, 0, true, false, false),
- };
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (Hud.Render.UiHidden) return;
- if (clipState == ClipState.BeforeClip)
- {
- var w = Hud.Window.Size.Width * 0.08f;
- var h = Hud.Window.Size.Height * 0.02f;
- var x = Hud.Window.Size.Width * 0.5f - w/2;
- var y = Hud.Window.Size.Height * 0.5f + Hud.Window.Size.Height * 0.01f;
- var AttackSpeed = Hud.Game.Me.Offense.AttackSpeed;
- if(AttackSpeed < 2.380)
- {
- AttackSpeedDecorator.BackgroundBrush = CHANNELBackgroundBrush;
- AttackSpeedDecorator.Paint(x, y, w, h, "CHANNEL " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
- }
- if (AttackSpeed > 2.380 && AttackSpeed <= 3.400)
- {
- AttackSpeedDecorator.BackgroundBrush = DELAYBackgroundBrush;
- AttackSpeedDecorator.Paint(x, y, w, h, "DELAY " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
- }
- if (AttackSpeed > 3.401 && AttackSpeed <= 4.328)
- {
- AttackSpeedDecorator.BackgroundBrush = CHANNELBackgroundBrush;
- AttackSpeedDecorator.Paint(x, y, w, h, "CHANNEL " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
- }
- if (AttackSpeed > 3.428)
- {
- AttackSpeedDecorator.BackgroundBrush = DELAYBackgroundBrush;
- AttackSpeedDecorator.Paint(x, y, w, h, "DELAY " + AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement