Example #1
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            this._greenWardTexture = Resources.WT_Green.ToTexture();
            this._pinkWardTexture  = Resources.WT_Pink.ToTexture();

            this._sprite = MDrawing.GetSprite();
            this._text   = MDrawing.GetFont(this.Menu.Item("wardtracker.FontSize").GetValue <Slider>().Value);
            this._line   = MDrawing.GetLine(this.Menu.Item("wardtracker.CircleThickness").GetValue <Slider>().Value);

            Game.OnUpdate += this.OnGameUpdate;
            Obj_AI_Base.OnProcessSpellCast += this.OnObjAiBaseProcessSpellCast;
            GameObject.OnCreate            += this.OnGameObjectCreate;
            GameObject.OnDelete            += this.OnGameObjectDelete;
            Drawing.OnEndScene             += this.OnDrawingEndScene;
            Game.OnWndProc          += this.OnGameWndProc;
            AttackableUnit.OnCreate += this.OnAttackableUnitEnterVisiblityClient;

            Drawing.OnPreReset += args =>
            {
                this._line.OnLostDevice();
                this._sprite.OnLostDevice();
                this._text.OnLostDevice();
            };

            Drawing.OnPostReset += args =>
            {
                this._line.OnResetDevice();
                this._sprite.OnResetDevice();
                this._text.OnResetDevice();
            };
        }
Example #2
0
File: Replay.cs Project: hama1/Port
        protected sealed override void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);
                Menu.AddItem(new MenuItem(Name + "DoRecord", "Do Record").SetValue(false));
                Menu.AddItem(new MenuItem(Name + "IsRecording", "Notify Record").SetValue(false));
                Menu.AddItem(new MenuItem(Name + "CheckInterval", "Check Interval").SetValue(new Slider(3, 1, 10)))
                .ValueChanged += delegate(object o, OnValueChangeEventArgs args)
                {
                    if (_timer != null)
                    {
                        _timer.Interval = args.GetNewValue <Slider>().Value * 60 * 1000;
                    }
                };

                Menu.AddItem(new MenuItem(Name + "Enabled", "Enabled").SetValue(false));

                Parent.Menu.AddSubMenu(Menu);

                _sprite = MDrawing.GetSprite();
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #3
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            if (!HeroManager.Enemies.Any())
            {
                return;
            }

            this.teleportTexture = Resources.LP_Teleport.ToTexture();

            var spawn = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy);

            this.spawnPoint = spawn != null ? spawn.Position : Vector3.Zero;

            foreach (var enemy in HeroManager.Enemies)
            {
                this.heroTextures[enemy.NetworkId] =
                    (ImageLoader.Load("LP", enemy.ChampionName) ?? Resources.LP_Default).ToTexture();
                var eStruct = new LastPositionStruct(enemy)
                {
                    LastPosition = this.spawnPoint
                };
                this.lastPositions.Add(eStruct);
            }

            Drawing.OnEndScene     += this.OnDrawingEndScene;
            Obj_AI_Base.OnTeleport += this.OnObjAiBaseTeleport;

            Drawing.OnPreReset  += args => { this.text.OnLostDevice(); };
            Drawing.OnPostReset += args => { this.text.OnResetDevice(); };

            this.sprite = MDrawing.GetSprite();
            this.text   = MDrawing.GetFont(getSliderItem(this.Menu, "LastPosition.FontSize"));
            this.line   = MDrawing.GetLine(1);
        }
Example #4
0
        protected override sealed void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);
                var drawingMenu = new Menu(Global.Lang.Get("G_Drawing"), Name + "Drawing");
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "TimeFormat", Global.Lang.Get("G_TimeFormat")).SetValue(
                        new StringList(new[] { "mm:ss", "ss" })));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "FontSize", Global.Lang.Get("G_FontSize")).SetValue(
                        new Slider(13, 3, 30)));
                drawingMenu.AddItem(
                    new MenuItem(
                        drawingMenu.Name + "SSTimerOffset",
                        Global.Lang.Get("LastPosition_SSTimer") + " " + Global.Lang.Get("G_Offset")).SetValue(
                        new Slider(5, 0, 20)));

                Menu.AddSubMenu(drawingMenu);

                Menu.AddItem(new MenuItem(Name + "SSTimer", Global.Lang.Get("LastPosition_SSTimer")).SetValue(false));
                Menu.AddItem(new MenuItem(Name + "Enabled", Global.Lang.Get("G_Enabled")).SetValue(false));

                Parent.Menu.AddSubMenu(Menu);

                _sprite = MDrawing.GetSprite();
                _text   = MDrawing.GetFont(Menu.Item(Name + "DrawingFontSize").GetValue <Slider>().Value);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #5
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            try
            {
                this._hudTexture     = Resources.CD_Hud.ToTexture();
                this._hudSelfTexture = Resources.CD_HudSelf.ToTexture();

                foreach (var enemy in HeroManager.AllHeroes)
                {
                    var lEnemy = enemy;
                    this._spellDatas.Add(
                        enemy.NetworkId,
                        this._spellSlots.Select(slot => lEnemy.GetSpell(slot)).ToList());
                    this._summonerDatas.Add(
                        enemy.NetworkId,
                        this._summonerSlots.Select(slot => lEnemy.GetSpell(slot)).ToList());
                }

                foreach (var sName in
                         HeroManager.AllHeroes.SelectMany(
                             h =>
                             this._summonerSlots.Select(summoner => h.Spellbook.GetSpell(summoner).Name.ToLower())
                             .Where(sName => !this._summonerTextures.ContainsKey(FixName(sName)))))
                {
                    this._summonerTextures[FixName(sName)] =
                        ((Bitmap)Resources.ResourceManager.GetObject(string.Format("CD_{0}", FixName(sName)))
                         ?? Resources.CD_SummonerBarrier).ToTexture();
                }

                this._heroes = getCheckBoxItem(this.Menu, "cooldown-tracker-Ally") &&
                               getCheckBoxItem(this.Menu, "cooldown-tracker-Enemy")
                                   ? HeroManager.AllHeroes.ToList()
                                   : (getCheckBoxItem(this.Menu, "cooldown-tracker-Ally")
                                          ? HeroManager.Allies
                                          : (getCheckBoxItem(this.Menu, "cooldown-tracker-Enemy")
                                                 ? HeroManager.Enemies
                                                 : new List <AIHeroClient>())).ToList();

                if (!getCheckBoxItem(this.Menu, "cooldown-tracker-Self"))
                {
                    this._heroes.RemoveAll(h => h.NetworkId == ObjectManager.Player.NetworkId);
                }

                this._sprite = MDrawing.GetSprite();
                this._line   = MDrawing.GetLine(4);
                this._text   = MDrawing.GetFont(getSliderItem(this.Menu, "cooldown-tracker-FontSize"));

                Drawing.OnEndScene             += this.OnDrawingEndScene;
                Obj_AI_Base.OnProcessSpellCast += this.OnObjAiBaseProcessSpellCast;
                Obj_AI_Base.OnTeleport         += this.OnObjAiBaseTeleport;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #6
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            this._greenWardTexture = Resources.WT_Green.ToTexture();
            this._pinkWardTexture  = Resources.WT_Pink.ToTexture();

            this._sprite = MDrawing.GetSprite();
            this._text   = MDrawing.GetFont(getSliderItem(this.Menu, "wardtracker.FontSize"));
            this._line   = MDrawing.GetLine(getSliderItem(this.Menu, "wardtracker.CircleThickness"));

            Game.OnUpdate += this.OnGameUpdate;
            Obj_AI_Base.OnProcessSpellCast += this.OnObjAiBaseProcessSpellCast;
            GameObject.OnCreate            += this.OnGameObjectCreate;
            GameObject.OnDelete            += this.OnGameObjectDelete;
            Drawing.OnEndScene             += this.OnDrawingEndScene;
            Game.OnWndProc          += this.OnGameWndProc;
            AttackableUnit.OnCreate += this.OnAttackableUnitEnterVisiblityClient;
        }
        protected sealed override void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);
                var drawingMenu = new Menu("Drawing", Name + "Drawing");
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "TimeFormat", "Time Format").SetValue(
                        new StringList(new[] { "mm:ss", "ss" })));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "FontSize", "Font Size").SetValue(new Slider(13, 3, 30)));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "CircleRadius", "Circle Radius").SetValue(new Slider(150, 25, 300)));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "CircleThickness", "Circle Thickness").SetValue(
                        new Slider(2, 1, 10)));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "GreenCircle", "Green Circle").SetValue(true));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "GreenColor", "Green Color").SetValue(Color.Lime));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "PinkColor", "Pink Color").SetValue(Color.Magenta));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "TrapColor", "Trap Color").SetValue(Color.Red));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "VisionRange", "Vision Range").SetValue(true));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "Minimap", "Minimap").SetValue(true));

                Menu.AddSubMenu(drawingMenu);

                Menu.AddItem(new MenuItem(Name + "FilterWards", "Filter Wards").SetValue(new Slider(250, 0, 600)));
                Menu.AddItem(new MenuItem(Name + "Hotkey", "Hotkey").SetValue(new KeyBind(16, KeyBindType.Press)));
                Menu.AddItem(new MenuItem(Name + "PermaShow", "Perma Show").SetValue(false));

                Menu.AddItem(new MenuItem(Name + "Enabled", "Enabled").SetValue(true));

                Parent.Menu.AddSubMenu(Menu);

                _sprite = MDrawing.GetSprite();
                _text   = MDrawing.GetFont(Menu.Item(Name + "DrawingFontSize").GetValue <Slider>().Value);
                _line   = MDrawing.GetLine(Menu.Item(Name + "DrawingCircleThickness").GetValue <Slider>().Value);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #8
0
        protected override sealed void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);

                var drawingMenu = new Menu(Global.Lang.Get("G_Drawing"), Name + "Drawing");

                drawingMenu.AddItem(
                    new MenuItem(
                        drawingMenu.Name + "OffsetTop", Global.Lang.Get("G_Offset") + " " + Global.Lang.Get("G_Top"))
                    .SetValue(new Slider(150, 0, Drawing.Height)));

                drawingMenu.AddItem(
                    new MenuItem(
                        drawingMenu.Name + "OffsetRight", Global.Lang.Get("G_Offset") + " " + Global.Lang.Get("G_Right"))
                    .SetValue(new Slider(0, 0, Drawing.Width)));

                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "Scale", Global.Lang.Get("G_Scale")).SetValue(new Slider(10, 5, 15)));

                Menu.AddSubMenu(drawingMenu);
                Menu.AddItem(new MenuItem(Name + "Clickable", Global.Lang.Get("Sidebar_Clickable")).SetValue(false));

                Menu.AddItem(new MenuItem(Name + "Enabled", Global.Lang.Get("G_Enabled")).SetValue(false));

                Parent.Menu.AddSubMenu(Menu);

                _scale = Menu.Item(Menu.Name + "DrawingScale").GetValue <Slider>().Value / 10f;

                _text12 = MDrawing.GetFont((int)(Math.Ceiling(12 * _scale)));
                _text13 = MDrawing.GetFont((int)(Math.Ceiling(13 * _scale)));
                _text18 = MDrawing.GetFont((int)(Math.Ceiling(18 * _scale)));
                _text30 = MDrawing.GetFont((int)(Math.Ceiling(30 * _scale)));
                _line   = MDrawing.GetLine((int)(Math.Ceiling(9 * _scale)));
                _sprite = MDrawing.GetSprite();
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #9
0
        protected sealed override void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);

                var drawingMenu = new Menu("Drawing", Name + "Drawing");

                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "OffsetTop", "Offset Top").SetValue(
                        new Slider(150, 0, Drawing.Height)));

                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "OffsetRight", "Offset Right").SetValue(
                        new Slider(0, 0, Drawing.Width)));

                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "Spacing", "Spacing").SetValue(new Slider(10, 0, 30)));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "Scale", "Scale").SetValue(new Slider(10, 5, 15)));

                Menu.AddSubMenu(drawingMenu);
                Menu.AddItem(new MenuItem(Name + "Clickable", "Clickable").SetValue(false));

                Menu.AddItem(new MenuItem(Name + "Enabled", "Enabled").SetValue(true));

                Parent.Menu.AddSubMenu(Menu);

                _scale = Menu.Item(Menu.Name + "DrawingScale").GetValue <Slider>().Value / 10f;

                _text14 = MDrawing.GetFont((int)Math.Ceiling(14 * _scale));
                _text18 = MDrawing.GetFont((int)Math.Ceiling(18 * _scale));
                _line7  = MDrawing.GetLine((int)Math.Ceiling(7 * _scale));
                _line17 = MDrawing.GetLine((int)Math.Ceiling(17 * _scale));
                _line24 = MDrawing.GetLine((int)Math.Ceiling(24 * _scale));
                _sprite = MDrawing.GetSprite();
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #10
0
        protected sealed override void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);
                var drawingMenu = new Menu("Drawing", Name + "Drawing");
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "CircleThickness", "Circle Thickness").SetValue(
                        new Slider(1, 1, 10)));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "CircleColor", "Circle Color").SetValue(Color.White));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "TimeFormat", "Time Format").SetValue(
                        new StringList(new[] { "mm:ss", "ss" })));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "FontSize", "Font Size").SetValue(new Slider(13, 3, 30)));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "SSTimerOffset", "SS Timer Offset").SetValue(new Slider(5, 0, 20)));

                Menu.AddSubMenu(drawingMenu);

                Menu.AddItem(new MenuItem(Name + "SSTimer", "SS Timer").SetValue(false));
                Menu.AddItem(new MenuItem(Name + "SSCircle", "SS Circle").SetValue(false));
                Menu.AddItem(new MenuItem(Menu.Name + "Minimap", "Minimap").SetValue(true));
                Menu.AddItem(new MenuItem(Menu.Name + "Map", "Map").SetValue(true));

                Menu.AddItem(new MenuItem(Name + "Enabled", "Enabled").SetValue(false));

                Parent.Menu.AddSubMenu(Menu);

                _sprite = MDrawing.GetSprite();
                _text   = MDrawing.GetFont(Menu.Item(Name + "DrawingFontSize").GetValue <Slider>().Value);
                _line   = MDrawing.GetLine(1);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #11
0
        protected sealed override void OnLoad()
        {
            try
            {
                Menu = new Menu(Name, Name);
                var drawingMenu = new Menu("Drawing", Name + "Drawing");
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "TimeFormat", "Time Format").SetValue(
                        new StringList(new[] { "mm:ss", "ss" })));
                drawingMenu.AddItem(
                    new MenuItem(drawingMenu.Name + "FontSize", "Font Size").SetValue(new Slider(13, 3, 30)));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "Enemy", "Enemy").SetValue(false));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "Ally", "Ally").SetValue(false));
                drawingMenu.AddItem(new MenuItem(drawingMenu.Name + "Self", "Self").SetValue(false));

                Menu.AddSubMenu(drawingMenu);

                Menu.AddItem(new MenuItem(Name + "Enabled", "Enabled").SetValue(false));

                Menu.Item(Name + "DrawingEnemy").ValueChanged += delegate(object o, OnValueChangeEventArgs args)
                {
                    if (_heroes == null)
                    {
                        return;
                    }
                    var ally  = Menu.Item(Name + "DrawingAlly").GetValue <bool>();
                    var enemy = args.GetNewValue <bool>();
                    _heroes = ally && enemy
                        ? GameObjects.Heroes.ToList()
                        : (ally ? GameObjects.AllyHeroes : (enemy ? GameObjects.EnemyHeroes : new List <AIHeroClient>()))
                              .ToList();

                    if (Menu.Item(Name + "DrawingSelf").GetValue <bool>())
                    {
                        if (_heroes.All(h => h.NetworkId != ObjectManager.Player.NetworkId))
                        {
                            _heroes.Add(ObjectManager.Player);
                        }
                    }
                    else
                    {
                        _heroes.RemoveAll(h => h.NetworkId == ObjectManager.Player.NetworkId);
                    }
                };

                Menu.Item(Name + "DrawingAlly").ValueChanged += delegate(object o, OnValueChangeEventArgs args)
                {
                    if (_heroes == null)
                    {
                        return;
                    }
                    var ally  = args.GetNewValue <bool>();
                    var enemy = Menu.Item(Name + "DrawingEnemy").GetValue <bool>();
                    _heroes = ally && enemy
                        ? GameObjects.Heroes.ToList()
                        : (ally ? GameObjects.AllyHeroes : (enemy ? GameObjects.EnemyHeroes : new List <AIHeroClient>()))
                              .ToList();

                    if (Menu.Item(Name + "DrawingSelf").GetValue <bool>() &&
                        _heroes.All(h => h.NetworkId != ObjectManager.Player.NetworkId))
                    {
                        _heroes.Add(ObjectManager.Player);
                    }
                    if (Menu.Item(Name + "DrawingSelf").GetValue <bool>())
                    {
                        if (_heroes.All(h => h.NetworkId != ObjectManager.Player.NetworkId))
                        {
                            _heroes.Add(ObjectManager.Player);
                        }
                    }
                    else
                    {
                        _heroes.RemoveAll(h => h.NetworkId == ObjectManager.Player.NetworkId);
                    }
                };

                Menu.Item(Name + "DrawingSelf").ValueChanged += delegate(object o, OnValueChangeEventArgs args)
                {
                    if (_heroes == null)
                    {
                        return;
                    }
                    var ally  = Menu.Item(Name + "DrawingAlly").GetValue <bool>();
                    var enemy = Menu.Item(Name + "DrawingEnemy").GetValue <bool>();
                    _heroes = ally && enemy
                        ? GameObjects.Heroes.ToList()
                        : (ally ? GameObjects.AllyHeroes : (enemy ? GameObjects.EnemyHeroes : new List <AIHeroClient>()))
                              .ToList();

                    if (args.GetNewValue <bool>())
                    {
                        if (_heroes.All(h => h.NetworkId != ObjectManager.Player.NetworkId))
                        {
                            _heroes.Add(ObjectManager.Player);
                        }
                    }
                    else
                    {
                        _heroes.RemoveAll(h => h.NetworkId == ObjectManager.Player.NetworkId);
                    }
                };

                Parent.Menu.AddSubMenu(Menu);

                _sprite = MDrawing.GetSprite();
                _line   = MDrawing.GetLine(4);
                _text   = MDrawing.GetFont(Menu.Item(Name + "DrawingFontSize").GetValue <Slider>().Value);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Example #12
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            try
            {
                this._hudTexture     = Resources.CD_Hud.ToTexture();
                this._hudSelfTexture = Resources.CD_HudSelf.ToTexture();

                foreach (var enemy in HeroManager.AllHeroes)
                {
                    var lEnemy = enemy;
                    this._spellDatas.Add(
                        enemy.NetworkId,
                        this._spellSlots.Select(slot => lEnemy.GetSpell(slot)).ToList());
                    this._summonerDatas.Add(
                        enemy.NetworkId,
                        this._summonerSlots.Select(slot => lEnemy.GetSpell(slot)).ToList());
                }

                foreach (var sName in
                         HeroManager.AllHeroes.SelectMany(
                             h =>
                             this._summonerSlots.Select(summoner => h.Spellbook.GetSpell(summoner).Name.ToLower())
                             .Where(sName => !this._summonerTextures.ContainsKey(FixName(sName)))))
                {
                    this._summonerTextures[FixName(sName)] =
                        ((Bitmap)Resources.ResourceManager.GetObject(string.Format("CD_{0}", FixName(sName)))
                         ?? Resources.CD_SummonerBarrier).ToTexture();
                }

                this._heroes = this.Menu.Item("cooldown-tracker-Ally").GetValue <bool>() &&
                               this.Menu.Item("cooldown-tracker-Enemy").GetValue <bool>()
                                   ? HeroManager.AllHeroes.ToList()
                                   : (this.Menu.Item("cooldown-tracker-Ally").GetValue <bool>()
                                          ? HeroManager.Allies
                                          : (this.Menu.Item("cooldown-tracker-Enemy").GetValue <bool>()
                                                 ? HeroManager.Enemies
                                                 : new List <Obj_AI_Hero>())).ToList();

                if (!this.Menu.Item("cooldown-tracker-Self").GetValue <bool>())
                {
                    this._heroes.RemoveAll(h => h.NetworkId == ObjectManager.Player.NetworkId);
                }

                this._sprite = MDrawing.GetSprite();
                this._line   = MDrawing.GetLine(4);
                this._text   = MDrawing.GetFont(this.Menu.Item("cooldown-tracker-FontSize").GetValue <Slider>().Value);

                Drawing.OnEndScene += this.OnDrawingEndScene;

                Drawing.OnPreReset += args =>
                {
                    this._line.OnLostDevice();
                    this._sprite.OnLostDevice();
                    this._text.OnLostDevice();
                };

                Drawing.OnPostReset += args =>
                {
                    this._line.OnResetDevice();
                    this._sprite.OnResetDevice();
                    this._text.OnResetDevice();
                };

                Obj_AI_Base.OnProcessSpellCast += this.OnObjAiBaseProcessSpellCast;
                Obj_AI_Base.OnTeleport         += this.OnObjAiBaseTeleport;
            }
            catch (Exception e)
            {
                Logging.AddEntry(LoggingEntryType.Error, "@SpellTracker1.cs: An error occurred: {0}", e);
            }
        }
Example #13
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            if (!HeroManager.Enemies.Any())
            {
                return;
            }

            EloBuddy.SDK.Core.DelayAction(() =>
            {
                var multiplicator = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(1000, 1000, 0)).Distance(EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(2000, 1000, 0))) / 1000f;
                if (multiplicator <= float.Epsilon)
                {
                    Load();
                }
                else
                {
                    MinimapMultiplicator = multiplicator;
                    Vector2 leftUpper;
                    Vector2 rightLower;
                    if (Game.MapId == GameMapId.CrystalScar)
                    {
                        leftUpper  = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(0, 13800, 0));
                        rightLower = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(13800, 0, 0));
                    }
                    else
                    {
                        leftUpper  = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(0, 14800, 0));
                        rightLower = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(14800, 0, 0));
                    }

                    MinimapRectangle = new SharpDX.Rectangle((int)leftUpper.X, (int)leftUpper.Y, (int)(rightLower.X - leftUpper.X), (int)(rightLower.Y - leftUpper.Y));

                    this.teleportTexture = Resources.LP_Teleport.ToTexture();

                    var spawn       = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy);
                    this.spawnPoint = spawn != null ? spawn.Position : Vector3.Zero;

                    foreach (var enemy in HeroManager.Enemies)
                    {
                        this.heroTextures[enemy.NetworkId] =
                            (ImageLoader.Load("LP", enemy.ChampionName) ?? Resources.LP_Default).ToTexture();

                        var eStruct = new LastPositionStruct(enemy)
                        {
                            LastPosition = this.spawnPoint
                        };

                        this.lastPositions.Add(eStruct);
                    }


                    Drawing.OnEndScene += this.OnDrawingEndScene;

                    Teleport.OnTeleport += Teleport_OnTeleport;

                    this.sprite = MDrawing.GetSprite();
                    this.text   = MDrawing.GetFont(this.Menu.Item("LastPosition.FontSize").GetValue <Slider>().Value);
                    this.line   = MDrawing.GetLine(1);
                }
            }, 1000);
        }