public void OnDraw() { if (!menuManager.IsOpen || !menuManager.ShowAutoBuild) { return; } var build = abilityBuilder.GetBestBuild().ToList(); var uniqueAbilities = build.GroupBy(x => x) .Select(x => x.First()) .OrderBy(x => x.AbilitySlot) .Select(x => x.StoredName()) .ToList(); var ratio = HUDInfo.RatioPercentage(); var xStart = HUDInfo.ScreenSizeX() * 0.35f; var yStart = HUDInfo.ScreenSizeY() * 0.55f; var text = "Auto build preview (Win rate: " + abilityBuilder.BestBuildWinRate + ")"; Drawing.DrawRect( new Vector2(xStart - 2, yStart - (35 * ratio)), new Vector2(Drawing.MeasureText(text, "Arial", new Vector2(35 * ratio), FontFlags.None).X + 2, 35 * ratio), new Color(75, 75, 75, 175), false); Drawing.DrawRect( new Vector2(xStart - 2, yStart), new Vector2(((build.Count + 1) * 48 * ratio) + 2, uniqueAbilities.Count * 40 * ratio), new Color(75, 75, 75, 175), false); Drawing.DrawText( text, "Arial", new Vector2(xStart, yStart - (35 * ratio)), new Vector2(35 * ratio), Color.Orange, FontFlags.None); var positions = new Dictionary <string, float>(); for (var i = 0; i < uniqueAbilities.Count; i++) { var texture = uniqueAbilities[i].Contains("special_") ? Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_1") : Drawing.GetTexture("materials/ensage_ui/spellicons/" + uniqueAbilities[i]); Drawing.DrawRect(new Vector2(xStart, yStart + (i * 40 * ratio)), new Vector2(45 * ratio, 40 * ratio), texture); positions.Add(uniqueAbilities[i], yStart + (i * 40 * ratio)); Drawing.DrawRect( new Vector2(xStart - 2, (yStart - 2) + (i * 40 * ratio)), new Vector2((build.Count + 1) * 48 * ratio, 2), Color.Silver); } Drawing.DrawRect( new Vector2(xStart - 2, (yStart - 2) + (uniqueAbilities.Count * 40 * ratio)), new Vector2((build.Count + 1) * 48 * ratio, 2), Color.Silver); for (var i = 0; i < build.Count; i++) { var number = i + 1; if (number >= 10) { //skip level 10 (talent) number++; } if (number >= 15) { //skip level 15 (talent) number++; } if (number >= 17) { //skip level 17 (empty) number++; } var size = Drawing.MeasureText(number.ToString(), "Arial", new Vector2(35 * ratio), FontFlags.None); Drawing.DrawText( number.ToString(), "Arial", new Vector2(xStart + (45 * ratio) + (i * 48 * ratio) + (((48 * ratio) - size.X) / 2), positions[build[i].StoredName()]), new Vector2(35 * ratio), Color.White, FontFlags.None); Drawing.DrawRect( new Vector2((xStart - 2) + (i * 48 * ratio), yStart - 2), new Vector2(2, uniqueAbilities.Count * 40 * ratio), Color.Silver); } Drawing.DrawRect( new Vector2((xStart - 2) + (build.Count * 48 * ratio), yStart - 2), new Vector2(2, uniqueAbilities.Count * 40 * ratio), Color.Silver); Drawing.DrawRect( new Vector2((xStart - 2) + ((build.Count + 1) * 48 * ratio), yStart - 2), new Vector2(2, (uniqueAbilities.Count * 40 * ratio) + 2), Color.Silver); }
public void OnDraw() { if (!menuManager.IsOpen) { return; } var build = abilitylBuilder.GetBestBuild().ToList(); var uniqueAbilities = build.GroupBy(x => x) .Select(x => x.First()) .OrderBy(x => x.AbilitySlot) .Select(x => x.StoredName()) .ToList(); var ratio = HUDInfo.RatioPercentage(); var xStart = HUDInfo.ScreenSizeX() * 0.35f; var yStart = HUDInfo.ScreenSizeY() * 0.55f; var text = "Auto build preview (Win rate: " + abilitylBuilder.BestBuildWinRate + ")"; Drawing.DrawRect( new Vector2(xStart - 2, yStart - 35 * ratio), new Vector2( Drawing.MeasureText(text, "Arial", new Vector2(35 * ratio), FontFlags.None).X + 2, 35 * ratio), new Color(75, 75, 75, 175), false); Drawing.DrawRect( new Vector2(xStart - 2, yStart), new Vector2((build.Count + 1) * 48 * ratio + 2, uniqueAbilities.Count * 40 * ratio), new Color(75, 75, 75, 175), false); Drawing.DrawText( text, "Arial", new Vector2(xStart, yStart - 35 * ratio), new Vector2(35 * ratio), Color.Orange, FontFlags.None); var positions = new Dictionary <string, float>(); for (var i = 0; i < uniqueAbilities.Count; i++) { Drawing.DrawRect( new Vector2(xStart, yStart + i * 40 * ratio), new Vector2(45 * ratio, 40 * ratio), Textures.GetSpellTexture(uniqueAbilities[i])); positions.Add(uniqueAbilities[i], xStart + i * 40 * ratio - 63 * ratio); Drawing.DrawRect( new Vector2(xStart - 2, yStart - 2 + i * 40 * ratio), new Vector2((build.Count + 1) * 48 * ratio, 2), Color.Silver); } Drawing.DrawRect( new Vector2(xStart - 2, yStart - 2 + uniqueAbilities.Count * 40 * ratio), new Vector2((build.Count + 1) * 48 * ratio, 2), Color.Silver); for (var i = 0; i < build.Count; i++) { var number = (i + 1).ToString(); var size = Drawing.MeasureText(number, "Arial", new Vector2(35 * ratio), FontFlags.None); Drawing.DrawText( number, "Arial", new Vector2( xStart + 45 * ratio + i * 48 * ratio + (48 * ratio - size.X) / 2, positions[build[i].StoredName()]), new Vector2(35 * ratio), Color.White, FontFlags.None); Drawing.DrawRect( new Vector2(xStart - 2 + i * 48 * ratio, yStart - 2), new Vector2(2, uniqueAbilities.Count * 40 * ratio), Color.Silver); } Drawing.DrawRect( new Vector2(xStart - 2 + build.Count * 48 * ratio, yStart - 2), new Vector2(2, uniqueAbilities.Count * 40 * ratio), Color.Silver); Drawing.DrawRect( new Vector2(xStart - 2 + (build.Count + 1) * 48 * ratio, yStart - 2), new Vector2(2, uniqueAbilities.Count * 40 * ratio + 2), Color.Silver); }