//private static bool draw; private static void OnDraw(EventArgs args) { foreach (var unit in HeroManager.AllHeroes.Where(o => !o.IsMe && o.IsHPBarRendered).Where(o => o.IsAlly ? DrawAllies : DrawEnemies)) { var HPBarPos = new Vector2(unit.HPBarPosition.X, unit.HPBarPosition.Y); // Summoner spells foreach (var summonerSpell in Summoners) { var spell = unit.Spellbook.GetSpell(summonerSpell); var cooldown = spell.CooldownExpires - Game.Time; var percent = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f; var spellPos = unit.GetSummonerOffset(spell.Slot); if (SummonerSpells.ContainsKey(spell.Name) || spell.Name.Contains("smite")) { var sprite = spell.Name.Contains("smite") ? SummonerSpells["summonersmite"] : SummonerSpells[spell.Name]; sprite.Color = GetDrawColor(percent); sprite.Draw(new Vector2(spellPos.X, spellPos.Y)); } if (DrawText && cooldown > 0) { Text.TextValue = Math.Floor(cooldown).ToString(); Text.Position = new Vector2((int)spellPos.X - 30 + Text.TextValue.Length, (int)spellPos.Y - 1); Text.Draw(); } } // Spell cooldowns foreach (var slot in SpellSlots) { var spell = unit.Spellbook.GetSpell(slot); var cooldown = spell.CooldownExpires - Game.Time; var percent = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f; var spellPos = unit.GetSpellOffset(slot); Drawing.DrawLine(new Vector2(spellPos.X, spellPos.Y + 2), new Vector2(spellPos.X + (int)(percent * 22), spellPos.Y + 2), Mode == 1 ? 5 : 11, spell.IsLearned ? GetDrawColor(percent) : System.Drawing.Color.SlateGray); if (DrawText && spell.IsLearned && cooldown > 0) { Text.TextValue = Math.Floor(cooldown).ToString(); Text.Position = new Vector2((int)spellPos.X + 10 - Text.TextValue.Length * 2, (int)spellPos.Y + 28); Text.Draw(); } } //Cooldowns if (Exp) { Drawing.DrawLine(new Vector2(HPBarPos.X - OffsetXpX, HPBarPos.Y - OffsetXpY), new Vector2(HPBarPos.X - OffsetXpX + 104 * (unit.Experience.XPPercentage / 100), HPBarPos.Y - OffsetXpY), 3, System.Drawing.Color.DarkOrange); } // Draw the main hud MainBar.Draw(new Vector2((HPBarPos.X + OffsetHudX), (HPBarPos.Y + OffsetHudY + Mode * 2 - (Exp ? 0 : 1)))); } }
public static void OnDrawEnd(EventArgs args) { if (Settings.TurnOff) { return; } foreach (var unit in EntityManager.Heroes.AllHeroes.Where(o => o.IsHPBarRendered && !o.IsMe).Where(o => o.IsAlly ? Settings.DrawAllies : Settings.DrawEnemies)) { var hpBarPos = new Vector2(unit.HPBarPosition.X, unit.HPBarPosition.Y + -1); // Summoner spells foreach (var summonerSpell in Summoners) { var spell = unit.Spellbook.GetSpell(summonerSpell); var cooldown = spell.CooldownExpires - Game.Time; var spellPos = GetSummonerOffset(unit, spell.Slot); if (SummonerSpells.ContainsKey(spell.Name.ToLower())) { var sprite = SummonerSpells[spell.Name.ToLower()]; sprite.Color = cooldown < 0 ? Color.White : Color.FromArgb(255, Color.DimGray); sprite.Draw(new Vector2(spellPos.X + 1, spellPos.Y + 3)); } if (!(cooldown > 0)) { continue; } Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture); Text.Position = new Vector2((int)spellPos.X - 30 + Text.TextValue.Length, (int)spellPos.Y + 4); Text.Draw(); } // Spells foreach (var slot in SpellSlots) { var spell = unit.Spellbook.GetSpell(slot); var cooldown = spell.CooldownExpires - Game.Time; var percent = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f; var spellPos = GetSpellOffset(unit, slot); Drawing.DrawLine(new Vector2(spellPos.X, spellPos.Y + 2), new Vector2(spellPos.X + (int)(percent * 22), spellPos.Y + 2), 5, spell.IsLearned ? GetDrawColor(percent) : Color.SlateGray); if (!spell.IsLearned || !(cooldown > 0)) { continue; } Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture); Text.Position = new Vector2((int)spellPos.X + 10 - Text.TextValue.Length * 2, (int)spellPos.Y + 28); Text.Draw(); } // Draw the main hud MainBar.Draw(new Vector2(hpBarPos.X + OffsetHudX, hpBarPos.Y + OffsetHudY - 1)); } }
//private static bool draw; private static void OnDraw(EventArgs args) { foreach (var unit in EntityManager.Heroes.AllHeroes.Where(o => o.IsHPBarRendered && !o.IsMe).Where(o => o.IsAlly ? DrawAllies : DrawEnemies)) { var hpBarPos = new Vector2(unit.HPBarPosition.X, unit.HPBarPosition.Y + (Mode == 1 ? -1 : 0)); // Summoner spells foreach (var summonerSpell in Summoners) { var spell = unit.Spellbook.GetSpell(summonerSpell); var cooldown = spell.CooldownExpires - Game.Time; var spellPos = unit.GetSummonerOffset(spell.Slot); if (SummonerSpells.ContainsKey(spell.Name.ToLower())) { var sprite = SummonerSpells[spell.Name.ToLower()]; sprite.Color = cooldown < 0 ? Color.White : Color.FromArgb(255, Color.Red); sprite.Draw(new Vector2(spellPos.X, spellPos.Y)); } if (DrawText && cooldown > 0) { Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture); Text.Position = new Vector2((int)spellPos.X - 30 + Text.TextValue.Length, (int)spellPos.Y - 1); Text.Draw(); } } // Spell cooldowns foreach (var slot in SpellSlots) { var spell = unit.Spellbook.GetSpell(slot); var cooldown = spell.CooldownExpires - Game.Time; var percent = (cooldown > 0 && Math.Abs(spell.Cooldown) > float.Epsilon) ? 1f - (cooldown / spell.Cooldown) : 1f; var spellPos = unit.GetSpellOffset(slot); Drawing.DrawLine(new Vector2(spellPos.X, spellPos.Y + 2), new Vector2(spellPos.X + (int)(percent * 22), spellPos.Y + 2), Mode == 1 ? 5 : 11, spell.IsLearned ? GetDrawColor(percent) : Color.SlateGray); if (DrawText && spell.IsLearned && cooldown > 0) { Text.TextValue = Math.Floor(cooldown).ToString(CultureInfo.InvariantCulture); Text.Position = new Vector2((int)spellPos.X + 10 - Text.TextValue.Length * 2, (int)spellPos.Y + 28); Text.Draw(); } } //Cooldowns if (Exp) { Drawing.DrawLine(new Vector2(hpBarPos.X - OffsetXpX, hpBarPos.Y - OffsetXpY), new Vector2(hpBarPos.X - OffsetXpX + 104, hpBarPos.Y - OffsetXpY), 3, Color.DarkGray); Drawing.DrawLine(new Vector2(hpBarPos.X - OffsetXpX, hpBarPos.Y - OffsetXpY), new Vector2(hpBarPos.X - OffsetXpX + 104 * (unit.Experience.XPPercentage / 100), hpBarPos.Y - OffsetXpY), 3, Color.DarkOrange); } // Draw the main hud MainBar.Draw(new Vector2((hpBarPos.X + OffsetHudX), (hpBarPos.Y + OffsetHudY - (Exp ? 0 : 1)))); } }