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 AttackSpeed : BasePlugin, IInGameTopPainter
- {
- public TopLabelWithTitleDecorator AttackSpeedDecorator { get; set; }
- public AttackSpeed()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- AttackSpeedDecorator = new TopLabelWithTitleDecorator(Hud)
- {
- BackgroundBrush = Hud.Render.CreateBrush(160, 255, 255, 255, 0),
- 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.04f;
- 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;
- AttackSpeedDecorator.Paint(x , y, w, h, Hud.Game.Me.Offense.AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/s");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement