Skip to content

Commit

Permalink
added select ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
fueledbyflux committed Dec 1, 2014
1 parent 46da6de commit bd0411d
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 479 deletions.
Binary file modified CustomTS/CustomTS.v12.suo
Binary file not shown.
51 changes: 41 additions & 10 deletions CustomTS/CustomTS/Class1.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -14,11 +15,18 @@ public static class CTS
{
private static bool DrawText;
private static Menu Menu;
private static Menu Config;
private static String text = "Target Selector Mode is now: ";
private static Obj_AI_Hero selectedTarget;
private static float selectedRange = 1000;


public static void addTSToMenu(this Menu MainMenu)
{
var menu = MainMenu.AddSubMenu(new Menu("Target Selector", "Target Selector"));
menu.AddItem(new MenuItem("Selected Target", "Left Click Target")).SetValue(true);
menu.AddItem(new MenuItem("STR", "Left Click Target Range")).SetValue(new Slider(1500, 1, 3000));
menu.AddItem(new MenuItem("STS", "Select Smite Target if near buff")).SetValue(true).SetShared();
menu.AddItem(new MenuItem("Draw Target", "Draw Target")).SetValue(new Circle(true, Color.DodgerBlue));
menu.AddItem(new MenuItem("Selected Mode", "Selected Mode"))
.SetValue(
Expand All @@ -34,22 +42,41 @@ public static void addTSToMenu(this Menu MainMenu)
}
priorMenu.AddItem(new MenuItem("Lowest no. is Highest", "Lowest is Highest"));
Game.OnGameUpdate += a => UpdateTSMode(MainMenu);
Game.OnWndProc += Game_OnWndProc;
Drawing.OnDraw += Drawing_OnDraw;

}

private static void Drawing_OnDraw(EventArgs args)
static void Drawing_OnDraw(EventArgs args)
{
if (Target() != null && Menu.Item("Draw Target").GetValue<Circle>().Active)
{
Utility.DrawCircle(Target().Position, 120, Menu.Item("Draw Target").GetValue<Circle>().Color);
Utility.DrawCircle(Target().Position, 120, Target() == selectedTarget ? Color.Red : Menu.Item("Draw Target").GetValue<Circle>().Color);
}
if (DrawText)

}

static void Game_OnWndProc(WndEventArgs args)
{
if (Menu.Item("Selected Target").GetValue<bool>() == false) return;
if (MenuGUI.IsChatOpen || ObjectManager.Player.Spellbook.SelectedSpellSlot != SpellSlot.Unknown)
{
Drawing.DrawText(100, 100, Color.White, text);
return;
}
if (args.WParam == 1) // LMouse
{
foreach (var hero in ObjectManager.Get<Obj_AI_Hero>())
{
if (hero.IsValidTarget() &&
Vector2.Distance(Game.CursorPos.To2D(), hero.ServerPosition.To2D()) < 300)
{
selectedTarget = hero;
Utility.DelayAction.Add(5000, () => selectedTarget = null);
}
}
}
}


private static int fatness(this Obj_AI_Hero t)
{
return (int) (t.ChampionsKilled*1 + t.Assists*0.375 + t.MinionsKilled*0.067);
Expand All @@ -58,8 +85,7 @@ private static int fatness(this Obj_AI_Hero t)
public static void UpdateTSMode(Menu Config)
{
Menu = Config;



bool Priority = false;
TargetSelector.TargetingMode mode = TargetSelector.GetTargetingMode();
switch (Config.Item("Selected Mode").GetValue<StringList>().SelectedIndex)
Expand Down Expand Up @@ -95,16 +121,16 @@ public static void UpdateTSMode(Menu Config)
if (TargetSelector.GetTargetingMode() != mode && Priority == false)
{
TargetSelector.SetTargetingMode(mode);
text = ("Target Selector Mode is now: " + mode);
DrawText = true;
Utility.DelayAction.Add(2000, () => { DrawText = false; });
}

if (selectedTarget.IsDead && selectedTarget != null) { selectedTarget = null; }
}

public static Obj_AI_Hero Target()
{
var priorty = 5;
Obj_AI_Hero target = null;
if (selectedTarget != null && selectedTarget.IsValidTarget(Menu.Item("STR").GetValue<Slider>().Value)) return selectedTarget;
if (Menu.Item("Selected Mode").GetValue<StringList>().SelectedIndex == 8)
{

Expand Down Expand Up @@ -133,6 +159,11 @@ public static void setRange(float range)
TargetSelector.SetRange(range);
}

public static void setSelectRange(float MaxRange)
{
Menu.Item("STR").SetValue(new Slider((int)MaxRange, 1, 3000));
}

private static TargetSelector TargetSelector = new TargetSelector(0, TargetSelector.TargetingMode.AutoPriority);
}
}
4 changes: 2 additions & 2 deletions CustomTS/CustomTS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
Binary file removed CustomTS/CustomTS/bin/Release/CustomTS.dll
Binary file not shown.
Binary file removed CustomTS/CustomTS/bin/Release/CustomTS.pdb
Binary file not shown.
Binary file not shown.
Binary file removed CustomTS/CustomTS/bin/Release/LeagueSharp.dll
Binary file not shown.
Loading

0 comments on commit bd0411d

Please sign in to comment.