private static void DrawTimerLine(Spell spell) { try { Vector2 centerpos = Drawing.WorldToScreen(spell.GameObject ? spell.Object.Position : spell.SkillShot ? spell.CastPosition : spell.Target.Position) + new Vector2(0, 25); float remain = spell.GetRemainTime(); float full = spell.GetFullTime(); bool dynamic = full >= 3000 ? true : false; float length = dynamic ? remain / full * 70f : remain / full * 55f; if (spell.GetFullTime() >= 3500 && full - remain <= 500) { float length2 = (full - remain) / 500f * length; length = length2; } string text = spell.GetRemainTimeString(); Vector2 textpos = centerpos + new Vector2(-15, -13); SharpDX.Color color = spell.GetColor(); SpellFont.DrawText(null, text, (int)textpos.X, (int)textpos.Y, color); Color barColor = spell.Team == Team.Ally ? Color.LawnGreen : spell.Team == Team.Enemy ? Color.Red : Color.Orange; Vector2 linepos = centerpos + new Vector2(0, 15); Vector2 linestart = linepos - new Vector2(length, 0); Vector2 lineend = linepos + new Vector2(length, 0); Drawing.DrawLine(linestart - new Vector2(1, 0), lineend + new Vector2(1, 0), 6, Color.Black); Drawing.DrawLine(linestart, lineend, 4, barColor); } catch (Exception e) { e.ErrorMessage("DRAW_TIMER_LINE", spell.Caster.BaseSkinName + " " + spell.Name); } }
private static void DrawLine(Spell spell) { try { Obj_AI_Base hero = spell.Caster; if (!hero.VisibleOnScreen || !hero.IsHPBarRendered || !hero.IsHero()) return; float length = spell.GetRemainTime() / spell.GetFullTime() * 100f; Vector2 mainpos = hero.HPBarPosition; Vector2 startpos = hero.IsMe ? mainpos + new Vector2(26, 25) : mainpos + new Vector2(1, 30); Vector2 endpos = startpos + new Vector2(length, 0); Vector2 endpos2 = endpos + new Vector2(0, 6); Vector2 textpos = endpos2 + new Vector2(10, 3); Vector2 spritepos = textpos + new Vector2(-18, 0); Color lineColor = spell.GetColor().ConvertColor(); SharpDX.Color textColor = spell.GetColor(); Drawing.DrawLine(startpos, endpos, 1f, lineColor); Drawing.DrawLine(endpos, endpos2, 1f, lineColor); LineFont.DrawText(null, spell.GetRemainTimeString(), (int)textpos.X, (int)textpos.Y, textColor); TextureDraw.DrawSprite(spritepos, spell); } catch (Exception e) { e.ErrorMessage("DRAW_LINE" + spell.Caster.BaseSkinName + " " + spell.Name); } }