예제 #1
0
 public void DrawCircle()
 {
     _circle = new Render.Circle(WardObject.Position, 100, Color, 5, true);
     _circle.VisibleCondition += sender => WardDetector.IsActive() && Render.OnScreen(Drawing.WorldToScreen(WardObject.Position));
     _circle.Add(0);
     if (Type != WardType.Trap)
     {
         _minimapSprite = new Render.Sprite(Bitmap, MinimapPosition)
         {
             Scale = new Vector2(Scale, Scale)
         };
         _minimapSprite.Add(0);
     }
     if (Duration == int.MaxValue)
     {
         return;
     }
     _timerText = new Render.Text(10, 10, "t", 18, new ColorBGRA(255, 255, 255, 255))
     {
         OutLined       = true,
         PositionUpdate = () => Drawing.WorldToScreen(WardObject.Position),
         Centered       = true
     };
     _timerText.VisibleCondition +=
         sender => WardDetector.IsActive() && Render.OnScreen(Drawing.WorldToScreen(WardObject.Position));
     _timerText.TextUpdate = () => Utils.FormatTime((EndTime - Environment.TickCount) / 1000f);
     _timerText.Add(2);
 }
예제 #2
0
파일: Program.cs 프로젝트: xioa123/CN
 public PreviewCircle()
 {
     Drawing.OnEndScene += Drawing_OnEndScene;
     _mapCircle          = new Render.Circle(ObjectManager.Player, 0, System.Drawing.Color.Red, 5);
     _mapCircle.Add(0);
     _mapCircle.VisibleCondition = sender => _lastChanged > 0 && Game.ClockTime - _lastChanged < Delay;
 }
예제 #3
0
        private static void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args)
        {
            var unit = sender as Obj_AI_Base;

            if (unit == null || !unit.IsValid)
            {
                return;
            }

            var enemy =
                ObjectManager.Get <Obj_AI_Hero>().FirstOrDefault(h => h.IsValid && h.IsEnemy && h.Name.Equals(unit.Name));

            if (enemy == null || !enemy.IsValid)
            {
                return;
            }

            Game.SendPing((PingCategory)1, enemy);

            var circle = new Render.Circle(enemy, 200, Color.Red)
            {
                VisibleCondition = o => enemy.IsVisible && unit.IsValid
            };

            circle.Add();

            MonitoredUnits.Add(unit.NetworkId, circle);
        }
예제 #4
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            foreach (var c in
                     ControllerArray.Select(controlId => new Controller((UserIndex)controlId)).Where(c => c.IsConnected))
            {
                Controller = new GamepadState(c.UserIndex);
            }

            if (Controller == null || !Controller.Connected)
            {
                Game.PrintChat("No controller detected!");
                return;
            }

            Menu      = new Menu("ControllerTest", "ControllerTest", true);
            OrbWalker = new Orbwalking.Orbwalker(Menu);
            Menu.AddItem(new MenuItem("Draw", "Draw Circle").SetValue(true));
            Menu.AddToMainMenu();

            if (Menu.Item("Draw").GetValue <bool>())
            {
                CurrentPosition = new Render.Circle(ObjectManager.Player.Position, 100, Color.Red, 2);
                CurrentPosition.Add();
                Text          = new Render.Text(new Vector2(50, 50), "MODE: " + CurrentMode, 30, new ColorBGRA(255, 0, 0, 255));
                Text.OutLined = true;
                Text.Add();
            }

            Utility.DebugMessage(
                "<b><font color =\"#FFFFFF\">ControlSharp by </font><font color=\"#5C00A3\">Trees</font><font color =\"#FFFFFF\"> loaded!</font></b>");

            Menu.Item("Draw").ValueChanged += OnValueChanged;
            Game.OnGameUpdate += Game_OnGameUpdate;
        }
예제 #5
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            foreach (var c in
                     ControllerArray.Select(controlId => new Controller((UserIndex)controlId)).Where(c => c.IsConnected))
            {
                Control = c;
            }

            if (Control == null || !Control.IsConnected)
            {
                Game.PrintChat("No controller detected!");
                return;
            }

            Menu      = new Menu("ControllerTest", "ControllerTest", true);
            OrbWalker = new Orbwalking.Orbwalker(Menu);
            Menu.AddItem(new MenuItem("Draw", "Draw Circle").SetValue(true));
            Menu.AddToMainMenu();

            if (Menu.Item("Draw").GetValue <bool>())
            {
                CurrentPosition = new Render.Circle(ObjectManager.Player.Position, 100, Color.Red, 2);
                CurrentPosition.Add();
            }

            Menu.Item("Draw").ValueChanged += OnValueChanged;
            Game.OnGameUpdate += Game_OnGameUpdate;
        }
예제 #6
0
 private static void OnValueChanged(object sender, OnValueChangeEventArgs onValueChangeEventArgs)
 {
     if (onValueChangeEventArgs.GetNewValue <bool>())
     {
         CurrentPosition = new Render.Circle(ObjectManager.Player.Position, 100, Color.Red, 2);
         CurrentPosition.Add();
     }
     else
     {
         CurrentPosition.Remove();
     }
 }
예제 #7
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            foreach (var entry in CircleDictionary)
            {
                Obj_AI_Hero   hero    = entry.Key;
                Render.Circle circle  = entry.Value;
                float         AARange = Orbwalking.GetRealAutoAttackRange(hero);

                circle.Radius = AARange;
                circle.Color  = ObjectManager.Player.Distance(hero) < AARange ? Color.Red : Color.LimeGreen;
            }
        }
예제 #8
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            foreach (var hero in ObjectManager.Get <Obj_AI_Hero>().Where(hero => hero.IsValid && hero.IsEnemy))
            {
                var circle = new Render.Circle(hero, Orbwalking.GetRealAutoAttackRange(hero), Color.Red, 4, true);
                circle.Add();
                CircleDictionary.Add(hero, circle);
            }

            Game.OnGameUpdate += Game_OnGameUpdate;
            Game.PrintChat("Attack Range Loaded!");
        }
예제 #9
0
파일: Program.cs 프로젝트: djole353/port2
        public PreviewCircle()
        {
            Drawing.OnEndScene += Drawing_OnEndScene;

            AppDomain.CurrentDomain.ProcessExit += (sender, args) => this.Unload();

            Drawing.OnPostReset += Drawing_OnPostReset;
            Drawing.OnPreReset  += Drawing_OnPreReset;

            CustomEvents.Game.OnGameEnd += Game_OnGameEnd;

            _mapCircle = new Render.Circle(ObjectManager.Player, 0, System.Drawing.Color.Red, 5);
            _mapCircle.Add(0);
            _mapCircle.VisibleCondition = sender => _lastChanged > 0 && Game.Time - _lastChanged < Delay;
        }
예제 #10
0
            public InternalSharedExperience(Obj_AI_Hero hero)
            {
                Experience   = hero.Experience;
                VisibleTime  = Game.Time;
                LastExpTime  = Game.Time;
                LastCallTime = Game.Time;

                Text         = new Render.Text("", hero, new Vector2(10, -30), 20, Color.Azure);
                Text.Visible = false;
                Text.Add();

                Circle         = new Render.Circle(hero, 1600, System.Drawing.Color.OrangeRed);
                Circle.Visible = false;
                Circle.Add();
            }
예제 #11
0
 private static void OnValueChanged(object sender, OnValueChangeEventArgs onValueChangeEventArgs)
 {
     if (onValueChangeEventArgs.GetNewValue <bool>())
     {
         CurrentPosition = new Render.Circle(ObjectManager.Player.Position, 100, Color.Red, 2);
         CurrentPosition.Add();
         Text          = new Render.Text(new Vector2(50, 50), "MODE: " + CurrentMode, 30, new ColorBGRA(255, 0, 0, 255));
         Text.OutLined = true;
         Text.Add();
     }
     else
     {
         CurrentPosition.Remove();
         Text.Remove();
     }
 }
예제 #12
0
        public static void Initialize(MenuItem drawPix)
        {
            _drawPix = drawPix;
            FindPix();
            _circle = new Render.Circle(Vector3.Zero, 50, Color.Purple);
            _circle.VisibleCondition += sender => _drawPix.IsActive();
            _circle.Add();

            Obj_AI_Base.OnBuffRemove += (sender, args) =>
            {
                if (args.Buff.SourceName == ObjectManager.Player.ChampionName && (args.Buff.Name == "luluevision" || args.Buff.Name == "lulufaerieshield"))
                {
                    _lastECast = 0;
                }
            };
            Game.OnUpdate += Game_OnUpdate;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
        }
예제 #13
0
        public void CreateRenderObjects()
        {
            //Create the minimap sprite.

            if (Range == 1100)
            {
                _minimapSprite       = new Render.Sprite(WardData.Bitmap, MinimapPosition);
                _minimapSprite.Scale = new Vector2(_scale, _scale);
                _minimapSprite.Add(0);
            }

            //Create the circle:
            _defaultCircle = new Render.Circle(Position, 200, Color, 5, true);
            _defaultCircle.VisibleCondition +=
                sender =>
                WardTracker.Config.Item("Enabled").GetValue <bool>() &&
                !WardTracker.Config.Item("Details").GetValue <KeyBind>().Active&&
                Render.OnScreen(Drawing.WorldToScreen(Position));
            _defaultCircle.Add(0);
            _defaultCircleFilled = new Render.Circle(Position, 200, Color.FromArgb(25, Color), -142857, true);
            _defaultCircleFilled.VisibleCondition +=
                sender =>
                WardTracker.Config.Item("Enabled").GetValue <bool>() &&
                !WardTracker.Config.Item("Details").GetValue <KeyBind>().Active&&
                Render.OnScreen(Drawing.WorldToScreen(Position));
            _defaultCircleFilled.Add(-1);

            //Create the circle that shows the range
            _rangeCircle = new Render.Circle(Position, Range, Color, 10, false);
            _rangeCircle.VisibleCondition +=
                sender =>
                WardTracker.Config.Item("Enabled").GetValue <bool>() &&
                WardTracker.Config.Item("Details").GetValue <KeyBind>().Active;
            _rangeCircle.Add(0);

            _rangeCircleFilled = new Render.Circle(Position, Range, Color.FromArgb(25, Color), -142857, true);
            _rangeCircleFilled.VisibleCondition +=
                sender =>
                WardTracker.Config.Item("Enabled").GetValue <bool>() &&
                WardTracker.Config.Item("Details").GetValue <KeyBind>().Active;
            _rangeCircleFilled.Add(-1);


            //Missile line;
            if (IsFromMissile)
            {
                _missileLine = new Render.Line(new Vector2(), new Vector2(), 2, new ColorBGRA(255, 255, 255, 255));
                _missileLine.EndPositionUpdate   = () => Drawing.WorldToScreen(Position);
                _missileLine.StartPositionUpdate = () => Drawing.WorldToScreen(StartPosition);
                _missileLine.VisibleCondition   +=
                    sender =>
                    WardTracker.Config.Item("Enabled").GetValue <bool>() &&
                    WardTracker.Config.Item("Details").GetValue <KeyBind>().Active;
                _missileLine.Add(0);
            }


            //Create the timer text:
            if (Duration != int.MaxValue)
            {
                _timerText                   = new Render.Text(10, 10, "t", 18, new ColorBGRA(255, 255, 255, 255));
                _timerText.OutLined          = true;
                _timerText.PositionUpdate    = () => Drawing.WorldToScreen(Position);
                _timerText.Centered          = true;
                _timerText.VisibleCondition +=
                    sender =>
                    WardTracker.Config.Item("Enabled").GetValue <bool>() &&
                    Render.OnScreen(Drawing.WorldToScreen(Position));

                _timerText.TextUpdate =
                    () =>
                    (IsFromMissile ? "?? " : "") + Utils.FormatTime((EndT - Environment.TickCount) / 1000f) +
                    (IsFromMissile ? " ??" : "");
                _timerText.Add(2);
            }
        }