Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Globalization;
- using Turbo.Plugins.Default;
- using System.Linq;
- using SharpDX.DirectInput;
- using System;
- using System.Text;
- using System.Collections.Generic;
- namespace Turbo.Plugins.Frank
- {
- using System.Text;
- public class SeasonBar : BasePlugin, IInGameTopPainter
- {
- private readonly int[] _skillOrder = { 2, 3, 4, 5, 0, 1 };
- private StringBuilder textBuilder;
- private StringBuilder buffBuilder;
- private IFont GreenFont;
- private IFont RedFont;
- public double ArchonTimeLeft;
- public double Cooldown;
- public bool WizIngame;
- public double ArchonLeft;
- public IBrush BackgroundBrush { get; set; }
- public IBrush KillCountBrush { get; set; }
- public IBrush KillCountWarningBrush { get; set; }
- public IBrush TimerOutsideBrush { get; set; }
- public IBrush BorderBrush { get; set; }
- public IBrush BuffBrush { get; set; }
- public const float BorderSize = 1.2f;
- public SeasonBar()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- GreenFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, false);
- RedFont = Hud.Render.CreateFont("tahoma", 8, 255, 58, 227, 239, true, false, false);
- textBuilder = new StringBuilder();
- buffBuilder = new StringBuilder();
- BackgroundBrush = Hud.Render.CreateBrush(240, 0, 0, 0, 0);
- KillCountBrush = Hud.Render.CreateBrush(240, 12, 175, 17, 0);
- KillCountWarningBrush = Hud.Render.CreateBrush(240, 246, 57, 57, 0);
- TimerOutsideBrush = Hud.Render.CreateBrush(240, 100, 100, 100, 0);
- BorderBrush = Hud.Render.CreateBrush(240, 244, 169, 80, 0);
- BuffBrush = Hud.Render.CreateBrush(240, 212, 245, 244, 0);
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (Hud.Render.UiHidden) return;
- if (Hud.Game.SpecialArea != SpecialArea.GreaterRift) return;
- float x = Hud.Window.Size.Width - (Hud.Window.Size.Width * 0.173f);
- float y = Hud.Window.Size.Height * 0.48f;
- float sizex = Hud.Window.Size.Width * 0.16f;
- float sizey = Hud.Window.Size.Height * 0.02f;
- float textx = Hud.Window.Size.Width - (Hud.Window.Size.Width * 0.10f);
- float texty = Hud.Window.Size.Height * 0.481f;
- textBuilder.Clear();
- buffBuilder.Clear();
- float nextBuffX = 0;
- int killCount = 0;
- var percent = Hud.Game.RiftPercentage;
- if (Hud.Game.Me.Powers.BuffIsActive(483967)) // Jugando en temporada
- {
- killCount = Hud.Game.Me.Powers.GetBuff(483967).IconCounts[1];
- }
- float angelsProgress = (float)(killCount / 500.0);
- if(angelsProgress > 1) {
- angelsProgress = 1;
- }
- //var ATleft = (ArchonLeft - Hud.Game.CurrentGameTick) / 60.0d;
- textBuilder.AppendFormat("{0:0}", killCount);
- BackgroundBrush.DrawRectangle(x, y, sizex, sizey);
- if(killCount > 400){
- buffBuilder.Append("Angels");
- nextBuffX = sizex;
- } else if(killCount > 300) {
- nextBuffX = sizex * (float)( 400.0 / 500.0);
- buffBuilder.Append("Meteors");
- } else if(killCount > 200) {
- nextBuffX = sizex * (float)( 350.0 / 500.0);
- buffBuilder.Append("Fire Ring");
- } else if(killCount > 150) {
- nextBuffX = sizex * (float)( 200.0 / 500.0);
- buffBuilder.Append("Chests");
- } else if(killCount > 100) {
- nextBuffX = sizex * (float)( 150.0 / 500.0);
- buffBuilder.Append("Geysers");
- } else if(killCount < 100) {
- nextBuffX = sizex * (float)( 100.0 / 500.0);
- buffBuilder.Append("Tornados");
- }
- BuffBrush.DrawRectangle(x, y, nextBuffX, sizey);
- if (killCount > 0)
- {
- if((angelsProgress * 100) < percent) {
- KillCountBrush.DrawRectangle(x, y, sizex * angelsProgress, sizey);
- } else {
- KillCountWarningBrush.DrawRectangle(x, y, sizex * angelsProgress, sizey);
- }
- }
- BorderBrush.DrawLine(x, y, x + sizex, y, 0.6f);
- BorderBrush.DrawLine(x + sizex, y, x + sizex, y + sizey, BorderSize);
- BorderBrush.DrawLine(x, y + sizey, x + sizex, y + sizey, BorderSize);
- BorderBrush.DrawLine(x, y, x, y + sizey, 0.6f);
- var layout = GreenFont.GetTextLayout(textBuilder.ToString());
- var nextBuff = RedFont.GetTextLayout(buffBuilder.ToString());
- GreenFont.DrawText(layout, textx, texty);
- RedFont.DrawText(nextBuff, textx, texty + sizey);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement